public void Execute()
        {
            if (myGame.hud.lives == 0 || Keyboard.GetState().IsKeyDown(Keys.R))
            {
                myGame.begin       = true;
                myGame.normal      = false;
                myGame.infinite    = false;
                myGame.sound.state = Utility.soundStates.reset;
            }
            else if (myGame.normal)
            {
                Level.LoadLists(myGame);
                myGame.enemyList = Level.enemyList;
                myGame.blockList = Level.blockList;
                myGame.itemList  = Level.itemList;
                myGame.bgList    = Level.bgList;
                myGame.camObj.LoadLevel();
                myGame.sound.state = Utility.soundStates.reset;
            }

            myGame.marioState.facingLeft = false;
            myGame.marioState.jump       = false;
            myGame.marioState.crouch     = false;
            myGame.marioState.move       = false;
            myGame.marioState.lvlComp    = false;
            myGame.marioState.XCoor      = 48;
            myGame.marioState.YCoor      = 432;

            myGame.camera.reset();
            myGame.marioState.offset = 0;

            myGame.hud.reset();

            myGame.gameover = false;

            myGame.mario = new SmallMario(myGame);

            Level.LoadLists(myGame);
            InfiniteLevelLoader.InfiniteLevelLoad(myGame);

            myGame.sound.state = Utility.soundStates.reset;
        }
Beispiel #2
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            Font1 = Content.Load <SpriteFont>("Courier New");

            FontPos = new Vector2(graphics.GraphicsDevice.Viewport.Width / 2,
                                  graphics.GraphicsDevice.Viewport.Height / 2);

            itemSprite      = Content.Load <Texture2D>("SpriteSheets/Items");
            fireBeamSprite  = Content.Load <Texture2D>("SpriteSheets/fireBeam");
            blockSprite     = Content.Load <Texture2D>("SpriteSheets/Tileset");
            blueBlockSprite = Content.Load <Texture2D>("blueBricks");

            oneCloudBgElement      = Content.Load <Texture2D>("1CloudBgElement");
            threeCloudsBgElement   = Content.Load <Texture2D>("3CloudsBgElement");
            oneBushBgElement       = Content.Load <Texture2D>("1BushElement");
            threeBushesBgElement   = Content.Load <Texture2D>("3BushesBgElement");
            smallMountainBgElement = Content.Load <Texture2D>("SmallMountainBgElement");
            bigMountainBgElement   = Content.Load <Texture2D>("BigMountainBgElement");
            startScreen            = Content.Load <Texture2D>("startScreen");

            smallCastle = Content.Load <Texture2D>("smallCastle");
            flagpole    = Content.Load <Texture2D>("flagPole");

            goomba = Content.Load <Texture2D>("goomba");
            koopa  = Content.Load <Texture2D>("koopa");

            titleScreen    = Content.Load <Texture2D>("titleScreen");
            marioSprites   = Content.Load <Texture2D>("SpriteSheets/Mario");
            fireballSprite = Content.Load <Texture2D>("fireball");

            piranhaPlant  = Content.Load <Texture2D>("SpriteSheets/enemies");
            marioBatRight = Content.Load <Texture2D>("batRight");
            marioBatLeft  = Content.Load <Texture2D>("batLeft");

            mario = new SmallMario(this);

            Level.LoadLists(this);
            InfiniteLevelLoader.InfiniteLevelLoad(this);
        }