The MovingObject class represents a moving colliding object.
More...
#include <CollidingObject.h>
|
| | MovingObject (int x, int y, int radius, const std::string &id) |
| | Constructs a new MovingObject with a circular collider.
|
| |
| | MovingObject (int x, int y, int width, int height, const std::string &id) |
| | Constructs a new MovingObject with a rectangular collider.
|
| |
| virtual void | move ()=0 |
| | Moves the object.
|
| |
| | CollidingObject (int x, int y, int radius, const std::string &id) |
| | Constructs a new CollidingObject with a circular collider.
|
| |
| | CollidingObject (int x, int y, int width, int height, const std::string &id) |
| | Constructs a new CollidingObject with a rectangular collider.
|
| |
| | CollidingObject (int x, int y, int width, int height, bool isTop, const std::string &id) |
| | Constructs a new CollidingObject with a triangular collider.
|
| |
| | CollidingObject (int x, int y, int width, int height, int edges, const std::string &id) |
| | Constructs a new CollidingObject with a hexagonal collider.
|
| |
| std::shared_ptr< Collider > | getCollider () |
| | Gets the collider associated with the object.
|
| |
| virtual void | handleCollisions (point collision)=0 |
| | Handles collisions with other objects.
|
| |
| virtual void | render (std::shared_ptr< SDL_Renderer > renderer, SDL_Color color1, SDL_Color color2)=0 |
| | Renders the object on the screen.
|
| |
The MovingObject class represents a moving colliding object.
The MovingObject class inherits from the CollidingObject class and provides functionality for moving objects in a game environment.
Definition at line 486 of file CollidingObject.h.
◆ MovingObject() [1/2]
| MovingObject::MovingObject |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
radius, |
|
|
const std::string & |
id |
|
) |
| |
|
inline |
Constructs a new MovingObject with a circular collider.
- Parameters
-
| x | The x-coordinate of the object's position. |
| y | The y-coordinate of the object's position. |
| radius | The radius of the circular collider. |
| id | The unique identifier of the object. |
Definition at line 498 of file CollidingObject.h.
◆ MovingObject() [2/2]
| MovingObject::MovingObject |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
width, |
|
|
int |
height, |
|
|
const std::string & |
id |
|
) |
| |
|
inline |
Constructs a new MovingObject with a rectangular collider.
- Parameters
-
| x | The x-coordinate of the object's position. |
| y | The y-coordinate of the object's position. |
| width | The width of the rectangular collider. |
| height | The height of the rectangular collider. |
| id | The unique identifier of the object. |
Definition at line 512 of file CollidingObject.h.
◆ move()
| virtual void MovingObject::move |
( |
| ) |
|
|
pure virtual |
Moves the object.
This function is virtual and must be implemented by derived classes to define specific movement behavior.
Implemented in Ball, and PLATFORM.
◆ Velocity
| point MovingObject::Velocity |
The documentation for this class was generated from the following file: