#include"block.h"

Block::Block(int x, int y, int w, int h,SDL_Renderer** render, Player* player, int cameraX){
	//set the rectangle dimensions
	rect = {x,y,w,h};

	//Set the renderer pointer
	renderer = render;

	type = 1;

	//New SDL_Rect to make the objects follow the camera
	SDL_Rect cameraFix = rect;
	cameraFix.x -= cameraX;

	//Set render color and render the rectangle
	SDL_SetRenderDrawColor(*renderer,0,0xFF,0,0xFF);
	SDL_RenderFillRect(*renderer,&cameraFix); 
	
	player->check(rect,type);
}
