Beispiel #1
0
        /// <summary>
        /// Find references. Set initial values.
        /// </summary>
        private void Awake()
        {
            reference             = FindObjectOfType <ReferenceManager>();
            spawner               = reference.spawner;
            gameValues            = reference.gameValues;
            environmentGO         = reference.environmentGO;
            menuTransitionManager = reference.menuTransitionManager;
            source = reference.mainCanvasAudioSource;

            environmentToggle.isOn = gameValues.environmentOn;
            environmentGO.SetActive(gameValues.environmentOn);

            switch (gameValues.difficulty)
            {
            case GameValues.Difficulty.Beginner:
                beginnerButton.GetComponent <UIHover>().Select();
                advancedButton.GetComponent <UIHover>().EndSelect();
                break;

            case GameValues.Difficulty.Advanced:
                beginnerButton.GetComponent <UIHover>().EndSelect();
                advancedButton.GetComponent <UIHover>().Select();
                break;
            }
        }
    private void Awake()
    {
        // Setting up references.
        healthBar = GameObject.Find("HealthBar").GetComponent <HealthBar>();
        timeBar   = GameObject.Find("TimeBar").GetComponent <TimeBar>();

        m_GroundCheck  = transform.Find("GroundCheck");
        m_CeilingCheck = transform.Find("CeilingCheck");
        m_Anim         = GetComponent <Animator>();
        m_Rigidbody2D  = GetComponent <Rigidbody2D>();
        m_Collider     = GetComponent <BoxCollider2D>();
        m_crystals     = 0;



        m_currentHealth = GameValues.getPlayerHealth();
        m_currentTime   = GameValues.getPlayerTime();
        m_weapon        = GameObject.Find("gun");

        m_inventory = new Inventory();
        // ui_Inventory.setInventory(m_inventory);
        playerAudio = GetComponent <AudioSource>();
        healthBar.setMaxHealth(m_maxHealth);
        healthBar.setHealth(m_currentHealth);
        timeBar.setMaxTime(m_maxTime);

        if (GameValues.hasGun)
        {
            Instantiate(m_weapon, this.gameObject.transform.GetChild(3).position, this.gameObject.transform.GetChild(3).rotation).transform.parent = this.gameObject.transform;
            Destroy(m_weapon);
        }
    }
Beispiel #3
0
 private void EndGame(bool showAds)
 {
     if (showAds && gameParam.canUseAdsLife && UnityAds.Instance.GetReadyAds(0))
     {
         waitAdsPanel            = StartCoroutine(WaitAdsPanel());
         gameParam.canUseAdsLife = false;
         return;
     }
     AddLevelsInRank(gameParam.level - 1);
     AddLevelsInGraphic(gameParam.level - 1);
     GameValues.save.totalMoney += gameParam.money;
     GameValues.save.totalGames++;
     if (gameParam.level - 1 == 30)
     {
         GameValues.save.totalWins++;
     }
     GameValues.SaveGame();
     Ranks.Instance.UpdateRankPanels();
     if (GameValues.save.bestScore < gameParam.level - 1)
     {
         GameValues.save.bestScore = gameParam.level - 1;
     }
     if (gameParam.level > 30)
     {
         GameUI.Instance.ShowWinPanel();
         SoundController.Instance.PlayGameWinSound();
     }
     else
     {
         GameUI.Instance.ShowGameOverPanel(gameParam.level - 1);
         SoundController.Instance.PlayGameLoseSound();
     }
     UnityAds.Instance.ShowInterstitial();
 }
        public void UpdateGlobalGameValues(GameValues gameValues)
        {
            List <FieldInfo> typeFields = new List <FieldInfo>();

            EntityUtil.GetTypeFields <int>(GlobalGameData.GameValues, typeFields);

            foreach (FieldInfo f in typeFields)
            {
                string fieldName  = f.Name;
                int    t1         = EntityUtil.GetDeepValue <int>(gameValues, fieldName);
                int    t2         = EntityUtil.GetDeepValue <int>(GlobalGameData.GameValues, fieldName);
                int    fieldValue = EntityUtil.GetDeepValue <int>(GlobalGameData.GameValues, fieldName) + EntityUtil.GetDeepValue <int>(gameValues, fieldName);

                EntityUtil.SetDeepValue(GlobalGameData.GameValues, fieldName, fieldValue);
            }

            //if (null != gameValues.RoleAbility)
            //{
            //    RoleAbility ability = GlobalGameData.GameValues.RoleAbility;
            //    ability.Attack += gameValues.RoleAbility.Attack;
            //    ability.Defence += gameValues.RoleAbility.Defence;
            //    ability.Evasion += gameValues.RoleAbility.Evasion;
            //}
            //if (null != gameValues.RoleStatus)
            //{
            //    RoleStatus status = GlobalGameData.GameValues.RoleStatus;
            //    status.HealthPoint += gameValues.RoleStatus.HealthPoint;
            //    status.ManaPoint += gameValues.RoleStatus.ManaPoint;
            //    status.SkillPoint += gameValues.RoleStatus.SkillPoint;
            //    status.ExperiencePoint += gameValues.RoleStatus.ExperiencePoint;
            //}
            //GlobalGameData.GameValues.ExampleOtherValue += gameValues.ExampleOtherValue;
        }
