Esempio n. 1
0
    public void ResumeGame()
    {
        CoreConnector.UIManager.ShowGamePlayUI();
        CoreConnector.GameUIManager.DisplayInGameButtons(true);

        levelTimer.StartTimer();
        touchPosition.ResumeGame();
        gameState      = lastGameState;
        Time.timeScale = 1.0f;
    }
Esempio n. 2
0
    public void StartLevel()
    {
        bool allowStart = true;

        foreach (InventoryItem item in inventoryItems)
        {
            if (item.itemCount != 0)
            {
                allowStart = false;
            }
        }
        if (allowStart)
        {
            Hero hero = GameObject.FindGameObjectWithTag("Hero").GetComponent <Hero>();
            if (hero == null)
            {
                Debug.Log("ERROR: no hero!");
            }
            hero.StartMoving();
            timer.StartTimer();
        }
        else
        {
            DisplayMessage("Place all the items first!");
        }
    }
Esempio n. 3
0
    private IEnumerator SpawnPlayer()
    {
        player.transform.localScale = Vector3.zero;

        while (player.transform.localScale.x < 1f)
        {
            player.transform.Rotate(-Vector3.forward * 360f * Time.deltaTime);
            player.transform.localScale += Vector3.one * 2f * Time.deltaTime;
            yield return(null);
        }

        player.Reset();

        yield return(new WaitForSeconds(0.2f));

        player.Enable();

        timer.ResetTimer();
        timer.StartTimer();

        rotation.canRotate = true;

        foreach (var s in shrinkingTiles)
        {
            s.StartShrinking();
        }
    }
Esempio n. 4
0
    // Call this in a fail state to reset the player.
    // Eventually this needs to involve some sort of timed delay,
    // so the you don't just restart immediately
    public void Died()
    {
        LevelTimer timer = GetComponent <LevelTimer>();

        FindAssets();
        Player.transform.position = getSpawnLocation();

        timer.Reset();
        timer.StartTimer();
    }
Esempio n. 5
0
    /*
     * Desc: Starts the level -- Starts level timer and starts spawning gophers
     */
    public void StartLevel()
    {
        // Set gameplay screen, disable pre-gameplay screen
        screenPreGameplay.SetActive(false);
        screenEnd.SetActive(false);
        screenGamePlay.SetActive(true);

        // Activate gameplay cursor
        gameplayCursor.SetActive(true);

        // WAS PREVIOUSLY IN START()
        InstantiateLevelObjects();
        LoadLevelSettings();
        LevelTimer.TimerFinished += EndLevel;

        _levelTimer.StartTimer();
        StartSpawningGophers();
    }
Esempio n. 6
0
 private void StartLevel()
 {
     StartSpawner();
     levelStarted = true;
     timer.StartTimer();
 }
Esempio n. 7
0
 public void StartNewTimer()
 {
     timer.StartTimer();
 }