Eliminat "const.h"

This commit is contained in:
2024-09-28 10:16:35 +02:00
parent 8d263931b2
commit f2cc0dc352
28 changed files with 74 additions and 91 deletions

View File

@@ -1,5 +1,5 @@
#include "const.h"
#include "player.h"
#include "param.h"
// Constructor
Player::Player(int id, float x, int y, SDL_Rect *playArea, std::vector<Texture *> texture, std::vector<std::vector<std::string> *> animations)
@@ -114,7 +114,7 @@ void Player::move()
posX += velX;
// Si el jugador abandona el area de juego por los laterales
if ((posX < PLAY_AREA_LEFT - 5) || (posX + width > playArea->w + 5))
if ((posX < param.game.playArea.rect.x - 5) || (posX + width > playArea->w + 5))
{
// Restaura su posición
posX -= velX;
@@ -131,7 +131,7 @@ void Player::move()
playerSprite->update();
// Si el cadaver abandona el area de juego por los laterales
if ((playerSprite->getPosX() < PLAY_AREA_LEFT) || (playerSprite->getPosX() + width > playArea->w))
if ((playerSprite->getPosX() < param.game.playArea.rect.x) || (playerSprite->getPosX() + width > playArea->w))
{
// Restaura su posición
const float vx = playerSprite->getVelX();