46 detect.x = getPosX()-w;
47 detect.y = getPosY()-h;
48 detect.w = getPosW()+w+w;
49 detect.h = getPosH()+h+h;
This class stores information for an Object in the game.
void deactivate()
Sets active to false.
void checkDisplayable(Object screen)
Checks if an the Entity is in the current screen by passing the screen to it.
void setDisplayable(bool d)
This sets if you want the Object to visible on the screen by passing in a boolean.
SDL_Rect getDetect() const
Returns the detection radius.
void setDest(SDL_Rect i)
Set the destination with a given SDL_Rect.
void setHealth(double h)
Set the Entity's health. If the health is higher then the max health it will set it to the max health...
void activate()
Sets active to true.
void setDetectRange(int r)
Sets the detection radius with a single given distance.
void heal(double h)
Give health to the Entity.
void damage(double d)
Deal damage. Subtracted from health. If health is less then zero it kills the entity.
void kill()
Sets health to zero and deactives the Entity.
bool isTouching(Object a, Object b)
Check if two objects are touching.