コード例 #1
0
    public void setNewBlocksSpawnTime()
    {
        int spawnTime = 0;

        if (_blocksSpawnIndex == 0)
        {
            spawnTime          = (int)((gameLogicController._blockHeight + bigGap) / gameLogicController.blocksSpeed);
            _spawnTimeInterval = blocksSpeedController.speedTimeInterval / 3;
        }

        if (_blocksSpawnIndex == 1)
        {
            spawnTime          = (int)((gameLogicController._blockHeight + mediumGap) / gameLogicController.blocksSpeed);
            _spawnTimeInterval = blocksSpeedController.speedTimeInterval / 5;
        }

        if (_blocksSpawnIndex == 2)
        {
            spawnTime          = (int)((gameLogicController._blockHeight + smallGap) / gameLogicController.blocksSpeed);
            _spawnTimeInterval = blocksSpeedController.speedTimeInterval / 7;
        }
        gameLogicController.setBlocksSpawnTime(spawnTime);
    }
コード例 #2
0
    public void setNewBalance()
    {
        List1Data currentStageData = _gameBalaceData.dataArray[_currentStageIndex];

        gameLogicController.setBlocksSpeed(currentStageData.Speed);

                #if UNITY_IOS
        gameLogicController.setBlocksSpeed(currentStageData.Speed * 2);
                #endif

        int spawnTime = (int)((gameLogicController._blockHeight + currentStageData.Distancebetweeneblocks) / gameLogicController.blocksSpeed);
        gameLogicController.setBlocksSpawnTime(spawnTime);
        gameLogicController.blockTasksCount = currentStageData.Taskcount;
        gameLogicController.blockType       = currentStageData.Blocktype;

        gameLogicController.randomTasksCount = true;
        if (currentStageData.Randomtaskcount == 0)
        {
            gameLogicController.randomTasksCount = false;
        }

        _currentStageTimeInterval = (int)(currentStageData.Timeinterval * 60);
    }