void PerformPlayerVsDoorCollision() { if (door != null && door.IsOpen && player.Intersects(door)) { CCSimpleAudioEngine.SharedEngine.PlayEffect("EnteringDoor"); try { bool isLastLevel = (LevelManager.Self.CurrentLevel + 1 == LevelManager.Self.NumberOfLevels); if (isLastLevel) { GameAppDelegate.GoToLevelSelectScene(); } else { DestroyLevel(); LevelManager.Self.CurrentLevel++; GoToLevel(LevelManager.Self.CurrentLevel); } } catch (Exception e) { int m = 3; } } }
void PerformPlayerVsLvlExitCollision() //this code is re { if (exit != null && exit.IsOpen && player.Intersects(exit)) { CCSimpleAudioEngine.SharedEngine.PlayEffect("lvlExit"); //Sound Effect Donfloaded from: https://opengameart.org/content/completion-sound try { bool isLastLevel = (LevelManager.Self.CurrentLevel + 1 == LevelManager.Self.NumberOfLevels); if (isLastLevel) { GameAppDelegate.GoToLevelSelectScene(); } else { DestroyLevel(); LevelManager.Self.CurrentLevel++; GoToLevel(LevelManager.Self.CurrentLevel); } } catch (Exception e) { int m = 3; } } }
private void ApplyInput(float seconds) { if (controller != null && controller.IsConnected) { controller.UpdateInputValues(); player.ApplyInput(controller.HorizontalRatio, controller.JumpPressed); if (controller.BackPressed) { GameAppDelegate.GoToLevelSelectScene(); } } else { touchScreen.UpdateInputValues(); player.ApplyInput(touchScreen.HorizontalRatio, touchScreen.WasJumpPressed); } }
private void HandleBackClicked(object sender, EventArgs args) { GameAppDelegate.GoToLevelSelectScene(); }