GotoLevel() public method

public GotoLevel ( int levelIndex ) : void
levelIndex int
return void
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);
 }