Beispiel #5
0
        public MovementTests()
        {
            //this piece of code gave me headache. you'll need it in every testclass. // NEVER REMOVE IT //
            if (Application.ResourceAssembly == null)
            {
                Application.ResourceAssembly = typeof(MainWindow).Assembly;
            }

            _gameValues = new GameValues {
                PlayCanvasHeight = 600, PlayCanvasWidth = 784, Movement = 2.5
            };
            _gameValues.Movement        = 2.5;
            _position                   = new Position(_gameValues);
            _position.PlaygroundObjects = new List <IPlaygroundObject> {
                new StaticObject(ObjectType.Player,
                                 new Image
                {
                    Source =
                        new BitmapImage(
                            new Uri("pack://application:,,,/Assets/Sprites/Pacman/pacman-right-halfopenjaw.png"))
                }, 50, 50, 100, 100)
            };

            _player = new MovableObject(ObjectType.Player,
                                        new Image
            {
                Source =
                    new BitmapImage(
                        new Uri("pack://application:,,,/Assets/Sprites/Pacman/pacman-right-halfopenjaw.png"))
            }, 50, 50, 10, 10);
        }
    private void FixedUpdate()
    {
        if (holding_Weapon)
        {
            m_weapon.GetComponent <DisplayController>().toggleVisible();
        }

        //Disables collision if the player is currently sliding
        if (m_Anim.GetCurrentAnimatorStateInfo(0).IsName("Slide"))
        {
            m_Collider.enabled = false;
            //m_Collider.size=new Vector2(1,2);
            //  Debug.Log("Current BoxCollider Size : " + m_Collider.size);
        }
        if (m_Anim.GetCurrentAnimatorStateInfo(0).IsName("Crouch") || m_Anim.GetCurrentAnimatorStateInfo(0).IsName("CrouchingWalk"))
        {
            //m_Collider.enabled=false;
            m_Collider.size = new Vector2(1, 2);
        }
        else
        {
            //m_Collider.size=new Vector2(1,2);
            m_Collider.enabled = true;
        }
        m_Grounded = false;


        // The player is grounded if a circlecast to the groundcheck position hits anything designated as ground
        // This can be done using layers instead but Sample Assets will not overwrite your project settings.
        Collider2D[] colliders = Physics2D.OverlapCircleAll(m_GroundCheck.position, k_GroundedRadius, m_WhatIsGround);
        for (int i = 0; i < colliders.Length; i++)
        {
            if (colliders[i].gameObject != gameObject)
            {
                m_Grounded = true;
            }
        }
        m_Anim.SetBool("Ground", m_Grounded);
        m_Anim.SetBool("HoldingWeapon", holding_Weapon);
        // Set the vertical animation
        m_Anim.SetFloat("vSpeed", m_Rigidbody2D.velocity.y);
        //Hides the weapon if the player is currently sliding or crouching
        if (m_Anim.GetCurrentAnimatorStateInfo(0).IsName("Jumping") || m_Anim.GetCurrentAnimatorStateInfo(0).IsName("Slide") || m_Anim.GetCurrentAnimatorStateInfo(0).IsName("Crouch") || m_Anim.GetCurrentAnimatorStateInfo(0).IsName("CrouchingWalk"))
        {
            foreach (Transform child in transform)
            {
                child.gameObject.SetActive(false);
            }
        }
        else
        {
            foreach (Transform child in transform)
            {
                child.gameObject.SetActive(true);
            }
        }

        GameValues.setPlayerHealth(m_currentHealth);
        GameValues.setPlayerTime(m_currentTime);
    }
