2016-03-13 17:33:47 +00:00
|
|
|
#ifndef DEF_XMARIOMARIO_H
|
|
|
|
|
|
|
|
#define DEF_XMARIOMARIO_H
|
|
|
|
|
2016-03-14 12:14:35 +00:00
|
|
|
|
|
|
|
/* [CST] Constantes et enumeration
|
|
|
|
=========================================================*/
|
2016-03-18 07:55:50 +00:00
|
|
|
|
2016-03-14 12:14:35 +00:00
|
|
|
|
|
|
|
/* [DEF] Definition de la classe
|
|
|
|
=========================================================*/
|
2016-03-18 07:55:50 +00:00
|
|
|
class xMarioMario : public xSpriteAnimation, public xMarioMobile{
|
2016-03-13 17:33:47 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
xMarioMario(xManager *manager, int x, int y); // Spritesheet avec taille de chaque sprite
|
|
|
|
|
2016-03-18 07:55:50 +00:00
|
|
|
// GETTERS
|
2016-03-14 12:14:35 +00:00
|
|
|
bool onFloor(); // Si mario est sur le sol
|
2016-03-16 13:49:05 +00:00
|
|
|
bool onWall(); // Si mario est contre un mur
|
2016-03-14 12:14:35 +00:00
|
|
|
|
2016-03-18 07:55:50 +00:00
|
|
|
// PROPAGATION AUX ENFANTS
|
|
|
|
vector<int> spreadMove(int x, int y);
|
|
|
|
void spreadTurn();
|
|
|
|
void spreadUpdateVelocity();
|
|
|
|
void spreadApplyGravity();
|
|
|
|
|
|
|
|
// Surcharge parent
|
|
|
|
void onCollide(vector<int> from, xSprite* by);
|
2016-03-14 12:14:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Gestion du suivi du deplacement
|
|
|
|
bool _left;
|
|
|
|
bool _right;
|
|
|
|
bool _up;
|
|
|
|
bool _down;
|
|
|
|
|
2016-03-14 15:10:21 +00:00
|
|
|
int _jumps;
|
|
|
|
|
2016-03-14 18:28:18 +00:00
|
|
|
// Etat physique
|
|
|
|
string _pos;
|
|
|
|
|
2016-03-13 19:36:16 +00:00
|
|
|
|
2016-03-13 17:33:47 +00:00
|
|
|
private:
|
2016-03-13 19:36:16 +00:00
|
|
|
Uint32 _lastmove;
|
|
|
|
|
|
|
|
|
2016-03-13 17:33:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|