2016-03-13 13:53:39 +00:00
|
|
|
/* [CONSTRUCTOR] Construction d'un xMarioGreenShell
|
|
|
|
=========================================================*/
|
2016-03-16 11:08:22 +00:00
|
|
|
xMarioMysteryBloc::xMarioMysteryBloc(xManager *m, int x, int y, int nb)
|
2016-03-17 09:17:21 +00:00
|
|
|
: xMarioBreakableBloc(
|
2016-03-13 13:53:39 +00:00
|
|
|
m,
|
|
|
|
"src/myst_bloc.png",
|
2016-03-17 09:17:21 +00:00
|
|
|
x,
|
|
|
|
y,
|
|
|
|
nb
|
2016-03-13 13:53:39 +00:00
|
|
|
){
|
2016-03-16 09:17:28 +00:00
|
|
|
this->setType("mystery-bloc");
|
2016-03-13 13:53:39 +00:00
|
|
|
|
|
|
|
/* (2) On definit les clip de chaque frame */
|
|
|
|
this->addFrame( (SDL_Rect){0, 0, 16, 16} );
|
|
|
|
this->addFrame( (SDL_Rect){0, 16, 16, 16} );
|
|
|
|
this->addFrame( (SDL_Rect){0, 32, 16, 16} );
|
|
|
|
this->addFrame( (SDL_Rect){0, 48, 16, 16} );
|
2016-03-13 23:06:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* [ACTIVE] Gestion du caractere "actif" du bouton
|
|
|
|
=========================================================*/
|
|
|
|
void xMarioMysteryBloc::active(bool active){
|
|
|
|
_active = active;
|
|
|
|
|
|
|
|
|
|
|
|
if( active ){
|
|
|
|
|
2016-03-14 12:14:35 +00:00
|
|
|
|
|
|
|
this->pull();
|
2016-03-14 18:28:18 +00:00
|
|
|
this->clear();
|
2016-03-14 12:14:35 +00:00
|
|
|
|
2016-03-13 23:06:33 +00:00
|
|
|
|
|
|
|
this->addFrame( (SDL_Rect){0, 0, 16, 16} );
|
|
|
|
this->addFrame( (SDL_Rect){0, 16, 16, 16} );
|
|
|
|
this->addFrame( (SDL_Rect){0, 32, 16, 16} );
|
|
|
|
this->addFrame( (SDL_Rect){0, 48, 16, 16} );
|
|
|
|
|
2016-03-14 12:14:35 +00:00
|
|
|
// On ajoute au rendu
|
2016-03-14 15:10:21 +00:00
|
|
|
this->push(_index);
|
2016-03-14 12:14:35 +00:00
|
|
|
|
2016-03-13 23:06:33 +00:00
|
|
|
}else{
|
|
|
|
|
2016-03-14 15:10:21 +00:00
|
|
|
this->pull();
|
2016-03-14 18:28:18 +00:00
|
|
|
this->clear();
|
2016-03-13 23:06:33 +00:00
|
|
|
|
|
|
|
this->addFrame( (SDL_Rect){0, 64, 16, 16} );
|
2016-03-14 12:14:35 +00:00
|
|
|
this->addFrame( (SDL_Rect){0, 64, 16, 16} );
|
|
|
|
this->addFrame( (SDL_Rect){0, 64, 16, 16} );
|
|
|
|
this->addFrame( (SDL_Rect){0, 64, 16, 16} );
|
|
|
|
|
|
|
|
// On ajoute au rendu
|
|
|
|
this->push(_index);
|
2016-03-13 23:06:33 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-03-13 13:53:39 +00:00
|
|
|
}
|