Beispiel #7
0
        public void LoadFactory(GameValues gameValues)
        {
            _gameValues = gameValues;

            _imageDictionary.Add(ObjectType.Coin,
                                 new BitmapImage(new Uri("pack://application:,,,/Assets/Sprites/Objects/coin.png")));
            _imageDictionary.Add(ObjectType.EndPoint,
                                 new BitmapImage(new Uri("pack://application:,,,/Assets/Sprites/Objects/end.png")));
            _imageDictionary.Add(ObjectType.Obstacle,
                                 new BitmapImage(new Uri("pack://application:,,,/Assets/Sprites/Objects/obstacle-off.png")));
            _imageDictionary.Add(ObjectType.Path,
                                 new BitmapImage(new Uri("pack://application:,,,/Assets/Sprites/Objects/floor.png")));
            _imageDictionary.Add(ObjectType.SpawnPoint,
                                 new BitmapImage(new Uri("pack://application:,,,/Assets/Sprites/Objects/spawn.png")));
            _imageDictionary.Add(ObjectType.Wall,
                                 new BitmapImage(new Uri("pack://application:,,,/Assets/Sprites/Objects/wall.png")));
            _imageDictionary.Add(ObjectType.StartPoint,
                                 new BitmapImage(new Uri("pack://application:,,,/Assets/Sprites/Objects/floor.png")));

            _demensionDictionary.Add(ObjectType.Coin,
                                     new Size(_gameValues.TileWidth * 0.65, _gameValues.TileHeight * 0.65));
            _demensionDictionary.Add(ObjectType.EndPoint, new Size(_gameValues.TileWidth, _gameValues.TileHeight));
            _demensionDictionary.Add(ObjectType.Obstacle, new Size(_gameValues.TileWidth, _gameValues.TileHeight));
            _demensionDictionary.Add(ObjectType.Path, new Size(_gameValues.TileWidth, _gameValues.TileHeight));
            _demensionDictionary.Add(ObjectType.SpawnPoint, new Size(_gameValues.TileWidth, _gameValues.TileHeight));
            _demensionDictionary.Add(ObjectType.Wall, new Size(_gameValues.TileWidth, _gameValues.TileHeight));
            _demensionDictionary.Add(ObjectType.StartPoint, new Size(_gameValues.TileWidth, _gameValues.TileHeight));

            _coinCorrectionHeightPlacement = _gameValues.TileHeight * 0.17;
            _coinCorrectionWidthPlacement  = _gameValues.TileWidth * 0.17;
        }
