Professional Documents
Culture Documents
Apresentação AEDI Projeto
Apresentação AEDI Projeto
AEDI 2022
Ovídio Farias e Bruno Sampietro
Objetivo
de vidas
Interface
Metodologia
Pesquisa bibliográfica:
Documentação da C#
Documentação da Engine
Pesquisa adicional (dúvidas)
Recursos
utilizados
Unity Engine
Visual Studio Code
Google (Imagens)
Codificação
public class GameController : MonoBehaviour
{
public GameObject heart1, heart2, heart3, gameOver;
public static Stack<int> health = new Stack<int>();
// Start is called before the first frame update
void Start()
{
health.Push(1);
health.Push(2);
health.Push(3);
heart1.gameObject.SetActive (true);
heart2.gameObject.SetActive (true);
heart3.gameObject.SetActive (true);
gameOver.gameObject.SetActive (false);
}
// Update is called once per frame
void Update() else
{ {
if(health.Count == 3) heart1.gameObject.SetActive (false);
{ heart2.gameObject.SetActive (false);
heart1.gameObject.SetActive (true); heart3.gameObject.SetActive (false);
heart2.gameObject.SetActive (true); gameOver.gameObject.SetActive
} SceneManager.LoadScene(SceneManager.G
else if(GameController.health.Count == 2) }
{
GameController.health.Push(3);
}
}
}
Referências
https://www.youtube.com/watch?v=ZoZcBgRR9ns&t=250s
https://www.youtube.com/watch?v=3uyolYVsiWc&t=279s
https://www.youtube.com/watch?v=LsUiJItfzxU&t=6s