/// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            LineBatch.init(GraphicsDevice);

            levelManager = new RC_GameStateManager();

            levelManager.AddLevel(0, new SplashScreen());
            levelManager.getLevel(0).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);
            levelManager.getLevel(0).LoadContent();
            levelManager.setLevel(0);

            levelManager.AddLevel(1, new GameLevel1());
            levelManager.getLevel(1).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);
            levelManager.getLevel(1).LoadContent();

            levelManager.AddLevel(2, new EndScreen());
            levelManager.getLevel(2).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);
            levelManager.getLevel(2).LoadContent();

            levelManager.AddLevel(3, new Pause());
            levelManager.getLevel(3).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);
            levelManager.getLevel(3).LoadContent();

            levelManager.AddLevel(4, new StartScreen());
            levelManager.getLevel(4).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);
            levelManager.getLevel(4).LoadContent();
        }
Пример #2
0
 public LevelManager(List <Player> players, RC_GameStateManager manager)
 {
     this.players          = players;
     this.deadPlayers      = new List <Player>();
     this.gameActive       = true;
     this.gameStateManager = manager;
 }
Пример #3
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            LineBatch.init(GraphicsDevice);

            // TODO: use this.Content to load your game content here
            levelManager = new RC_GameStateManager();
            levelManager.AddLevel(0, new TutorialLevel());
            levelManager.getLevel(0).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);
            levelManager.getLevel(0).LoadContent();


            levelManager.AddLevel(1, new Level1());
            levelManager.getLevel(1).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);
            levelManager.getLevel(1).LoadContent();


            levelManager.AddLevel(2, new Level2());
            levelManager.getLevel(2).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);
            levelManager.getLevel(2).LoadContent();

            levelManager.AddLevel(3, new Level3());
            levelManager.getLevel(3).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);
            levelManager.getLevel(3).LoadContent();

            levelManager.AddLevel(4, new Level4());
            levelManager.getLevel(4).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);
            levelManager.getLevel(4).LoadContent();

            levelManager.AddLevel(5, new Level5());
            levelManager.getLevel(5).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);
            levelManager.getLevel(5).LoadContent();

            levelManager.AddLevel(6, new MenuScreen());
            levelManager.getLevel(6).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);
            levelManager.getLevel(6).LoadContent();

            levelManager.setLevel(6);

            Player.soundDash       = Content.Load <SoundEffect>("sounds/Dash");
            Player.soundJump       = Content.Load <SoundEffect>("sounds/Jump");
            Player.soundDoubleJump = Content.Load <SoundEffect>("sounds/DoubleJump");

            BaseLevel.soundDeath    = Content.Load <SoundEffect>("sounds/Death");
            BaseLevel.soundSlice    = Content.Load <SoundEffect>("sounds/Slice");
            BaseLevel.soundRespawn  = Content.Load <SoundEffect>("sounds/Respawn");
            BaseLevel.soundSliceHit = Content.Load <SoundEffect>("sounds/SliceHit");
            Player.soundGroundHit   = Content.Load <SoundEffect>("sounds/GroundHit");
        }
Пример #4
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            LineBatch.init(GraphicsDevice);

            levelManager = new RC_GameStateManager();

            levelManager.AddLevel(0, new SplashScreen());
            levelManager.getLevel(0).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager, this);
            levelManager.getLevel(0).LoadContent();
            levelManager.setLevel(0);

            levelManager.AddLevel(1, new MainMenu());
            levelManager.getLevel(1).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager, this);
            levelManager.getLevel(1).LoadContent();

            levelManager.AddLevel(2, new PauseMenu());
            levelManager.getLevel(2).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager, this);
            levelManager.getLevel(2).LoadContent();

            levelManager.AddLevel(3, new WinState());
            levelManager.getLevel(3).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager, this);
            levelManager.getLevel(3).LoadContent();


            //Load content for levels only when called
            levelManager.AddLevel(4, new Level0());
            levelManager.getLevel(4).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager, this);

            levelManager.AddLevel(5, new Instructions());
            levelManager.getLevel(5).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager, this);
            levelManager.getLevel(5).LoadContent();

            levelManager.AddLevel(6, new Level1());
            levelManager.getLevel(6).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager, this);

            levelManager.AddLevel(7, new Level3());
            levelManager.getLevel(7).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager, this);

            levelManager.AddLevel(8, new FinalGame.Levels.Achievement());
            levelManager.getLevel(8).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager, this);
            levelManager.getLevel(8).LoadContent();
        }