Beispiel #8
0
        public CollisionTests()
        {
            if (Application.ResourceAssembly == null)
            {
                Application.ResourceAssembly = typeof(MainWindow).Assembly;
            }

            _gameValues = new GameValues();

            _gameValues.PlayCanvasHeight = 200;
            _gameValues.PlayCanvasWidth  = 200;
            _gameValues.Movement         = 2.5;

            _collisionDetector = new CollisionDetecter(_gameValues);

            _playgroundObjects = new List <IPlaygroundObject>
            {
                new MovableObject(ObjectType.Player, new Image
                {
                    Source =
                        new BitmapImage(
                            new Uri("pack://application:,,,/Assets/Sprites/Pacman/pacman-right-halfopenjaw.png"))
                }, 50, 50, 5, 5),
                new ImmovableObject(ObjectType.Obstacle, new Image
                {
                    Source =
                        new BitmapImage(
                            new Uri("pack://application:,,,/Assets/Sprites/Pacman/pacman-right-halfopenjaw.png"))
                }, 50, 50, 150, 5, true),
                new ImmovableObject(ObjectType.Coin, new Image
                {
                    Source =
                        new BitmapImage(
                            new Uri("pack://application:,,,/Assets/Sprites/Pacman/pacman-right-halfopenjaw.png"))
                }, 50, 50, 5, 105, true),
                new MovableObject(ObjectType.Enemy, new Image
                {
                    Source =
                        new BitmapImage(
                            new Uri("pack://application:,,,/Assets/Sprites/Pacman/pacman-right-halfopenjaw.png"))
                }, 50, 50, 150, 125),
                new StaticObject(ObjectType.EndPoint, new Image
                {
                    Source =
                        new BitmapImage(
                            new Uri("pack://application:,,,/Assets/Sprites/Pacman/pacman-right-halfopenjaw.png"))
                }, 50, 50, 5, 200),
                new StaticObject(ObjectType.Wall, new Image
                {
                    Source =
                        new BitmapImage(
                            new Uri("pack://application:,,,/Assets/Sprites/Pacman/pacman-right-halfopenjaw.png"))
                }, 50, 50, 150, 200)
            };

            //extract player and enemy
            _player = (MovableObject)_playgroundObjects.First(x => x.ObjectType == ObjectType.Player);
            _enemy  = (MovableObject)_playgroundObjects.First(x => x.ObjectType == ObjectType.Enemy);
        }
        public GameViewController(MainWindow mainWindow, string selectedGame)
            : base(mainWindow)
        {
            _refreshTimer = new Timer {
                Interval = 1000 / 60
            };
            _pacmanAnimationTimer = new Timer {
                Interval = 150
            };
            _obstacleTimer = new Timer {
                Interval = 3000
            };
            _spawnTimer = new Timer {
                Interval = 2500
            };
            _clock             = new Clock();
            _score             = new Score();
            _gameView          = new GameView();
            _gameValues        = new GameValues();
            _playgroundFactory = new PlaygroundFactory();
            _playerFactory     = new PlayerFactory();
            _enemyFactory      = new EnemyFactory();
            _pacmanAnimation   = new PacmanAnimation();
            _enemyAnimation    = new EnemyAnimation();
            _obstacleAnimation = new ObstacleAnimation();
            _step     = new Step();
            _position = new Position(_gameValues);
            _random   = new Random();
            _sound    = new Sound();

            SetContentOfMain(mainWindow, _gameView);

            _selectedGame = selectedGame;
            _gameState    = GameState.Playing;

            SetKeyDownEvents(_gameView.GameCanvas, OnButtonKeyDown);
            SetKeyUpEvents(_gameView.GameCanvas, OnButtonKeyUp);
            _gameView.GameCanvas.Loaded   += OnGameCanvasLoaded;
            MainWindow.Closing            += OnMainWindowClosing;
            _refreshTimer.Elapsed         += RefreshGameCanvas;
            _pacmanAnimationTimer.Elapsed += OnPacmanAnimationTimerElapsed;
            _obstacleTimer.Elapsed        += OnObstacleTimerElapsed;
            _spawnTimer.Elapsed           += OnspawnTimerElapsed;
            _clock.PlaytimeIsOver         += OnPlaytimeIsOver;
            _clock.PlaytimeIsOver         += _sound.OnPlaytimeIsOver;

            _position.CollisionDetecter.CoinCollision     += OnCoinCollision;
            _position.CollisionDetecter.CoinCollision     += _sound.OnCoinCollision;
            _position.CollisionDetecter.EndpointCollision += OnEndpointCollision;
            _position.CollisionDetecter.EndpointCollision += _sound.OnEndpointCollision;
            _position.CollisionDetecter.EnemyCollision    += OnOnEnemyCollision;
            _position.CollisionDetecter.EnemyCollision    += _sound.OnOnEnemyCollision;
            _position.CollisionDetecter.ObstacleCollision += OnObstacleCollision;
            _position.CollisionDetecter.ObstacleCollision += _sound.OnObstacleCollision;

            _pacmanAnimation.LoadPacmanImages();
            _enemyAnimation.LoadPacmanImages();
            _obstacleAnimation.LoadObstacleImages();
        }
Beispiel #10
0
 private void OnEnable()
 {
     isGameState = true;
     gameValues  = GameValues.Instance;
     EventManager.PauseStateEvent += EventManager_PauseEvent;
     //PauseGameState.Subscribe(this, this.gameObject);
     _dropCoroutine = StartCoroutine(SpawnDrop(gameValues.dropPeriod));
 }
Beispiel #11
0
 private void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
     }
     DontDestroyOnLoad(this);
 }
Beispiel #12
0
 // Start is called before the first frame update
 public void StartUpgrades()
 {
     gamedata             = cont.gamedata;
     dps_upgrade_basecost = 7;
     dps_upgrade_multcost = 1.25;
     dps_basedmg          = 3;
     UpdateUpgradePanelUI();
 }
 // Start is called before the first frame update
 void Start()
 {
     //Load all files into scrolling view
     TeamValues.ResetAllValues();
     GameValues.ResetAllValues();
     Time.timeScale = 1;
     Populate();
 }
