예제 #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);
        }
예제 #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);
 }
예제 #3
0
        public CSVWriter(String p, String fn, Vector4 max, List <IBlock> bs, List <IItem> its, List <IEnemy> es, List <IPipe> ps, List <IPlayer> plys)
        {
            path     = p;
            filename = fn;
            extremes = max;
            blocks   = bs;
            items    = its;
            enemies  = es;
            pipes    = ps;
            players  = plys;

            typeDict = new Dictionary <Type, String>();
            LevelUtility.InitializeTypeDict(typeDict);
        }