public human(level Level) : base(Level) { iconPath = "humanIcon"; mobType = mobName.human; speed = 2; health = 50; attackDamage = 30; attackRange = 30; attackTime = 12000000; healthMax = health; }
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); }
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; }
void Form1_FormClosing(object sender, FormClosingEventArgs e) { Console.WriteLine("Form1 closing"); Level.Dispose(); Level = null; }
public zombie(level Level) : base(Level) { mobType = mobName.zombie; iconPath = "orc"; speed = 3; health = 35; attackDamage = 10; attackRange = 10; healthMax = health; }
public spider(level Level) : base(Level) { mobType = mobName.spider; iconPath = "SpiderGold"; health = 30; speed = 8; attackDamage = 5; attackRange = 10; healthMax = health; }
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; }