mirror of
https://forge.univ-lyon1.fr/tplifap4/dungeonanddeamon.git
synced 2024-02-27 13:31:50 +01:00
mouvement mobs complété
This commit is contained in:
@ -33,7 +33,7 @@ public:
|
||||
Player p;
|
||||
|
||||
public:
|
||||
void traitementInput();
|
||||
void traitementInput(float dt);
|
||||
|
||||
void setPosition(int x, int y);
|
||||
|
||||
@ -45,9 +45,10 @@ private:
|
||||
void idle();
|
||||
void attack();
|
||||
public:
|
||||
const int speed = 100;
|
||||
const int gravity = 90;
|
||||
const int power_jump = -250;
|
||||
const float speed = 100.f;
|
||||
const float GamePlayMultiplicator = 100.0f;
|
||||
const float gravity = 9.8f * GamePlayMultiplicator;
|
||||
const float power_jump = -5.0f * GamePlayMultiplicator;
|
||||
bool on_ground = false;
|
||||
bool on_roof = false;
|
||||
bool on_left_wall = false;
|
||||
|
@ -20,6 +20,7 @@ MobsCorpACorpIA::MobsCorpACorpIA()
|
||||
void MobsCorpACorpIA::_register_methods()
|
||||
{
|
||||
Godot::print("register Mobs...");
|
||||
register_method("_physics_process", &MobsCorpACorpIA::_physics_process);
|
||||
register_method("_process", &MobsCorpACorpIA::_process);
|
||||
register_method("_init", &MobsCorpACorpIA::_init);
|
||||
register_method("_ready", &MobsCorpACorpIA::_ready);
|
||||
@ -27,9 +28,14 @@ void MobsCorpACorpIA::_register_methods()
|
||||
|
||||
}
|
||||
|
||||
void MobsCorpACorpIA::_physics_process(float delta)
|
||||
{
|
||||
mouvement();
|
||||
m.velocity = move_and_slide(m.velocity);
|
||||
}
|
||||
|
||||
void MobsCorpACorpIA::_process(float delta)
|
||||
{
|
||||
m.velocity = move_and_slide(m.velocity);
|
||||
}
|
||||
|
||||
void MobsCorpACorpIA::_init()
|
||||
|
@ -29,6 +29,7 @@ public:
|
||||
MobsCorpACorpIA();
|
||||
|
||||
void static _register_methods();
|
||||
void _physics_process(float delta);
|
||||
void _process(float delta);
|
||||
void _init();
|
||||
void _ready();
|
||||
|
Reference in New Issue
Block a user