public void EnemyRemoved(object enemy, bool death)
        {
            if (EnemyCount > 0)
            {
                EnemyCount--;
            }
            if (Game.Player == null)
            {
                return;
            }

            if (death)
            {
                int powerupDropChance = 3;

                // Increase Score
                if (enemy is Ship)
                {
                    Game.Player.IncreaseScore(((Ship)enemy).AmountOfInfantry == 0 ? POINTS_SHIP_EMPTY : POINTS_SHIP);
                    powerupDropChance = 2;
                }
                else if (enemy is Infantryman)
                {
                    Game.Player.IncreaseScore(POINTS_INFANTRYMAN);
                    powerupDropChance = 20;
                }
                else if (enemy is Rowboat)
                {
                    Game.Player.IncreaseScore(((Rowboat)enemy).AmountOfInfantry == 0 ? POINTS_ROWBOAT_EMPTY : POINTS_ROWBOAT);
                    powerupDropChance = 3;
                }

                // Powerup drops
                if (Utils.RandomInt(1, powerupDropChance) == 1)
                {
                    PowerupPickup powerup = new PowerupPickup(Game, Utils.RandomInt(1, Powerup.MAX));
                    powerup.Position = ((DisplayObject)enemy).Position;
                    Game.Layer_Objects.AddChild(powerup);
                }
            }

            // Wave Finished
            if (EnemyCount == 0 && !SpawningOverTime)
            {
                Game.Player.StopPowerups();

                Game.UpgradeMenu = new UpgradeMenu(Game);
                Game.Layer_GUI.AddChild(Game.UpgradeMenu);
                Game.UpgradeMenu.Removed += OnUpgradeMenuClosed;
            }
        }
        public void EnemyRemoved(object enemy, bool death)
        {
            if (EnemyCount > 0)
                EnemyCount--;
            if (Game.Player == null)
                return;

            if (death)
            {
                int powerupDropChance = 3;

                // Increase Score
                if (enemy is Ship)
                {
                    Game.Player.IncreaseScore(((Ship)enemy).AmountOfInfantry == 0 ? POINTS_SHIP_EMPTY : POINTS_SHIP);
                    powerupDropChance = 2;
                }
                else if (enemy is Infantryman)
                {
                    Game.Player.IncreaseScore(POINTS_INFANTRYMAN);
                    powerupDropChance = 20;
                }
                else if (enemy is Rowboat)
                {
                    Game.Player.IncreaseScore(((Rowboat)enemy).AmountOfInfantry == 0 ? POINTS_ROWBOAT_EMPTY : POINTS_ROWBOAT);
                    powerupDropChance = 3;
                }

                // Powerup drops
                if (Utils.RandomInt(1, powerupDropChance) == 1)
                {
                    PowerupPickup powerup = new PowerupPickup(Game, Utils.RandomInt(1, Powerup.MAX));
                    powerup.Position = ((DisplayObject)enemy).Position;
                    Game.Layer_Objects.AddChild(powerup);
                }
            }

            // Wave Finished
            if (EnemyCount == 0 && !SpawningOverTime)
            {
                Game.Player.StopPowerups();

                Game.UpgradeMenu = new UpgradeMenu(Game);
                Game.Layer_GUI.AddChild(Game.UpgradeMenu);
                Game.UpgradeMenu.Removed += OnUpgradeMenuClosed;
            }
        }
        public PowerupGUI(HeadsUpDisplay hud, int type, double time, uint graphicsMode)
        {
            HUD  = hud;
            Type = type;

            Shape       = PowerupPickup.GetModel(type, graphicsMode, 160, 180);
            Shape.Scale = new Vector2f(1.5f, 1.5f);
            AddChild(Shape);

            Time       = new Text("0.0", Game.TidyHand, 24);
            Time.Color = new Color(15, 15, 15, 220);
            FloatRect textRect = Time.GetLocalBounds();

            Time.Origin = new Vector2f(textRect.Left + (textRect.Width / 2.0f), textRect.Top + (textRect.Height / 2.0f));
            AddChild(Time);

            UpdateTimer          = new Timer(100);
            UpdateTimer.Elapsed += OnUpdate;

            Update(time);
            UpdateTimer.Start();
        }
 public PowerupPickup(Game game, int type) : base(game, null)
 {
     Type  = type;
     Model = PowerupPickup.GetModel(type, Game.GraphicsMode);
     AddChild(Model);
 }