Ejemplo n.º 1
0
    void LoadLevel(int playerX, int playerY, int enemyX, int enemyY, List <int> enemyInstructions)
    {
        playerMechanics.gameObject.transform.position = arenaCells[playerY, playerX].transform.position;
        this.arenaCellData[playerY, playerX]          = 2;
        playerMechanics.GetMonsterStats().SetPosition(playerX, playerY);
        playerMechanics.GetMonsterStats().Health = PlayerPrefs.GetInt("player_health");

        enemyMechanics.gameObject.transform.position = arenaCells[enemyY, enemyX].transform.position;
        enemyMechanics.GetMonsterStats().SetPosition(enemyX, enemyY);
        this.arenaCellData[enemyY, enemyX] = 3;
        enemyMechanics.GetMonsterStats().Health = levels.GetLevel(currentLevel).GetHeartsForPhase()[currentPhase];

        this.gameUI.SetPlayerHealth(PlayerPrefs.GetInt("player_health"));
        this.gameUI.SetEnemyHealth(enemyMechanics.GetMonsterStats().Health);

        this.gameUI.SetEnemyInstructions(enemyInstructions);

        this.GetComponent <Gameplay>().InitGame();
    }
Ejemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (GameManagement.InGame)
        {
            if (!GameManagement.InInstructions)
            {
//				string arena = "";
//				for (int i = 0; i < 6; i++)
//				{
//					for (int j = 0; j < 6; j++)
//					{
//						arena += this.arenaCellData[i, j] + " ";
//					}
//					arena += "\n";
//				}
//				Debug.Log(arena);
                if (this.IsCoolDownOver() && !performInstructions)
                {
                    GameManagement.InInstructions = true;
                }

                if (performInstructions)
                {
                    PlayGame();
                }
            }
            else
            {
                if (!gm.IsNextPhaseReady())
                {
                    if (!this.gameSetUp)
                    {
                        if (!playerMechanics.GetMonsterStats().IsDead())
                        {
                            gm.ShowInstructionUI();
                        }
                    }
                }
            }
        }
    }
Ejemplo n.º 3
0
 public void MovePlayerLeft()
 {
     playerDirection = -1;
     if (InBounds(playerStats.GetMonsterStats().GetXPosition() - 1, playerStats.GetMonsterStats().GetYPosition()) &&
         this.arenaCellData[playerStats.GetMonsterStats().GetYPosition(), playerStats.GetMonsterStats().GetXPosition() - 1] == 0)
     {
         LerpPlayerTo(playerStats.GetMonsterStats().GetXPosition() - 1, playerStats.GetMonsterStats().GetYPosition());
     }
 }