36 SDL_Rect*
nextRect(
float dx,
float dy);
Component to handle collisions between game objects.
SDL_Rect * mCollide
The collision rectangle relative to the screen.
void preventCollision(Collide *anotherCollide, float &dx, float &dy)
Modifies velocities to prevent collision with another Collide component.
~Collide()
Destructor for the Collide component.
void setScreenSize(int w, int h)
Sets the size of the collider on the screen.
float mOffsetY
Offset of the collider's position from the game object's transform position.
void render()
Renders the collision boundaries for debugging purposes.
void setTransformOffset(int x, int y)
Sets the offset of the collider from the transform's position.
SDL_Rect * nextRect(float dx, float dy)
Calculates the position of the collider for the next frame.
void setScreenPosition(int x, int y)
Sets the screen position of the collider.
Collide()
Constructor for the Collide component.
Vec2 getScreenSize()
Retrieves the size of the collision rectangle on the screen.
bool isColliding(SDL_Rect *rect)
Checks if this collider is colliding with a given SDL_Rect.
Vec2 getScreenPosition()
Retrieves the screen position of the collision rectangle.
void update()
Updates the collision state of the component.
SDL_Rect * getRect()
Gets the current collision rectangle.
Base class for all game components, providing basic component functionalities.
Defines the Component base class for all components in the game engine.
A structure to represent 2D vectors.
Definition of Vec2 structure for 2D vector operations.