Conversion MobsIA en KinematicBody2D

This commit is contained in:
Amaury 2020-04-21 15:42:31 +02:00
parent bf1e311adb
commit 90426616d7
3 changed files with 4 additions and 3 deletions

View File

@ -59,8 +59,9 @@ void GestionJeu::create_scene()
add_child(gPlayer); add_child(gPlayer);
add_child(gTerrain); add_child(gTerrain);
gMobs->AjoutMobC2C(10, 20, 5, 0, 1, 25); gMobs->AjoutMobC2C(10, 20, 5, 0, 1, 25);
for (MobsIA* m : gMobs->mobs) for (KinematicBody2D* m : gMobs->mobs)
{ {
auto mob = (MobsCorpACorpIA*) m;
Godot::print("Add child mob"); Godot::print("Add child mob");
add_child(m); add_child(m);
} }

View File

@ -4,7 +4,7 @@
void GestionMobs::AjoutMobC2C(int pvMax, int speed, int degat, int cooldown, int rangeDegat, int rangeAgro) void GestionMobs::AjoutMobC2C(int pvMax, int speed, int degat, int cooldown, int rangeDegat, int rangeAgro)
{ {
MobsCorpACorpIA* fireElement = (MobsCorpACorpIA*) MobsCorpACorpIA::_new(); MobsCorpACorpIA* fireElement = MobsCorpACorpIA::_new();
mobs.push_back(fireElement); mobs.push_back(fireElement);
} }

View File

@ -7,7 +7,7 @@
class GestionMobs class GestionMobs
{ {
public : public :
std::vector<MobsIA*> mobs; std::vector<KinematicBody2D*> mobs;
public: public:
void AjoutMobC2C(int pvMax, int speed, int degat, int cooldown, int rangeDegat, int rangeAgro); void AjoutMobC2C(int pvMax, int speed, int degat, int cooldown, int rangeDegat, int rangeAgro);