internal frmArcaneDefense()
        {
            InitializeComponent();

            //Startup the game state
            _gameState = new GameState(this);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        internal Enemy(GameState gameState, float x, float y, List<string> images)
            : base(gameState, x, y, images)
        {
            initialize(gameState);

            gameState.Enemies.Add(this);
        }
Esempio n. 4
0
 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;
 }
Esempio n. 5
0
        //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);
        }
Esempio n. 6
0
        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);
        }
Esempio n. 7
0
 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;
 }
Esempio n. 8
0
        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);
            }
        }
Esempio n. 9
0
        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);
        }
Esempio n. 10
0
 internal Burn(GameState gameState)
     : base(gameState)
 {
     this.ManaCost = initialManaCost;
 }
Esempio n. 11
0
 internal ConjureWall(GameState gameState)
     : base(gameState)
 {
     this.ManaCost = initialManaCost;
 }
Esempio n. 12
0
 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;
 }
Esempio n. 13
0
 internal DustCloud(GameState gameState)
     : base(gameState)
 {
     this.ManaCost = initialManaCost;
 }
Esempio n. 14
0
 internal Spell(GameState gameState)
 {
     _gameState = gameState;
 }
Esempio n. 15
0
 internal IncreaseMaxMana(GameState gameState)
     : base(gameState)
 {
     this.ManaCost = gameState.maxMana;
 }
Esempio n. 16
0
 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;
 }
Esempio n. 17
0
 internal UpgradeSpell(GameState gameState)
     : base(gameState)
 {
     this.ManaCost = initialManaCost;
 }
Esempio n. 18
0
 internal TurnEnemy(GameState gameState)
     : base(gameState)
 {
     this.ManaCost = initialManaCost;
 }
Esempio n. 19
0
 internal SummonWarrior(GameState gameState)
     : base(gameState)
 {
     this.ManaCost = initialManaCost;
 }
Esempio n. 20
0
 internal SummonMage(GameState gameState)
     : base(gameState)
 {
     this.ManaCost = initialManaCost;
 }
Esempio n. 21
0
 internal CastingRing(GameState gameState)
     : base(gameState, gameState.MouseLoc.X, gameState.MouseLoc.Y, images)
 {
     Cursor.Hide();
 }
Esempio n. 22
0
 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;
 }