Example #1
0
 public StoreScreen(IList<Type> powerupTypesToUse)
 {
     DrawPreviousScreen = false;
     levelManager = new LevelManager();
     for (int i = 0; i < RetroGame.getHeroes().Length; i++)
     {
         if (RetroGame.getHeroes()[i].Alive)
             heroSaveStates[i] = new HeroSaveState(RetroGame.getHeroes()[i]);
     }
     levelManager.heroes = RetroGame.getHeroes();
     Point startingLevel = LevelManager.STARTING_LEVEL;
     levelManager.Initialize(RetroGame.NUM_PLAYERS, false, RetroGame.StoreLevelFragment, startingLevel);
     storeLevel = new StoreLevel(levelManager, RetroGame.StoreLevelFragment, powerupTypesToUse, startingLevel.X, startingLevel.Y);
     levelManager.putPremadeLevelAt(storeLevel, startingLevel.X, startingLevel.Y);
 }
Example #2
0
        public StoreLevel(LevelManager levelManager, LevelFragment storeLevelFragment, IList<Type> powerupTypesToUse, int xPos, int yPos)
            : base(levelManager, storeLevelFragment, xPos, yPos)
        {
            alreadyUsedTypes.Initialize();
            PowerupIcon icon;
            for (int i = 0; i < NUM_RANDOM_POWERUPS; i++)
            {
                int tileX = RANDOM_POWERUPS_TILEX[i];
                int tileY = RANDOM_POWERUPS_TILEY;
                Type powerupType = null;
                if (powerupTypesToUse == null)
                    powerupType = Powerups.RandomPowerupType(except: alreadyUsedTypes.Union(Inventory.AllCurrentlyOwnedPowerupsTypes).ToList());
                else
                    powerupType = powerupTypesToUse[i];
                icon = levelManager.newPowerup(powerupType, tileX, tileY, this);
                icon.DrawDetails = true;
                icon.DetailsAboveIcon = true;
                icon.subtractCostOnCollected = true;
                powerups.Add(icon);
                icons.Add(icon);
                alreadyUsedTypes[i] = icon.powerupType;
            }

            icon = levelManager.newRegeneratingPowerup(typeof(HealthPickup), HEALTH_POSITION.X, HEALTH_POSITION.Y, this);
            icon.DrawDetails = true;
            icon.DetailsAboveIcon = false;
            icon.subtractCostOnCollected = true;
            powerups.Add(icon);
            icons.Add(icon);
            icon = levelManager.newRegeneratingPowerup(typeof(SandPickup), SAND_POSITION.X, SAND_POSITION.Y, this);
            icon.DrawDetails = true;
            icon.DetailsAboveIcon = false;
            icon.subtractCostOnCollected = true;
            powerups.Add(icon);
            icons.Add(icon);
            icon = levelManager.newRegeneratingPowerup(typeof(BombPickup), BOMB_POSITION.X, BOMB_POSITION.Y, this);
            icon.DrawDetails = true;
            icon.DetailsAboveIcon = false;
            icon.subtractCostOnCollected = true;
            powerups.Add(icon);
            icons.Add(icon);
            icon = levelManager.newPowerup(typeof(RevivePickup), REVIVE_POSITION.X, REVIVE_POSITION.Y, this);
            icon.DrawDetails = true;
            icon.DetailsAboveIcon = false;
            icon.subtractCostOnCollected = true;
            powerups.Add(icon);
            icons.Add(icon);
        }
Example #3
0
 public EscapeScreen()
 {
     DrawPreviousScreen = false;
     levelManager = new LevelManager();
 }
Example #4
0
 public Level(LevelManager levelManager, int x, int y, int levelLayout = -1)
 {
     this.levelManager = levelManager;
     if (levelLayout < 0)
     {
         levelLayout = 0;
         double rand = RetroGame.rand.NextDouble();
         double probSum = 0;
         while (rand > (probSum + LEVEL_TYPE_PROBABILITIES[levelLayout]))
         {
             probSum += LEVEL_TYPE_PROBABILITIES[levelLayout];
             levelLayout++;
         }
     }
     createLevel(x, y, levelLayout);
 }
Example #5
0
 public Level(LevelManager levelManager, LevelFragment fullLevelFragment, int x, int y)
 {
     this.levelManager = levelManager;
     levelFull(fullLevelFragment, x, y);
 }