20 lines
512 B
C++
20 lines
512 B
C++
|
/* [CONSTRUCTOR] Construction d'un xMarioBrick
|
||
|
=========================================================*/
|
||
|
xMarioBrick::xMarioBrick(xManager *m, int x, int y)
|
||
|
: xSprite(
|
||
|
m,
|
||
|
"src/blocs.png"
|
||
|
){
|
||
|
_manager = m;
|
||
|
|
||
|
// Note: le rect correspond a un nombre de bloc
|
||
|
// On convertit le tout en blocs reels
|
||
|
int xReal = x * BLOC_SIZE;
|
||
|
int yReal = y * BLOC_SIZE;
|
||
|
|
||
|
this->dimensions(
|
||
|
(SDL_Rect){xReal, yReal, BLOC_SIZE, BLOC_SIZE}, // On definit le viewport
|
||
|
(SDL_Rect){136, 0, 16, 16} // On definit le clip
|
||
|
);
|
||
|
|
||
|
}
|