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
WALL.cpp
Go to the documentation of this file.
1//
2// Created by nicolas elfering on 14.04.24.
3//
4
5#include "WALL.h"
6
7WALL::WALL(int x, int y, int width, int height,const std::string& id,bool kill)
8 : CollidingObject(x, y, width, height,id) {
9 rect.x = x;
10 rect.y = y;
11 rect.w = width;
12 rect.h = height;
13 kills = kill;
14}
15
16void WALL::render(std::shared_ptr<SDL_Renderer> renderer, SDL_Color color1,SDL_Color color2) {
17 collider->render(renderer,color1,color2);
18}
The CollidingObject class represents a generic colliding object.
std::shared_ptr< Collider > collider
The collider associated with the object.
void render(std::shared_ptr< SDL_Renderer > renderer, SDL_Color color1, SDL_Color color2) override
Renders the object on the screen.
Definition WALL.cpp:16
SDL_Rect rect
Definition WALL.h:21
bool kills
Definition WALL.h:23
WALL(int x, int y, int width, int height, const std::string &id, bool kill)
Definition WALL.cpp:7