internal frmArcaneDefense() { InitializeComponent(); //Startup the game state _gameState = new GameState(this); }
internal Sprite(GameState gameState, float x, float y, List<string> images) { LoadFrameList(gameState, x, y, images); //Add this Sprite to the list of objects to be drawn each frame gameState.GameObjects.Add(this); }
internal Enemy(GameState gameState, float x, float y, List<string> images) : base(gameState, x, y, images) { initialize(gameState); gameState.Enemies.Add(this); }
internal University(GameState gameState, float x, float y, float width, float height) : base(gameState, x, y, new List<string>() { @"images\University.jpg"}) { this.Size = new SizeF(width, height); initialize(); gameState.University = this; }
//private static List<string> movingImages = new List<string>() { @"images\enemies\warrior1.jpg", @"images\enemies\warrior2.jpg", @"images\enemies\warrior3.jpg"}; //private List<string> attackImages = new List<string>() { @"images\enemies\warrior4.jpg", @"images\enemies\warrior5.jpg", @"images\enemies\warrior6.jpg" }; internal Warrior(GameState gameState, float x, float y) : base(gameState, x, y, image) { base.MaxHealth = StartingValues.WarriorMaxHealth; this.Health = StartingValues.WarriorMaxHealth; this.damage = StartingValues.WarriorDamage; //Start off in the moving state setMovingState(gameState.gameTime); }
protected void CalculateVelocity(GameState gameState, int speed) { PointF univLoc = _gameState.University.Location; univLoc.X += _gameState.University.Size.Width / 2; float xDistance = univLoc.X - this.Location.X; float yDistance = univLoc.Y - this.Location.Y; float hypotenuseDistance = (float)Math.Sqrt(Math.Pow(xDistance, 2) + Math.Pow(yDistance, 2)); this.Velocity = new PointF(((univLoc.X - this.Size.Width/2 - this.Location.X) / hypotenuseDistance) * speed, ((univLoc.Y - this.Size.Height/2 - this.Location.Y) / hypotenuseDistance) * speed); }
internal SpellButton(GameState gameState, string spellName, float x, float y, List<string> images, string selectedFilename, char hotkey, Spell spell) : base(gameState, x, y, images) { this.DefaultImage = new Bitmap(images[0]); this.SelectedImage = new Bitmap(selectedFilename); this.HiddenImage = new Bitmap(@"images\Spells\QuestionMark.png"); this.Hotkey = hotkey; this.Spell = spell; this.spellName = spellName; this.Size.Height = this.Size.Width = gameState.GameArea.Width / 10; }
protected void LoadFrameList(GameState gameState, float x, float y, List<string> images) { _frames.Clear(); for (int i = 0; i <= (images.Count - 1); i++) { //Load the bitmap _frames.Add(new Bitmap(Image.FromFile(images[i]))); _frames[i].MakeTransparent(); //Set the location and use the height and width from the 1st frame initialize(gameState, x, y, _frames[0].Width, _frames[0].Height); } }
internal Gauge(GameState gameState, float x, float y, float length, float thickness, Color insideColor, Color damagedColor, bool vertical) : base() { this.vertical = vertical; float width; float height; if (vertical == false) { height = thickness; width = length; } else { width = thickness; height = length; } initialize(gameState, x, y, width, height, insideColor, damagedColor); gameState.GameObjects.Add(this); }
internal Burn(GameState gameState) : base(gameState) { this.ManaCost = initialManaCost; }
internal ConjureWall(GameState gameState) : base(gameState) { this.ManaCost = initialManaCost; }
private void initialize(GameState gameState, float x, float y, float width, float height) { _gameState = gameState; SpawnTime = _gameState.gameTime; Location.X = x; Location.Y = y; Size.Width = width; Size.Height = height; CurrentFrame = 0; }
internal DustCloud(GameState gameState) : base(gameState) { this.ManaCost = initialManaCost; }
internal Spell(GameState gameState) { _gameState = gameState; }
internal IncreaseMaxMana(GameState gameState) : base(gameState) { this.ManaCost = gameState.maxMana; }
private void initialize(GameState gameState) { speed = gameState.randNumberGenerator.Next(StartingValues.EnemyMinSpeed, StartingValues.EnemyMaxSpeed); CalculateVelocity(gameState, this.speed); this.HealthBar = new Gauge(gameState, this.Location.X, this.Location.Y + 38 + 3, 38, 38/ 6, Color.Yellow, Color.Red, false); this.HealthBar.Velocity = this.Velocity; }
internal UpgradeSpell(GameState gameState) : base(gameState) { this.ManaCost = initialManaCost; }
internal TurnEnemy(GameState gameState) : base(gameState) { this.ManaCost = initialManaCost; }
internal SummonWarrior(GameState gameState) : base(gameState) { this.ManaCost = initialManaCost; }
internal SummonMage(GameState gameState) : base(gameState) { this.ManaCost = initialManaCost; }
internal CastingRing(GameState gameState) : base(gameState, gameState.MouseLoc.X, gameState.MouseLoc.Y, images) { Cursor.Hide(); }
private void initialize(GameState gameState, float x, float y, float width, float height, Color insideColor, Color damagedColor) { _gameState = gameState; Location.X = x; Location.Y = y; MaxSize.Width = width + 1; MaxSize.Height = height + 1; CurrentSize.Width = width; CurrentSize.Height = height; this.insideColor = insideColor; this.damagedColor = damagedColor; }