Пример #1
0
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            HandleTouch();
        }
        else if (Input.GetMouseButtonDown(1))
        {
            HandleAlternativeTouch();
        }

        if (Input.GetKeyDown(KeyCode.V))
        {
            board.ShowPaths = !board.ShowPaths;
        }
        if (Input.GetKeyDown(KeyCode.G))
        {
            board.ShowGrid = !board.ShowGrid;
        }

        spawnProgress += spawnSpeed * Time.deltaTime;
        while (spawnProgress >= 1f)
        {
            spawnProgress -= 1f;
            SpawnEnemy();
        }
        enemies.GameUpdate();
        Physics.SyncTransforms();
        board.GameUpdate();
    }
Пример #2
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.A))
        {
            HandleTouch();
        }
        else if (Input.GetKeyDown(KeyCode.B))
        {
            HandleAlternativeTouch();
        }

        if (Input.GetKeyDown(KeyCode.V))
        {
            board.ShowPaths = !board.ShowPaths;
        }

        if (Input.GetKeyDown(KeyCode.G))
        {
            board.ShowGrid = !board.ShowGrid;
        }

        if (Input.GetKeyDown(KeyCode.E))
        {
            spawnProgress += spawnSpeed * Time.deltaTime;
            spawnProgress -= 1f;
            SpawnEnemy();
        }

        enemies.GameUpdate();
    }
Пример #3
0
    private void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            HandleTouch();
        }
        else if (Input.GetMouseButtonDown(1))
        {
            HandleAlternativeTouch();
        }

        if (Input.GetKeyDown(KeyCode.V))
        {
            gameBoard.ShowPaths = !gameBoard.ShowPaths;
        }

        if (Input.GetKeyDown(KeyCode.G))
        {
            gameBoard.ShowGrid = !gameBoard.ShowGrid;
        }


        enemyCollection.GameUpdate();

        spawnProgress += spawnSpeed * Time.deltaTime;
        if (spawnProgress >= 1f)
        {
            spawnProgress -= 1f;
            SpawnEnemy();
        }
    }
Пример #4
0
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            HandleTouch();
        }
        else if (Input.GetMouseButtonDown(1))
        {
            HandleAlternativeTouch();
        }

        if (Input.GetKeyDown(KeyCode.G))
        {
            board.ShowGrid = !board.ShowGrid;
        }

        enemies.GameUpdate();

        ++activeSlowUpdateUnit;
        if (activeSlowUpdateUnit > Common.enemySlowUpdateRate)
        {
            activeSlowUpdateUnit = 0;
            enemies.GameSlowUpdate();
        }
    }
Пример #5
0
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            HandleTouch();
        }
        else if (Input.GetMouseButtonDown(1))
        {
            HandleAlternativeTouch();
        }

        if (Input.GetKeyDown(KeyCode.V))
        {
            board.ShowPaths = !board.ShowPaths;
        }
        if (Input.GetKeyDown(KeyCode.G))
        {
            board.ShowGrid = !board.ShowGrid;
        }

        // spawn enemies
        if (client.Emojis.Count > 0)
        {
            spawnProgress += spawnSpeed * Time.deltaTime;
        }
        while (spawnProgress >= 1f && client.Emojis.Count > 0)
        {
            spawnProgress -= 1f;
            SpawnEnemy(client.Emojis.Dequeue());
        }

        // update enemies
        enemies.GameUpdate();
    }
Пример #6
0
    private void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            HandleTouch();
        }
        else if (Input.GetMouseButtonDown(1))
        {
            HandleAlternativeTouch();
        }

        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            selectedTowerType = TowerType.Laser;
        }
        else if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            selectedTowerType = TowerType.Mortar;
        }

        // Spawn idea - an object should exist that constitutes a 'timeline'
        // as spawn progress increases, we check to see where we are on the timeline now vs before
        // anything in that time range should then be spawned
        // Spawn progress thing would hold references to enemyData
        spawnProgress += spawnSpeed * Time.deltaTime;
        while (spawnProgress >= 1)
        {
            spawnProgress -= 1f;
            if (enemySpawnCounter < 3)
            {
                SpawnEnemy(enemyData);
                enemySpawnCounter++;
            }
            else
            {
                SpawnEnemy(fastEnemyData);
                enemySpawnCounter = 0;
            }
        }
        enemies.GameUpdate();
        Physics.SyncTransforms();
        board.GameUpdate();
    }