示例#1
0
        public void PowerupMenuPowerLevelRowSet(Powerup powerup, int level)
        {
            var type = powerup.GetType();

            if (type == GameRowPowerupType)
            {
                PowerupRow.PowerLevel = level;
            }
        }
示例#2
0
        public static bool StorePowerup(Powerup powerup)
        {
            int initialRow = 0;
            int maxRow = 0;
            if (powerup.Active)
            {
                initialRow = RetroGame.MAX_PLAYERS;
                maxRow = RetroGame.MAX_PLAYERS + STORAGE_ACTIVE_ROWS;
            }
            else
            {
                initialRow = RetroGame.MAX_PLAYERS + STORAGE_ACTIVE_ROWS;
                maxRow = RetroGame.MAX_PLAYERS + STORAGE_ACTIVE_ROWS + STORAGE_PASSIVE_ROWS;
            }

            Point firstOpenSpace = new Point(-1, -1);
            for (int i = initialRow; i < maxRow; i++)
                for (int j = 0; j < storageGrid[i].Length; j++)
                {
                    if (!storageGrid[i][j].HasPowerup && firstOpenSpace.X < 0)
                    {
                        firstOpenSpace = new Point(i, j);
                    }
                    if (storageGrid[i][j].HasPowerup && storageGrid[i][j].Powerup.GetType() == powerup.GetType())
                        return false;
                }
            storageGrid[firstOpenSpace.X][firstOpenSpace.Y].SetPowerup(powerup);
            allCurrentlyOwnedPowerupTypes = null; //recalculate list
            flashAcquiredPowerup(storageGrid[firstOpenSpace.X][firstOpenSpace.Y]);
            return true;
        }