Platformer.Player.GotoLevel C# (CSharp) Method

GotoLevel() public method

public GotoLevel ( int levelIndex ) : void
levelIndex int
return void
        public void GotoLevel(int levelIndex)
        {
            dynamicMap.GotoLevel(levelIndex);
        }

Usage Example

Example #1
0
 // Switch -  the player has to be near and respond to a key press
 public override void ChangeState(Player p, KeyboardState keyState, InputManager inputManager)
 {
     RectangleF other = p.BoundingRectangle;
     Boolean touching = other.Intersects(this.BoundingRectangle);
     if (inputManager.IsNewPress(Keys.E) && touching)
         p.GotoLevel(levelIndex);
 }