lab.cpp/SDL#4/xMario/BreakableBloc/xMarioBrick.cpp

31 lines
662 B
C++
Raw Permalink Normal View History

/* [CONSTRUCTOR] Construction d'un xMarioBrick
=========================================================*/
xMarioBrick::xMarioBrick(xManager *m, int x, int y, int nb)
: xMarioBreakableBloc(
m,
"src/blocs.png",
x,
y,
nb
){
this->setType("brick");
// On definit la frame de l'animation
this->addFrame( (SDL_Rect){136, 0, 16, 16} );
this->addFrame( (SDL_Rect){136, 0, 16, 16} );
}
/* [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();
}