예제 #1
0
        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)
                    {
                        GameDelegate.GoToLevelSelectScene();
                    }
                    else
                    {
                        DestroyLevel();
                        LevelManager.Self.CurrentLevel++;
                        GoToLevel(LevelManager.Self.CurrentLevel);
                    }
                }
                catch (Exception e)
                {
                    int m = 3;
                }
            }
        }
예제 #2
0
        private void ApplyInput(float seconds)
        {
            if (controller != null && controller.IsConnected)
            {
                controller.UpdateInputValues();
                player.ApplyInput(controller.HorizontalRatio, controller.JumpPressed);

                if (controller.BackPressed)
                {
                    GameDelegate.GoToLevelSelectScene();
                }
            }
            else
            {
                touchScreen.UpdateInputValues();
                player.ApplyInput(touchScreen.HorizontalRatio, touchScreen.WasJumpPressed);
            }
        }
예제 #3
0
 private void HandleBackClicked(object sender, EventArgs args)
 {
     GameDelegate.GoToLevelSelectScene();
 }