Beispiel #1
0
        public void UltraAttack()
        {
            var top  = this.Player.Top;
            var left = this.Player.Left + this.Player.Width;

            var inferno = new InfernoViewModel(top, left);

            this.gameObjects.Add(inferno);
            this.fireballs.Add(inferno);
        }
Beispiel #2
0
        public void Attack()
        {
            var top  = this.Player.Top;
            var left = this.Player.Left + this.Player.Width;
            var ultraAttackChance = 5;
            FireballViewModel fireball;

            if (rand.Next(100) < ultraAttackChance)
            {
                fireball = new InfernoViewModel(top, left);
            }
            else
            {
                fireball = new FireballViewModel(top, left);
            }
            this.gameObjects.Add(fireball);
            this.fireballs.Add(fireball);
        }