mirror of
https://forge.univ-lyon1.fr/tplifap4/dungeonanddeamon.git
synced 2024-02-27 13:31:50 +01:00
Un peu de commentaires
This commit is contained in:
parent
23b1312706
commit
fd81b857fd
@ -14,6 +14,7 @@ using namespace godot;
|
|||||||
|
|
||||||
GestionJeu::GestionJeu()
|
GestionJeu::GestionJeu()
|
||||||
{
|
{
|
||||||
|
//Instanciation des principales classes des gestion des elmts du jeu
|
||||||
gPlayer = GestionPlayer::_new();
|
gPlayer = GestionPlayer::_new();
|
||||||
gTerrain = GestionTerrain::_new();
|
gTerrain = GestionTerrain::_new();
|
||||||
|
|
||||||
@ -23,10 +24,15 @@ GestionJeu::GestionJeu()
|
|||||||
|
|
||||||
GestionJeu::~GestionJeu()
|
GestionJeu::~GestionJeu()
|
||||||
{
|
{
|
||||||
|
delete gTerrain;
|
||||||
delete gPlayer;
|
delete gPlayer;
|
||||||
|
delete gMobs;
|
||||||
|
delete gCollision;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <summary>Associe les méthodes GODOT aux méthodes de la classe</summary>
|
||||||
|
*/
|
||||||
void GestionJeu::_register_methods()
|
void GestionJeu::_register_methods()
|
||||||
{
|
{
|
||||||
register_method((char*)"_init", &GestionJeu::_init);
|
register_method((char*)"_init", &GestionJeu::_init);
|
||||||
@ -34,23 +40,33 @@ void GestionJeu::_register_methods()
|
|||||||
register_method((char*)"_process", &GestionJeu::_process);
|
register_method((char*)"_process", &GestionJeu::_process);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <summary>Methode éxécutée lors de l'initialison de la classe (par godot)</summary>
|
||||||
|
*/
|
||||||
void GestionJeu::_init()
|
void GestionJeu::_init()
|
||||||
{
|
{
|
||||||
Godot::print("Initialisation...");
|
//Godot::print("Initialisation...");
|
||||||
create_scene();
|
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()
|
void GestionJeu::_ready()
|
||||||
{
|
{
|
||||||
Godot::print("Ready...");
|
//Godot::print("Ready...");
|
||||||
setup_scene();
|
setup_scene();
|
||||||
Godot::print("Ready OK !");
|
//Godot::print("Ready OK !");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <summary>Methode éxécutée en boucle par Godot</summary>
|
||||||
|
*/
|
||||||
void GestionJeu::_process()
|
void GestionJeu::_process()
|
||||||
{
|
{
|
||||||
|
// Check des collisions
|
||||||
gCollision->CheckCollisonSol();
|
gCollision->CheckCollisonSol();
|
||||||
|
|
||||||
|
|
||||||
@ -61,6 +77,9 @@ void GestionJeu::_process()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <summary>Méthdode appelé lors de l'initilisation</summary>
|
||||||
|
*/
|
||||||
void GestionJeu::create_scene()
|
void GestionJeu::create_scene()
|
||||||
{
|
{
|
||||||
add_child(gPlayer);
|
add_child(gPlayer);
|
||||||
@ -77,6 +96,9 @@ void GestionJeu::create_scene()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <summary></summary>
|
||||||
|
*/
|
||||||
void GestionJeu::setup_scene()
|
void GestionJeu::setup_scene()
|
||||||
{
|
{
|
||||||
gPlayer->setPosition(15, 150);
|
gPlayer->setPosition(15, 150);
|
||||||
|
Loading…
Reference in New Issue
Block a user