//Powerup class body #include"powerup.h" Powerup::Powerup(int x, int y, SDL_Renderer** render,Player* player){ posX = x; posY = y; szW = 20; szH = 20; type = 2; rect = {posX, posY, szW, szH}; renderer = render; posu = player; }; void Powerup::print(int cameraX){ //New SDL_Rect to make the objects follow the camera SDL_Rect cameraFix = rect; cameraFix.x -= cameraX; //Set render color and render the rectangle if(posu->check(rect,type)==0){ SDL_SetRenderDrawColor(*renderer,0xFF,0xFF,0,0xFF); SDL_RenderFillRect(*renderer,&cameraFix); } //posu->check(rect, type); };