Beispiel #14
0
 private void Awake()
 {
     tube       = GameObject.Find("Tube");
     gameValues = GameObject.Find("GameValues").GetComponent <GameValues>();
     objectPool = gameValues.ObjectPool;
     objectPool.SetTube(this.tube);
     objectPool.CreateObjects();
 }
 public void Start()
 {
     // playfab = new PlayFabManager();
     gamedata       = new GameValues();
     ab             = new Abbreviations();
     timertext.text = timer.ToString("0");
     timericon.gameObject.SetActive(false);
     upgrades.StartUpgrades();
 }
Beispiel #16
0
        public void LoadFactory(GameValues gameValues)
        {
            _gameValues = gameValues;

            _playersFirstFace           = new BitmapImage(new Uri("pack://application:,,,/Assets/Sprites/Pacman/pacman-right-halfopenjaw.png"));
            _playerWidth                = _gameValues.TileWidth * 0.93;
            _playerHeight               = _gameValues.TileHeight * 0.93;
            _playerStartPointCorrection = 1.003;
        }
Beispiel #17
0
        public void LoadFactory(GameValues gameValues)
        {
            _gameValues = gameValues;

            _enemysFirstFace           = new BitmapImage(new Uri("pack://application:,,,/Assets/Sprites/Enemy/blinky-right.png"));
            _enemyWidth                = _gameValues.TileWidth * 0.93;
            _enemyHeight               = _gameValues.TileHeight * 0.93;
            _enemyStartPointCorrection = 1.003;
        }
    //Function for killing the player, plays the death animation and then waits 2 seconds before reloading the scene
    IEnumerator die()
    {
        m_Anim.SetBool("death", true);
        yield return(new WaitForSeconds(2));

        //Reloads the scene on deathd
        GameValues.setPlayerHealth(100);
        SceneManager.LoadScene("Room 01", LoadSceneMode.Single);
        GameValues.respawns += 1;
    }
Beispiel #19
0
 void Awake()
 {
     gameValues = GameObject.Find("GameValues").GetComponent <GameValues>();
     objectPool = gameValues.ObjectPool;
     bird       = GameObject.Find("Bird");
     if (this.gameObject.name != "Tube")
     {
         this.gameObject.SetActive(false);
     }
 }
Beispiel #20
0
    // Loads scene with values for given level
    public void LoadLVL(int lvl)
    {
        GameValues.SetValuesForLvl(lvl);

        if (lvl == 1)
        {
            GameValues.restarted = true;
        }

        SceneManager.LoadScene(SceneManager.GetActiveScene().name);
    }
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
Beispiel #22
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Beispiel #23
0
        public static void DisplayBoard(GameBoard gameBoard)
        {
            DisplayScore(gameBoard.RemainingCells);
            DisplayColumns(gameBoard.BoardColumns);

            for (int i = 0; i < gameBoard.BoardRows; i++)
            {
                char label = (char)(i + 65);
                Console.WriteLine();
                Console.Write($"{label}");
                Console.Write("|");

                StringBuilder cellOutput = new StringBuilder("");

                for (int j = 0; j < gameBoard.BoardColumns; j++)
                {
                    cellOutput.Clear();

                    if (gameBoard.Board[i, j].Revealed)
                    {
                        GameValues cellValue = gameBoard.Board[i, j].CellValue;


                        switch (cellValue)
                        {
                        case GameValues.Empty:
                            cellOutput.Append("   ");
                            break;

                        case GameValues.Mine:
                            cellOutput.Append(" M ");
                            break;

                        default:
                            cellOutput.Append($" {(int)cellValue} ");
                            break;
                        }
                        Console.Write(cellOutput);
                    }
                    else
                    {
                        Console.Write(" - ");
                    }
                }
                Console.Write("|");
            }
            Console.WriteLine();
            Console.Write("  ");
            for (int i = 0; i < gameBoard.BoardColumns; i++)
            {
                Console.Write("---");
            }
        }
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(this);
     }
     else
     {
         Destroy(this);
     }
     maxScore = PlayerPrefs.GetInt("maxScore", 0);
 }
