|
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.
|
The Triangle class represents a triangular block. More...
#include <triangle.h>
Public Member Functions | |
| Triangle (int x, int y, int h, int w, bool isTop) | |
| Constructs a new Triangle object with specified parameters. | |
| void | render (std::shared_ptr< SDL_Renderer > renderer, SDL_Color color1, SDL_Color color2) override |
| Renders the triangular block on the screen. | |
Public Member Functions inherited from Brique | |
| Brique (int x, int y, int w, int h) | |
| Constructs a new Brique object with specified position and dimensions. | |
| Brique (int x, int y, int width, int height, bool isTop) | |
| Constructs a new Brique object with specified position, dimensions, and whether it's a top block. | |
| Brique (int x, int y, int width, int height, int edges) | |
| Constructs a new Brique object with specified position, dimensions, and number of edges. | |
| void | handleCollisions (point collision) override |
| Handles collisions with other objects. | |
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< 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. | |
Additional Inherited Members | |
Data Fields inherited from Brique | |
| int | collision_counter |
| The collision counter for the block. | |
| bool | collided = false |
| Flag indicating whether the block has collided with another object. | |
| int | super_power |
| The super power level of the block. | |
Protected Attributes inherited from Brique | |
| SDL_Color | color1 |
| The primary color of the block. | |
| SDL_Color | color2 |
| The secondary color of the block. | |
Protected Attributes inherited from CollidingObject | |
| std::shared_ptr< Collider > | collider |
| The collider associated with the object. | |
The Triangle class represents a triangular block.
The Triangle class inherits from the Brique class and represents a block with a triangular shape.
Definition at line 22 of file triangle.h.
| Triangle::Triangle | ( | int | x, |
| int | y, | ||
| int | h, | ||
| int | w, | ||
| bool | isTop | ||
| ) |
Constructs a new Triangle object with specified parameters.
| x | The x-coordinate of the triangle's position. |
| y | The y-coordinate of the triangle's position. |
| h | The height of the triangle. |
| w | The width of the triangle. |
| isTop | Flag indicating whether the triangle is oriented upwards or downwards. |
Definition at line 8 of file triangle.cpp.
|
overridevirtual |
Renders the triangular block on the screen.
| renderer | A shared pointer to the SDL renderer used for rendering. |
| color1 | The primary color of the triangle. |
| color2 | The secondary color of the triangle. |
Implements CollidingObject.
Definition at line 13 of file triangle.cpp.