예제 #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)
                    {
                        GameAppDelegate.GoToLevelSelectScene();
                    }
                    else
                    {
                        DestroyLevel();
                        LevelManager.Self.CurrentLevel++;
                        GoToLevel(LevelManager.Self.CurrentLevel);
                    }
                }
                catch (Exception e)
                {
                    int m = 3;
                }
            }
        }
예제 #2
0
        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;
                }
            }
        }
예제 #3
0
        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);
            }
        }
예제 #4
0
 private void HandleBackClicked(object sender, EventArgs args)
 {
     GameAppDelegate.GoToLevelSelectScene();
 }
예제 #5
0
 private void HandlePlayerDeath()
 {
     CCSimpleAudioEngine.SharedEngine.PlayEffect("OwlDeath"); /*Donwloaded from: http://www.wavlist.com/soundfx/012/*/
                                                              //DestroyLevel(); //this doesn't work and it makes the game crash.
     GameAppDelegate.GoToDeathScene();
 }