コード例 #1
0
ファイル: mob.cs プロジェクト: ocept/g3
 public human(level Level)
     : base(Level)
 {
     iconPath = "humanIcon";
     mobType = mobName.human;
     speed = 2;
     health = 50;
     attackDamage = 30;
     attackRange = 30;
     attackTime = 12000000;
     healthMax = health;
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: ocept/g3
        public level Level; // = new level(); //spawn level

        #endregion Fields

        #region Constructors

        public Form1()
        {
            InitializeComponent();
            //level Level = new level();

            //for (int i = 0; i < 256; i++) keysDown[i] = 0;
            this.KeyPreview = true;
            this.KeyDown += new KeyEventHandler(Form1_KeyDown);
            this.KeyUp += new KeyEventHandler(Form1_KeyUp);
            this.FormClosing += new FormClosingEventHandler(Form1_FormClosing);
            Level = new level(this);
            Level.playerDead += new level.playerDeadHandler(Level_playerDead);
        }
コード例 #3
0
ファイル: mob.cs プロジェクト: ocept/g3
 public mob(level Level)
 {
     //addIconControl(imgURL);
     Random rand = new Random();
     xPos = Level.screenOffsetX + rand.Next(Level.parentForm.Width);
     yPos = Level.screenOffsetY + rand.Next(Level.parentForm.Height);
     const int ctrSize = 200;
     if (Level.parentForm.Width / 2 - ctrSize < xPos - Level.screenOffsetX && xPos - Level.screenOffsetX < Level.parentForm.Width / 2 + ctrSize &&
         Level.parentForm.Height / 2 - ctrSize < yPos - Level.screenOffsetY && yPos - Level.screenOffsetY < Level.parentForm.Height / 2 + ctrSize)
         xPos = xPos > Level.parentForm.Width + Level.screenOffsetX ? xPos += ctrSize : xPos -= ctrSize;//dont spawn right is middle of screen next to player
     bearing = rand.NextDouble() * 2 * Math.PI; //assign random bearing
     alive = true;
     lastFired = DateTime.MinValue;
     attackTime = 10000000;
     sightRange = 350;
     height = 32;
     width = 32;
 }
コード例 #4
0
ファイル: Form1.cs プロジェクト: ocept/g3
 void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     Console.WriteLine("Form1 closing");
     Level.Dispose();
     Level = null;
 }
コード例 #5
0
ファイル: mob.cs プロジェクト: ocept/g3
 public zombie(level Level)
     : base(Level)
 {
     mobType = mobName.zombie;
     iconPath = "orc";
     speed = 3;
     health = 35;
     attackDamage = 10;
     attackRange = 10;
     healthMax = health;
 }
コード例 #6
0
ファイル: mob.cs プロジェクト: ocept/g3
 public spider(level Level)
     : base(Level)
 {
     mobType = mobName.spider;
     iconPath = "SpiderGold";
     health = 30;
     speed = 8;
     attackDamage = 5;
     attackRange = 10;
     healthMax = health;
 }
コード例 #7
0
ファイル: mob.cs プロジェクト: ocept/g3
 public player(level Level)
     : base(Level)
 {
     attackTime = 3000000;
     mobType = mobName.player;
     speed = 7;
     xPos = Level.screenOffsetX + Level.parentForm.Width / 2;
     yPos = Level.screenOffsetY + Level.parentForm.Height / 2 - 9;
     //addIconControl("humanIcon.gif", Level);
     health = 100;
     healthMax = health;
 }