Пример #5
0
        public static void handleLevelHotKeys(RC_GameStateManager gameStateManager)
        {
            // Handle Help Button
            if (PlayerInput.KeyOldPressed(Keys.F1))
            {
                gameStateManager.pushLevel(8);
            }

            // Handle Pausing
            if (PlayerInput.KeyPressed(Keys.P))
            {
                gameStateManager.pushLevel(7);
            }

            // Enable Level Cheat
            if (PlayerInput.KeyPressed(Keys.C))
            {
                Resources.cheatingFlag = !Resources.cheatingFlag;
            }
        }
Пример #6
0
        public static void handleLevelUpdate(GameTime gameTime, RC_GameStateManager gameStateManager, EnemySpawner enemySpawner, PickupSpawner pickupSpawner, PlayerGUI playerGUI, int scoreReq, int nxtLvl)
        {
            // Check our win conditions
            if (Resources.score > scoreReq)
            {
                gameStateManager.setLevel(nxtLvl);
            }

            Levels.handleLevelHotKeys(gameStateManager);

            // Update our Sprite Manager
            Game1.spriteManager.Update();

            // Update our Particle manager
            Game1.particleManager.Update(gameTime);

            // Update our Enemy Spawner
            enemySpawner.Update(Game1.spriteManager.count);

            // Update our Pickup Spawner
            pickupSpawner.Update(Game1.spriteManager.count);
        }
Пример #7
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch      = new SpriteBatch(GraphicsDevice);
            gameStateManager = new RC_GameStateManager();

            // TODO: use this.Content to load your game content here
            LineBatch.init(GraphicsDevice);
            Dir.dir = Util.findDirWithFile(@"Art\Sea04.png");

            gameStateManager = new RC_GameStateManager();

            gameStateManager.AddLevel(0, new GameLevel_0_Default());
            gameStateManager.getLevel(0).InitializeLevel(GraphicsDevice, spriteBatch, Content, gameStateManager);
            gameStateManager.getLevel(0).LoadContent();

            gameStateManager.AddLevel(1, new GameLevel_1());
            gameStateManager.getLevel(1).InitializeLevel(GraphicsDevice, spriteBatch, Content, gameStateManager);
            gameStateManager.getLevel(1).LoadContent();

            gameStateManager.AddLevel(2, new GameLevel_2());
            gameStateManager.getLevel(2).InitializeLevel(GraphicsDevice, spriteBatch, Content, gameStateManager);
            gameStateManager.getLevel(2).LoadContent();

            gameStateManager.AddLevel(3, new GameLevel_Pause());
            gameStateManager.getLevel(3).InitializeLevel(GraphicsDevice, spriteBatch, Content, gameStateManager);
            gameStateManager.getLevel(3).LoadContent();

            gameStateManager.AddLevel(4, new GameLevel_End());
            gameStateManager.getLevel(4).InitializeLevel(GraphicsDevice, spriteBatch, Content, gameStateManager);
            gameStateManager.getLevel(4).LoadContent();

            gameStateManager.AddLevel(5, new GameLevel_Instructions());
            gameStateManager.getLevel(5).InitializeLevel(GraphicsDevice, spriteBatch, Content, gameStateManager);
            gameStateManager.getLevel(5).LoadContent();

            gameStateManager.setLevel(2);
        }
Пример #8
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here

            LineBatch.init(GraphicsDevice);

            levelManager = new RC_GameStateManager();

            levelManager.AddLevel(0, new GameLevel_0());
            levelManager.getLevel(0).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);
            levelManager.getLevel(0).LoadContent();
            levelManager.setLevel(0);

            levelManager.AddLevel(1, new GameLevel_1());
            levelManager.getLevel(1).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);
            levelManager.getLevel(1).LoadContent();

            levelManager.AddLevel(2, new GameLevel_2());
            levelManager.getLevel(2).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);
            levelManager.getLevel(2).LoadContent();

            levelManager.AddLevel(3, new GameLevel_3_Pause());
            levelManager.getLevel(3).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);
            levelManager.getLevel(3).LoadContent();

            levelManager.AddLevel(4, new GameLevel_4());
            levelManager.getLevel(4).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);
            levelManager.getLevel(4).LoadContent();

            levelManager.AddLevel(5, new GameLevel_5());
            levelManager.getLevel(5).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);
            levelManager.getLevel(5).LoadContent();
        }
Пример #9
0
 public override void InitializeLevel(GraphicsDevice g, SpriteBatch s, ContentManager c, RC_GameStateManager lm)
 {
     playerGUI = new PlayerGUI("KILL HEXAGON GUY");
     //ticksRemaining = ticksToWait;
     base.InitializeLevel(g, s, c, lm);
 }
Пример #10
0
 public override void InitializeLevel(GraphicsDevice g, SpriteBatch s, ContentManager c, RC_GameStateManager lm)
 {
     scoreRequired = Resources.levelFourNeeded;
     playerGUI     = new PlayerGUI("" + scoreRequired);
     //ticksRemaining = ticksToWait;
     base.InitializeLevel(g, s, c, lm);
 }
Пример #11
0
        public override void InitializeLevel(GraphicsDevice g, SpriteBatch s, ContentManager c, RC_GameStateManager lm)
        {
            scoreRequired = Resources.levelOneNeeded;
            playerGUI     = new PlayerGUI("" + scoreRequired);
            // Add our player
            //Game1.spriteManager.addSpriteActor(new Player(Resources.Player, Game1.screenSize / 2, Vector2.Zero));

            base.InitializeLevel(g, s, c, lm);
        }
Пример #12
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // Setup basics
            Resources.LoadContent(Content);
            SoundManager.LoadContent(Content);
            LineBatch.init(GraphicsDevice);
            HighScoreManager.Initialize();
            SaveGameManager.Initialize();
            // Setup our media palyer
            MediaPlayer.IsRepeating = true;
            MediaPlayer.Play(SoundManager.getSong());
            MediaPlayer.Volume = Resources.volume;

            levelManager = new RC_GameStateManager();

            // Add our player that we will keep throughout the entire run of this game
            Game1.spriteManager.addSpriteActor(new Player(Resources.Player, Game1.screenSize / 2, Vector2.Zero));

            // heaps of levels is most likely in-efficient use of state management, better to combine large amounts of these levels
            // and then have minor nested state management, e.g. combining levels 1-4 and menu/options, etc. However, due to the scale
            // of this game and time limits, I believe the below code suffices.

            levelManager.AddLevel(0, new LevelOne());
            levelManager.getLevel(0).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);

            levelManager.AddLevel(1, new LevelTwo());
            levelManager.getLevel(1).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);

            levelManager.AddLevel(2, new LevelThree());
            levelManager.getLevel(2).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);

            levelManager.AddLevel(3, new LevelSplash());
            levelManager.getLevel(3).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);

            levelManager.AddLevel(4, new LevelMenu());
            levelManager.getLevel(4).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);

            levelManager.AddLevel(5, new LevelOptions());
            levelManager.getLevel(5).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);

            levelManager.AddLevel(6, new LevelLoad());
            levelManager.getLevel(6).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);

            // Preferrable to load in pause content now
            levelManager.AddLevel(7, new LevelPause());
            levelManager.getLevel(7).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);
            levelManager.getLevel(7).LoadContent();

            // Preferrable to load in how to play content now (works on push/pop stack same as pause)
            levelManager.AddLevel(8, new LevelHowToPlay());
            levelManager.getLevel(8).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);
            levelManager.getLevel(8).LoadContent();

            levelManager.AddLevel(9, new LevelGameOver());
            levelManager.getLevel(9).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);

            levelManager.AddLevel(10, new LevelFour());
            levelManager.getLevel(10).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);

            levelManager.AddLevel(11, new LevelFiveBoss());
            levelManager.getLevel(11).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);

            levelManager.AddLevel(12, new LevelWin());
            levelManager.getLevel(12).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);

            levelManager.AddLevel(13, new LevelHighScores());
            levelManager.getLevel(13).InitializeLevel(GraphicsDevice, spriteBatch, Content, levelManager);

            levelManager.setLevel(3);
        }
Пример #13
0
 public override void InitializeLevel(GraphicsDevice g, SpriteBatch s, ContentManager c, RC_GameStateManager lm)
 {
     base.InitializeLevel(g, s, c, lm);
 }