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
brique.h
Go to the documentation of this file.
1//
2// Created by maxime on 16/04/24.
3//
4
5#ifndef CASSE_BRIQUE_BRIQUE_H
6#define CASSE_BRIQUE_BRIQUE_H
7
8#include <SDL2/SDL.h>
9#include <SDL_image.h>
10#include <SDL2/SDL_timer.h>
11#include <iostream>
12#include <memory>
13#include <random>
14
15#include "CollidingObject.h"
16
17// Define color macros
18#define red {184,84,80},{248,206,204,255}
19#define yellow {214,182,86},{255,242,204,255}
20#define green {130,179,102},{213,232,212,255}
21#define blue {108, 142, 191},{218, 232, 252,255}
22#define lila {150, 115, 166},{225, 213, 231,255}
23
24// Define enum for block type
25enum TYPE {
29};
30
36class Brique : public CollidingObject {
37protected:
38 SDL_Color color1;
39 SDL_Color color2;
40
41public:
43 bool collided = false;
45
54 Brique(int x, int y, int w, int h);
55
65 Brique(int x, int y, int width, int height, bool isTop);
66
76 Brique(int x, int y, int width, int height, int edges);
77
83 void handleCollisions(point collision) override;
84};
85
86#endif //CASSE_BRIQUE_BRIQUE_H
TYPE
Definition brique.h:25
@ TRIANGLE
Definition brique.h:28
@ HEXAGON
Definition brique.h:27
@ RECTANGLE
Definition brique.h:26
The Brique class represents a block object in the game.
Definition brique.h:36
bool collided
Flag indicating whether the block has collided with another object.
Definition brique.h:43
int super_power
The super power level of the block.
Definition brique.h:44
SDL_Color color1
The primary color of the block.
Definition brique.h:38
SDL_Color color2
The secondary color of the block.
Definition brique.h:39
int collision_counter
The collision counter for the block.
Definition brique.h:42
void handleCollisions(point collision) override
Handles collisions with other objects.
Definition brique.cpp:62
The CollidingObject class represents a generic colliding object.
The point struct represents a point in 2D space.