Beispiel #25
0
 // Start is called before the first frame update
 void Awake()
 {
     //If there already exists a value item destroy it
     if (values == null)
     {
         DontDestroyOnLoad(gameObject);
         loadHighScore();
         values = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Beispiel #26
0
        private int _stepsInDirection; // necessary for smooth movement of enemy

        public Position(GameValues gameValues)
        {
            _gameValues       = gameValues;
            CollisionDetecter = new CollisionDetecter(_gameValues);
            _random           = new Random();
            _enemyMoves       = new List <Move>
            {
                Move.Left,
                Move.Right,
                Move.Down,
                Move.Up
            };
            _lastMove         = new Move();
            _stepsInDirection = 0;
        }
Beispiel #27
0
        public ScoreTests()
        {
            if (Application.ResourceAssembly == null)
            {
                Application.ResourceAssembly = typeof(MainWindow).Assembly;
            }

            _gameValues = new GameValues();
            _gameValues.PlayCanvasHeight = 600;
            _gameValues.PlayCanvasWidth  = 784;
            _gameValues.HeigthWidthRatio = _gameValues.PlayCanvasHeight / _gameValues.PlayCanvasWidth;
            _gameValues.AmountOfXtiles   = 20;
            _gameValues.AmountofYtiles   = Math.Round(_gameValues.AmountOfXtiles * _gameValues.HeigthWidthRatio);
            _gameValues.TileWidth        = _gameValues.PlayCanvasWidth / _gameValues.AmountOfXtiles;
            _gameValues.TileHeight       = _gameValues.PlayCanvasHeight / _gameValues.AmountofYtiles;
            _gameValues.Movement         = 2.5;

            _collisionDetecter = new CollisionDetecter(_gameValues);

            _playgroundObjects = new List <IPlaygroundObject>
            {
                new ImmovableObject(ObjectType.Coin, new Image
                {
                    Source =
                        new BitmapImage(
                            new Uri("pack://application:,,,/Assets/Sprites/Pacman/pacman-right-halfopenjaw.png"))
                }, 100, 100, 50, 5, true)
            };

            _player = new MovableObject(ObjectType.Player,
                                        new Image
            {
                Source =
                    new BitmapImage(
                        new Uri("pack://application:,,,/Assets/Sprites/Pacman/pacman-right-halfopenjaw.png"))
            }, 50, 50, 10, 10);

            _enemy = new MovableObject(ObjectType.Enemy,
                                       new Image
            {
                Source =
                    new BitmapImage(
                        new Uri("pack://application:,,,/Assets/Sprites/Pacman/pacman-right-halfopenjaw.png"))
            }, 50, 50, 10, 10);
        }
    void SettingGame(GameData data)
    {
        TimeManager.Date = data.Date;
        gameValues       = data.gameValues;
        UpdateValues();
        EventManager.Instance.EventList = data.events;

        var field = FieldManager.Instance.FieldBlocks;

        if (field.Count != data.fieldBlocks.Count)
        {
            Debug.LogWarning("Data doesn't match the actual field!");
        }

        for (int i = 0; i < field.Count; i++)
        {
            field[i].Status = data.fieldBlocks[i];
        }
    }
 public void UpdateGlobalGameValues(GameValues gameValues)
 {
     if (null != gameValues.RoleAbility)
     {
         RoleAbility ability = GlobalGameData.GameValues.RoleAbility;
         ability.Attack  += gameValues.RoleAbility.Attack;
         ability.Defence += gameValues.RoleAbility.Defence;
         ability.Evasion += gameValues.RoleAbility.Evasion;
     }
     if (null != gameValues.RoleStatus)
     {
         RoleStatus status = GlobalGameData.GameValues.RoleStatus;
         status.HealthPoint     += gameValues.RoleStatus.HealthPoint;
         status.ManaPoint       += gameValues.RoleStatus.ManaPoint;
         status.SkillPoint      += gameValues.RoleStatus.SkillPoint;
         status.ExperiencePoint += gameValues.RoleStatus.ExperiencePoint;
     }
     GlobalGameData.GameValues.ExampleOtherValue += gameValues.ExampleOtherValue;
 }
Beispiel #30
0
    private void DataWasLoaded(GameValues data, SaveResult result, string message)
    {
        logText += "\nData Was Loaded";
        logText += "\nresult: " + result + ", message: " + message;

        if (result == SaveResult.EmptyData || result == SaveResult.Error)
        {
            logText   += "\nNo Data File Found -> Creating new data...";
            gameValues = new GameValues();
        }

        if (result == SaveResult.Success)
        {
            gameValues = data;
        }
        randomText  = gameValues.randomText;
        showVideo   = gameValues.showVideo;
        musicVolume = gameValues.musicVolume;
        totalCoins  = gameValues.totalCoins;
    }