reglage probleme animations + commentaire

This commit is contained in:
Estrela Allan p1923381
2020-05-03 15:35:51 +02:00
parent c85ccf4f8f
commit d909ecd889
6 changed files with 206 additions and 155 deletions

View File

@ -24,6 +24,7 @@ public:
GestionPlayer();
void static _register_methods();
void _physics_process(float delta);
void _process(float delta);
void _init();
void _ready();
@ -35,22 +36,13 @@ public:
Player p;
public:
void traitementInput();
void setPosition(int x, int y);
void setPosition(float x, float y);
private:
//void droit();
//void gauche();
//void bas();
//void saut();
//void dash();
//void idle();
//void attack();
//void bigattack();
//void block();
void traitementInput();
void PlayerLogic_AutoReset();
void PlayerLogic(float dt);
void PlayerLogic_OnGround(float dt);
void PlayerLogic_Jump(float dt);
@ -68,19 +60,34 @@ public:
bool on_right_wall = false;
struct S_PlayerState
class S_PlayerState
{
bool right;
bool left;
bool jump;
bool dash;
bool idle;
bool attack;
bool bigattack;
bool block;
public:
union
{
struct
{
unsigned int right : 1;
unsigned int left : 1;
unsigned int jump : 1;
unsigned int dash : 1;
unsigned int idle : 1;
unsigned int attack : 1;
unsigned int bigattack : 1;
unsigned int block : 1;
bool freefall;
unsigned int freefall : 1;
unsigned int isInBlockingAnimation : 1;
};
unsigned int AllFlags; // to reset all bits at once
} Flags;
void Reset()
{
Flags.AllFlags = 0;
}
S_PlayerState() { Reset(); }
} playerState;
private: