Un peu de commentaires

This commit is contained in:
Amaury 2020-05-03 15:27:38 +02:00
parent 23b1312706
commit fd81b857fd

View File

@ -14,6 +14,7 @@ using namespace godot;
GestionJeu::GestionJeu()
{
//Instanciation des principales classes des gestion des elmts du jeu
gPlayer = GestionPlayer::_new();
gTerrain = GestionTerrain::_new();
@ -23,10 +24,15 @@ GestionJeu::GestionJeu()
GestionJeu::~GestionJeu()
{
delete gTerrain;
delete gPlayer;
delete gMobs;
delete gCollision;
}
/**
* <summary>Associe les méthodes GODOT aux méthodes de la classe</summary>
*/
void GestionJeu::_register_methods()
{
register_method((char*)"_init", &GestionJeu::_init);
@ -34,23 +40,33 @@ void GestionJeu::_register_methods()
register_method((char*)"_process", &GestionJeu::_process);
}
/**
* <summary>Methode éxécutée lors de l'initialison de la classe (par godot)</summary>
*/
void GestionJeu::_init()
{
Godot::print("Initialisation...");
//Godot::print("Initialisation...");
create_scene();
Godot::print("Initialisation OK !");
//Godot::print("Initialisation OK !");
}
/**
* <summary>Methode éxécutée suivant l'initialison de la classe</summary>
*/
void GestionJeu::_ready()
{
Godot::print("Ready...");
//Godot::print("Ready...");
setup_scene();
Godot::print("Ready OK !");
//Godot::print("Ready OK !");
}
/**
* <summary>Methode éxécutée en boucle par Godot</summary>
*/
void GestionJeu::_process()
{
// Check des collisions
gCollision->CheckCollisonSol();
@ -61,6 +77,9 @@ void GestionJeu::_process()
}
}
/**
* <summary>Méthdode appelé lors de l'initilisation</summary>
*/
void GestionJeu::create_scene()
{
add_child(gPlayer);
@ -77,6 +96,9 @@ void GestionJeu::create_scene()
}
/**
* <summary></summary>
*/
void GestionJeu::setup_scene()
{
gPlayer->setPosition(15, 150);