55 lines
1.2 KiB
C
55 lines
1.2 KiB
C
|
#ifndef DEF_XMARIOMARIO_H
|
||
|
|
||
|
#define DEF_XMARIOMARIO_H
|
||
|
|
||
|
|
||
|
/* [CST] Constantes et enumeration
|
||
|
=========================================================*/
|
||
|
#define XMARIO_VEL_HOR true // velocite verticale
|
||
|
#define XMARIO_VEL_VER false // velocite horizontale
|
||
|
|
||
|
/* [DEF] Definition de la classe
|
||
|
=========================================================*/
|
||
|
class xMarioMario : public xSpriteAnimation{
|
||
|
|
||
|
public:
|
||
|
xMarioMario(xManager *manager, int x, int y); // Spritesheet avec taille de chaque sprite
|
||
|
|
||
|
void moveFromVelocity();
|
||
|
|
||
|
// Changement de frames
|
||
|
void turnLeft();
|
||
|
void turnRight();
|
||
|
|
||
|
// GETTER
|
||
|
double velocity(bool way=XMARIO_VEL_HOR); // Recupere velocite
|
||
|
bool onFloor(); // Si mario est sur le sol
|
||
|
|
||
|
// SETTER
|
||
|
void velocity(double x=0.0, double y=0.0); // Modification de velocite
|
||
|
|
||
|
|
||
|
// Gestion du suivi du deplacement
|
||
|
bool _left;
|
||
|
bool _right;
|
||
|
bool _up;
|
||
|
bool _down;
|
||
|
|
||
|
int _jumps;
|
||
|
|
||
|
|
||
|
private:
|
||
|
Uint32 _lastmove;
|
||
|
double _velocity[2];
|
||
|
double _gravity;
|
||
|
|
||
|
double _mult[2];
|
||
|
double _min_vel[2];
|
||
|
double _max_vel[2];
|
||
|
double _acc[2];
|
||
|
double _dec[2];
|
||
|
|
||
|
|
||
|
};
|
||
|
|
||
|
#endif
|