Ejemplo n.º 1
0
        public static LevelUtility.SpriteSet SwitchLevel(LevelUtility.SpriteSet spriteSet, int setNum, String currentFilename)
        {
            MarioState temp = spriteSet.players[0].GetState();

            if (setNum == 0)
            {
                firstSet        = new LevelUtility.SpriteSet(0);
                onePositionDict = new Dictionary <string, List <Vector2> >();
                LevelUtility.InitializePositionKey(onePositionDict);
            }
            else
            {
                secondSet       = new LevelUtility.SpriteSet(1);
                twoPositionDict = new Dictionary <string, List <Vector2> >();
                LevelUtility.InitializePositionKey(twoPositionDict);
            }

            if (filenames[setNum] == currentFilename)
            {
                marioStartLocation.Y -= AdjustMarioStart(temp);
                camera = new CameraController(game, new Vector2(marioStartLocation.X - 20, 0), screenHeight, screenWidth);
            }

            spriteSet = LoadLevel(currentFilename, new Vector2(marioStartLocation.X - 20, 0), setNum, spriteSet);
            ResumeLastState(temp, spriteSet);

            filenames[setNum] = currentFilename;
            return(spriteSet);
        }
Ejemplo n.º 2
0
 public static void ResetLevel()
 {
     onePositionDict = new Dictionary <string, List <Vector2> >();
     twoPositionDict = new Dictionary <string, List <Vector2> >();
     LevelUtility.InitializePositionKey(onePositionDict);
     LevelUtility.InitializePositionKey(twoPositionDict);
     firstSet  = new LevelUtility.SpriteSet(0);
     secondSet = new LevelUtility.SpriteSet(1);
 }