2016-03-14 18:28:18 +00:00
|
|
|
/* [CONSTRUCTOR] Construction d'un xMarioBrick
|
|
|
|
=========================================================*/
|
2016-03-16 11:08:22 +00:00
|
|
|
xMarioBrick::xMarioBrick(xManager *m, int x, int y, int nb)
|
2016-03-17 09:17:21 +00:00
|
|
|
: xMarioBreakableBloc(
|
2016-03-14 18:28:18 +00:00
|
|
|
m,
|
2016-03-17 09:17:21 +00:00
|
|
|
"src/blocs.png",
|
|
|
|
x,
|
|
|
|
y,
|
|
|
|
nb
|
2016-03-14 18:28:18 +00:00
|
|
|
){
|
2016-03-17 09:17:21 +00:00
|
|
|
this->setType("brick");
|
2016-03-14 18:28:18 +00:00
|
|
|
|
2016-03-17 09:17:21 +00:00
|
|
|
// On definit la frame de l'animation
|
|
|
|
this->addFrame( (SDL_Rect){136, 0, 16, 16} );
|
|
|
|
this->addFrame( (SDL_Rect){136, 0, 16, 16} );
|
2016-03-14 18:28:18 +00:00
|
|
|
|
2016-03-16 11:08:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* [ACTIVE] Gestion du caractere "actif" du bouton
|
|
|
|
=========================================================*/
|
|
|
|
void xMarioBrick::active(bool active){
|
|
|
|
_active = active;
|
|
|
|
|
|
|
|
// actif, on affiche
|
|
|
|
if( active )
|
|
|
|
this->push(_index);
|
|
|
|
// sinon on enleve
|
|
|
|
else
|
|
|
|
this->pull();
|
|
|
|
|
2016-03-14 18:28:18 +00:00
|
|
|
}
|