64 lines
1.4 KiB
C++
64 lines
1.4 KiB
C++
#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
|
|
virtual vector<int> spreadMove(int x, int y);
|
|
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 |