~saurabhs/bomberman

bb554d1fd09c0a2d0a6602572c677605bc6e0f77 — Saurabh S 4 years ago ae1dc88
Added proper gameover message for Singleplayer
2 files changed, 3 insertions(+), 1 deletions(-)

M Assets/Scripts/Common/Constants.cs
M Assets/Scripts/Player/PlayerController.cs
M Assets/Scripts/Common/Constants.cs => Assets/Scripts/Common/Constants.cs +1 -0
@@ 126,6 126,7 @@ namespace Bomberman
        public static string GAME_DRAW = "DRAW!!!";
        public static string GAME_YANG = "YANG WINS!!!";
        public static string GAME_YING = "YING WINS!!!";
        public static string GAME_OVER = "GAME OVER!!!";    //for single player

        public static int MAX_DETONATION_DELAY = 10;


M Assets/Scripts/Player/PlayerController.cs => Assets/Scripts/Player/PlayerController.cs +2 -1
@@ 127,7 127,8 @@ namespace Bomberman
        {
            if ( trigger.gameObject.layer == Constants.LAYER_ENEMY )
            {
                PlayerPrefs.SetString( Constants.GAME_RESULT, (gameObject.name.Split( '_' )[1].ToLower().Equals( "yang" ) ? Constants.GAME_YING : Constants.GAME_YANG) );
                var isSinglePlayer = PlayerPrefs.GetInt( Constants.GAME_TYPE ) == Constants.SINGLEPLAYER_ID;
                PlayerPrefs.SetString( Constants.GAME_RESULT, isSinglePlayer ? Constants.GAME_OVER : (gameObject.name.Split( '_' )[1].ToLower().Equals( "yang" ) ? Constants.GAME_YING : Constants.GAME_YANG) );
                UnityEngine.SceneManagement.SceneManager.LoadScene( "gameover" );
            }
            else if ( trigger.gameObject.layer == Constants.LAYER_POWERUP )