コード例 #1
0
ファイル: Player.cs プロジェクト: Group4-CSE/Zelda
        public void UseBomb(GameManager game)
        {
            if (inventory.Contains("Bomb"))
            {
                state.PlaceItem();

                sound1.BombD(0);
                state.spawnBomb(game, sound1);
                Bombs = Bombs - 1;
                if (Bombs <= 0)
                {
                    inventory.Remove("Bomb");
                    selectedItem = "";
                }
            }
        }
コード例 #2
0
        public void Update(GameManager game)
        {
            Move();
            //TEMP collision stuff

            countdown++;
            if (countdown > fuse)
            {
                sound.BombD(1);
                //Boom
                game.AddPlayerProjectile(new ExplosionPlayerProjectile(texture, new Vector2((float)X, (float)Y)));
                game.AddPlayerProjectile(new ExplosionPlayerProjectile(texture, new Vector2((float)X + explosionInc, (float)Y + explosionInc)));
                game.AddPlayerProjectile(new ExplosionPlayerProjectile(texture, new Vector2((float)X, (float)Y + explosionInc)));
                game.AddPlayerProjectile(new ExplosionPlayerProjectile(texture, new Vector2((float)X - explosionInc, (float)Y + explosionInc)));
                game.AddPlayerProjectile(new ExplosionPlayerProjectile(texture, new Vector2((float)X - explosionInc, (float)Y)));
                game.AddPlayerProjectile(new ExplosionPlayerProjectile(texture, new Vector2((float)X - explosionInc, (float)Y - explosionInc)));
                game.AddPlayerProjectile(new ExplosionPlayerProjectile(texture, new Vector2((float)X, (float)Y - explosionInc)));
                game.AddPlayerProjectile(new ExplosionPlayerProjectile(texture, new Vector2((float)X + explosionInc, (float)Y - explosionInc)));
                game.AddPlayerProjectile(new ExplosionPlayerProjectile(texture, new Vector2((float)X + explosionInc, (float)Y)));

                delete(game);
            }
        }
コード例 #3
0
 public void doDamage(IEnemy target, Sounds sounds)
 {
     sounds.BombD(1);
     //Visual projectile only
 }