Exemple #1
0
        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 = "";
                }
            }
        }
        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);
            }
        }
 public void doDamage(IEnemy target, Sounds sounds)
 {
     sounds.BombD(1);
     //Visual projectile only
 }