diff --git a/DungeonAndDeamonScript/DungeonAndDemaonScript/GestionJeu.cpp b/DungeonAndDeamonScript/DungeonAndDemaonScript/GestionJeu.cpp
index d8905f1..83d77eb 100644
--- a/DungeonAndDeamonScript/DungeonAndDemaonScript/GestionJeu.cpp
+++ b/DungeonAndDeamonScript/DungeonAndDemaonScript/GestionJeu.cpp
@@ -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;
}
-
+/**
+ * Associe les méthodes GODOT aux méthodes de la classe
+ */
void GestionJeu::_register_methods()
{
register_method((char*)"_init", &GestionJeu::_init);
@@ -34,23 +40,33 @@ void GestionJeu::_register_methods()
register_method((char*)"_process", &GestionJeu::_process);
}
+/**
+* Methode éxécutée lors de l'initialison de la classe (par godot)
+*/
void GestionJeu::_init()
{
- Godot::print("Initialisation...");
+ //Godot::print("Initialisation...");
create_scene();
- Godot::print("Initialisation OK !");
+ //Godot::print("Initialisation OK !");
}
+/**
+* Methode éxécutée suivant l'initialison de la classe
+*/
void GestionJeu::_ready()
{
- Godot::print("Ready...");
+ //Godot::print("Ready...");
setup_scene();
- Godot::print("Ready OK !");
+ //Godot::print("Ready OK !");
}
+/**
+* Methode éxécutée en boucle par Godot
+*/
void GestionJeu::_process()
{
+ // Check des collisions
gCollision->CheckCollisonSol();
@@ -61,6 +77,9 @@ void GestionJeu::_process()
}
}
+/**
+* Méthdode appelé lors de l'initilisation
+*/
void GestionJeu::create_scene()
{
add_child(gPlayer);
@@ -77,6 +96,9 @@ void GestionJeu::create_scene()
}
+/**
+*
+*/
void GestionJeu::setup_scene()
{
gPlayer->setPosition(15, 150);