Debut mouvement Mob

This commit is contained in:
Estrela Allan p1923381
2020-04-30 18:05:19 +02:00
parent 97f45944db
commit 6c12f02787
4 changed files with 83 additions and 14 deletions

View File

@ -52,6 +52,13 @@ void GestionJeu::_ready()
void GestionJeu::_process()
{
gCollision->CheckCollisonSol();
Vector2 posPlayer = gPlayer->get_position();
for (MobsCorpACorpIA* m : gMobs->mobs)
{
m->UpdateTargetPosition(posPlayer);
}
}
void GestionJeu::create_scene()
@ -60,11 +67,12 @@ void GestionJeu::create_scene()
add_child(gTerrain);
gMobs->AjoutMobC2C(10, 20, 5, 0, 1, 25);
for (KinematicBody2D* m : gMobs->mobs)
for (MobsCorpACorpIA* m : gMobs->mobs)
{
auto mob = (MobsCorpACorpIA*) m;
Godot::print("Add child mob");
add_child(m);
m->setPosition(15, 150);
}
}
@ -72,6 +80,7 @@ void GestionJeu::create_scene()
void GestionJeu::setup_scene()
{
gPlayer->setPosition(15, 150);
gTerrain->GenerationCarte();
}