2016-03-18 07:55:50 +00:00
|
|
|
#ifndef DEF_XMARIOMOBILE_H
|
|
|
|
|
|
|
|
#define DEF_XMARIOMOBILE_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 xMarioMobile{
|
|
|
|
|
|
|
|
public:
|
|
|
|
xMarioMobile(
|
|
|
|
double gravity,
|
|
|
|
double multx,
|
|
|
|
double multy,
|
|
|
|
double accx,
|
|
|
|
double accy,
|
|
|
|
double decx,
|
|
|
|
double decy,
|
|
|
|
double minx,
|
|
|
|
double miny,
|
|
|
|
double maxx,
|
|
|
|
double maxy
|
|
|
|
); // Initialisation des params de mouvement
|
|
|
|
|
|
|
|
// Routine appelee dans la boucle principale
|
|
|
|
virtual void moveFromVelocity();
|
|
|
|
|
|
|
|
// GETTER
|
|
|
|
double velocity(bool way=XMARIO_VEL_HOR); // Recupere velocite
|
|
|
|
|
|
|
|
// SETTER
|
|
|
|
void velocity(double x=0.0, double y=0.0); // Modification de velocite
|
|
|
|
|
|
|
|
// PROPAGATION AUX ENFANTS
|
2016-03-18 10:15:02 +00:00
|
|
|
virtual vector<int> spreadMove();
|
2016-03-18 07:55:50 +00:00
|
|
|
virtual void spreadTurn();
|
|
|
|
virtual void spreadUpdateVelocity();
|
|
|
|
virtual void spreadApplyGravity();
|
|
|
|
|
|
|
|
|
|
|
|
// Etat physique
|
|
|
|
string _pos;
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
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
|