casse-brick latest
Ce projet est réalisé dans le cadre du cours de Programmation Avancée en M1 Informatique de l'université de Strasbourg.
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
MovingObject Class Referenceabstract

The MovingObject class represents a moving colliding object. More...

#include <CollidingObject.h>

Inheritance diagram for MovingObject:
CollidingObject Ball PLATFORM

Public Member Functions

 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.
 
- Public Member Functions inherited from CollidingObject
 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< CollidergetCollider ()
 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.
 

Data Fields

point Velocity
 The velocity of the object.
 

Additional Inherited Members

- Protected Attributes inherited from CollidingObject
std::shared_ptr< Collidercollider
 The collider associated with the object.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ 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
xThe x-coordinate of the object's position.
yThe y-coordinate of the object's position.
radiusThe radius of the circular collider.
idThe 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
xThe x-coordinate of the object's position.
yThe y-coordinate of the object's position.
widthThe width of the rectangular collider.
heightThe height of the rectangular collider.
idThe unique identifier of the object.

Definition at line 512 of file CollidingObject.h.

Member Function Documentation

◆ 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.

Field Documentation

◆ Velocity

point MovingObject::Velocity

The velocity of the object.

Definition at line 488 of file CollidingObject.h.


The documentation for this class was generated from the following file: