예제 #1
0
        /// <summary>
        /// A helper method that lets the game re-load its data/levels.
        /// </summary>
        private void LoadState()
        {
            //Levels state machine
            switch (levelState)
            {
            case LevelState.Start:
                level0.LoadContent(_content);
                break;

            case LevelState.Zero:
                level1.LoadContent(_content);
                break;

            case LevelState.One:
                level1.LoadContent(_content);
                break;

            case LevelState.Two:
                level2.LoadContent(_content);
                break;

            case LevelState.EndW:
                break;

            case LevelState.EndL:
                break;
            }

            //song1 = _content.Load<Song>("sawsquarenoise - Stage 1");
            //MediaPlayer.IsRepeating = true;
            //MediaPlayer.Volume = 0.25f;
            //MediaPlayer.Play(song1);

            levelComplete  = _content.Load <SoundEffect>("LevelComplete");
            lose           = _content.Load <SoundEffect>("GameOver");
            levelTransport = _content.Load <SoundEffect>("LevelTransport");

            bangers = _content.Load <SpriteFont>("Bangers");

            Thread.Sleep(500);
            ScreenManager.Game.ResetElapsedTime();
        }
예제 #2
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);

            levelOne.LoadContent(Content);
            levelTwo.LoadContent(Content);
            levelThree.LoadContent(Content);
            levelFour.LoadContent(Content);
            levelFive.LoadContent(Content);
            levelSix.LoadContent(Content);
            levelSeven.LoadContent(Content);
            levelEight.LoadContent(Content);
            levelNine.LoadContent(Content);
            levelTen.LoadContent(Content);
            levelEle.LoadContent(Content);
            levelTwe.LoadContent(Content);
            levelTteen.LoadContent(Content);
            levelFourteen.LoadContent(Content);
            levelFifteen.LoadContent(Content);
            levelSixteen.LoadContent(Content);
            levelSeventeen.LoadContent(Content);

            transitionBackground = Content.Load <Texture2D>("transition");
            theOne.Sprite        = Content.Load <Texture2D>("theOne");

            walkingRight   = true;
            theOneTexRight = Content.Load <Texture2D>("SarahWalkRight3");
            theOneSprRight = new AnimatedSprite(theOneTexRight, 1, 4);


            theOneTexLeft = Content.Load <Texture2D>("SarahWalkLeft");
            theOneSprLeft = new AnimatedSprite(theOneTexLeft, 1, 4);

            startPos    = new Vector2(50, LEVEL_HEIGHT - theOneTexRight.Height);
            theOne.posY = (int)startPos.Y;
            theOne.posX = (int)startPos.X;
        }