Ejemplo n.º 1
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

            menuScene = new JumperMenu(this, spriteBatch);
            this.Components.Add(menuScene);

            //other scenes will be here

            mainScene = new JumperMain(this, spriteBatch, _graphics);
            this.Components.Add(mainScene);

            helpScene = new JumperHelp(this, spriteBatch);
            this.Components.Add(helpScene);

            aboutScene = new JumperAbout(this, spriteBatch);
            this.Components.Add(aboutScene);



            //show only startscene
            menuScene.show();

            //todo: BGM here
            bgm = Content.Load <Song>("Sound/bgm");
            MediaPlayer.IsRepeating = true;
            MediaPlayer.Play(bgm);
        }
Ejemplo n.º 2
0
 public void BackToMenu()
 {
     mainScene.Dispose();
     Components.Remove(mainScene);
     mainScene = new JumperMain(this, spriteBatch, _graphics);
     this.Components.Add(mainScene);
     hideAllScenes();
     menuScene.show();
 }
Ejemplo n.º 3
0
 public CollisionManager(Game game, JumperMain main, JumperMan man, JumperTile tile, Vector2 stage) : base(game)
 {
     this.man   = man;
     this.tile  = tile;
     this.stage = stage;
     this.game  = game;
     this.main  = main;
     jumpEffect = game.Content.Load <SoundEffect>("Sound/jump");
 }
Ejemplo n.º 4
0
 public void ReloadLevel(string levelName, int score)
 {
     hideAllScenes();
     mainScene.hide();
     mainScene.Dispose();
     Components.Remove(mainScene);
     mainScene = new JumperMain(this, spriteBatch, _graphics, levelName, score);
     this.Components.Add(mainScene);
     mainScene.show();
 }