mirror of
https://forge.univ-lyon1.fr/tplifap4/dungeonanddeamon.git
synced 2024-02-27 13:31:50 +01:00
reglage probleme animations + commentaire
This commit is contained in:
@ -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:
|
||||
|
Reference in New Issue
Block a user