/// <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 void actionEnd()
 {
     this.setGameStatus(false);
     WinState.wonPlayer   = winningPlayer;
     WinState.leaderBoard = deadPlayers;
     gameStateManager.getLevel(4).UnloadContent();
     this.gameStateManager.setLevel(3);
 }
Пример #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);

            // 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);
        }
Пример #4
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");
        }
Пример #5
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);
        }
Пример #6
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();
        }
Пример #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);

            // 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();
        }