Beispiel #1
0
    private void LoadNextLevel()
    {
        levelParser.LoadLevel(getLevelString(level));
        ResetPlayer();


        TryPlayingNextIntroAudio();
    }
Beispiel #2
0
 /// <summary>
 /// Manages all things
 /// </summary>
 /// <param name="graphicsDevice">Used to draw</param>
 /// <param name="content">Used to load content</param>
 public GameStateManager(GraphicsDevice graphicsDevice, ContentManager content)
 {
     this.LayerManager = new LayerManager(graphicsDevice, content);
     this.Camera       = new CameraManager(graphicsDevice, 300, 1);
     this.Content      = content;
     this.LayerManager = LevelParser.LoadLevel("test", graphicsDevice, content);
     //Centers the camera around the player
     Camera.MoveTo(new Point(-LayerManager.Player.Position.X, -LayerManager.Player.Position.Y));
 }
        private static LevelInfo GetLevelInfo(int id)
        {
            if (cachedLevelsInfo.ContainsKey(id))
            {
                return(cachedLevelsInfo[id]);
            }
            var levelInfo = LevelParser.LoadLevel(levelList[id], tileSets);

            cachedLevelsInfo.Add(id, levelInfo);
            return(levelInfo);
        }
    //Initialization of parameters.
    private static int[,] Init(int index)
    {
        int[,] lvl = LevelParser.LoadLevel(index);
        VectorBias = TilesResources.tileObjects[(TilesType)1].GetComponent <BoxCollider2D>().size;
        Vector2 screenEdge = Camera.main.ScreenToWorldPoint(new Vector2(Screen.width, Screen.height));

        InitialPosition   = new Vector2();
        InitialPosition.x = -screenEdge.x + ((screenEdge.x * 2) - (VectorBias.x * lvl.GetLength(1))) / 2f + VectorBias.x / 2f;
        InitialPosition.y = -screenEdge.y + screenEdge.y * 0.45f;

        return(lvl);
    }