Creando las superficies del mapa

This commit is contained in:
2022-09-07 14:00:02 +02:00
parent 4193414f10
commit 2039b2f8db
4 changed files with 268 additions and 27 deletions

View File

@@ -34,6 +34,18 @@ struct circle_t
int r;
};
// Estructura para definir una linea horizontal
struct h_line_t
{
int x1, x2, y;
};
// Estructura para definir una linea vertical
struct v_line_t
{
int x, y1, y2;
};
// Estructura para definir un color
struct color_t
{
@@ -74,9 +86,15 @@ bool checkCollision(circle_t &a, SDL_Rect &b);
// Detector de colisiones entre un dos rectangulos
bool checkCollision(SDL_Rect &a, SDL_Rect &b);
// Detector de colisiones entre un punto y u rectangulo
// Detector de colisiones entre un punto y un rectangulo
bool checkCollision(SDL_Point &p, SDL_Rect &r);
// Detector de colisiones entre una linea horizontal y un rectangulo
bool checkCollision(h_line_t &l, SDL_Rect &r);
// Detector de colisiones entre una linea vertical y un rectangulo
bool checkCollision(v_line_t &l, SDL_Rect &r);
// Devuelve un color_t a partir de un string
color_t stringToColor(std::string str);