forked from jaildesigner-jailgames/jaildoctors_dilemma
Singletonejant
Borrat menu.cpp que no estava gastantse...mmm.. desde mai
This commit is contained in:
@@ -13,20 +13,19 @@
|
||||
#include "room.h" // Para Room, tile_e
|
||||
#include "texture.h" // Para Texture
|
||||
#include "options.h"
|
||||
#include "screen.h"
|
||||
|
||||
// Constructor
|
||||
Player::Player(player_t player)
|
||||
: renderer_(Screen::get()->getRenderer()),
|
||||
input_(Input::get()),
|
||||
resource_(Resource::get()),
|
||||
asset_(Asset::get()),
|
||||
room_(player.room),
|
||||
debug_(Debug::get())
|
||||
{
|
||||
// Obten punteros a objetos
|
||||
this->resource = player.resource;
|
||||
this->asset = player.asset;
|
||||
this->renderer = player.renderer;
|
||||
this->input = player.input;
|
||||
this->room = player.room;
|
||||
this->debug = player.debug;
|
||||
|
||||
// Crea objetos
|
||||
sprite = new AnimatedSprite(renderer, resource->getAnimation(player.animation));
|
||||
sprite_ = new AnimatedSprite(renderer_, resource_->getAnimation(player.animation));
|
||||
|
||||
// Inicializa variables
|
||||
reLoadPalette();
|
||||
@@ -49,14 +48,14 @@ Player::Player(player_t player)
|
||||
h = 16;
|
||||
maxVY = 1.2f;
|
||||
|
||||
sprite->setPosX(player.spawn.x);
|
||||
sprite->setPosY(player.spawn.y);
|
||||
sprite->setWidth(8);
|
||||
sprite->setHeight(16);
|
||||
sprite_->setPosX(player.spawn.x);
|
||||
sprite_->setPosY(player.spawn.y);
|
||||
sprite_->setWidth(8);
|
||||
sprite_->setHeight(16);
|
||||
|
||||
sprite->setFlipH(player.spawn.flipH);
|
||||
sprite->setCurrentAnimation("walk");
|
||||
sprite->animate();
|
||||
sprite_->setFlipH(player.spawn.flipH);
|
||||
sprite_->setCurrentAnimation("walk");
|
||||
sprite_->animate();
|
||||
|
||||
lastPosition = getRect();
|
||||
colliderBox = getRect();
|
||||
@@ -64,45 +63,45 @@ Player::Player(player_t player)
|
||||
colliderPoints.insert(colliderPoints.end(), {p, p, p, p, p, p, p, p});
|
||||
underFeet.insert(underFeet.end(), {p, p});
|
||||
feet.insert(feet.end(), {p, p});
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump1.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump2.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump3.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump4.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump5.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump6.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump7.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump8.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump9.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump10.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump11.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump12.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump13.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump14.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump15.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump16.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump17.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump18.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump19.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump20.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump21.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump22.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump23.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset->get("jump24.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump1.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump2.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump3.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump4.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump5.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump6.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump7.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump8.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump9.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump10.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump11.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump12.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump13.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump14.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump15.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump16.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump17.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump18.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump19.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump20.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump21.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump22.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump23.wav").c_str()));
|
||||
jumpSound.push_back(JA_LoadSound(asset_->get("jump24.wav").c_str()));
|
||||
|
||||
fallSound.push_back(JA_LoadSound(asset->get("jump11.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset->get("jump12.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset->get("jump13.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset->get("jump14.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset->get("jump15.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset->get("jump16.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset->get("jump17.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset->get("jump18.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset->get("jump19.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset->get("jump20.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset->get("jump21.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset->get("jump22.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset->get("jump23.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset->get("jump24.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset_->get("jump11.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset_->get("jump12.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset_->get("jump13.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset_->get("jump14.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset_->get("jump15.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset_->get("jump16.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset_->get("jump17.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset_->get("jump18.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset_->get("jump19.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset_->get("jump20.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset_->get("jump21.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset_->get("jump22.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset_->get("jump23.wav").c_str()));
|
||||
fallSound.push_back(JA_LoadSound(asset_->get("jump24.wav").c_str()));
|
||||
|
||||
jumpCounter = 0;
|
||||
fallCounter = 0;
|
||||
@@ -118,7 +117,7 @@ Player::Player(player_t player)
|
||||
// Destructor
|
||||
Player::~Player()
|
||||
{
|
||||
delete sprite;
|
||||
delete sprite_;
|
||||
|
||||
for (auto s : jumpSound)
|
||||
{
|
||||
@@ -129,38 +128,38 @@ Player::~Player()
|
||||
// Pinta el jugador en pantalla
|
||||
void Player::render()
|
||||
{
|
||||
sprite->getTexture()->setColor(color.r, color.g, color.b);
|
||||
sprite->render();
|
||||
sprite_->getTexture()->setColor(color.r, color.g, color.b);
|
||||
sprite_->render();
|
||||
|
||||
#ifdef DEBUG
|
||||
if (debug->getEnabled())
|
||||
if (debug_->getEnabled())
|
||||
{
|
||||
// Pinta los underfeet
|
||||
SDL_SetRenderDrawColor(renderer, 255, 0, 255, 255);
|
||||
SDL_RenderDrawPoint(renderer, underFeet[0].x, underFeet[0].y);
|
||||
SDL_RenderDrawPoint(renderer, underFeet[1].x, underFeet[1].y);
|
||||
SDL_SetRenderDrawColor(renderer_, 255, 0, 255, 255);
|
||||
SDL_RenderDrawPoint(renderer_, underFeet[0].x, underFeet[0].y);
|
||||
SDL_RenderDrawPoint(renderer_, underFeet[1].x, underFeet[1].y);
|
||||
|
||||
// Pinta rectangulo del jugador
|
||||
SDL_SetRenderDrawColor(renderer, debugColor.r, debugColor.g, debugColor.b, 192);
|
||||
SDL_SetRenderDrawColor(renderer_, debugColor.r, debugColor.g, debugColor.b, 192);
|
||||
SDL_Rect rect = getRect();
|
||||
SDL_RenderFillRect(renderer, &rect);
|
||||
SDL_SetRenderDrawColor(renderer, 0, 255, 255, 255);
|
||||
SDL_RenderDrawRect(renderer, &rect);
|
||||
SDL_RenderFillRect(renderer_, &rect);
|
||||
SDL_SetRenderDrawColor(renderer_, 0, 255, 255, 255);
|
||||
SDL_RenderDrawRect(renderer_, &rect);
|
||||
|
||||
// Pinta el rectangulo de movimiento
|
||||
SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255);
|
||||
SDL_SetRenderDrawColor(renderer_, 255, 0, 0, 255);
|
||||
if (vx != 0.0f)
|
||||
{
|
||||
SDL_RenderFillRect(renderer, &rx);
|
||||
SDL_RenderFillRect(renderer_, &rx);
|
||||
}
|
||||
if (vy != 0.0f)
|
||||
{
|
||||
SDL_RenderFillRect(renderer, &ry);
|
||||
SDL_RenderFillRect(renderer_, &ry);
|
||||
}
|
||||
|
||||
// Pinta el punto de debug
|
||||
SDL_SetRenderDrawColor(renderer, rand() % 256, rand() % 256, rand() % 256, 255);
|
||||
SDL_RenderDrawPoint(renderer, debugPoint.x, debugPoint.y);
|
||||
SDL_SetRenderDrawColor(renderer_, rand() % 256, rand() % 256, rand() % 256, 255);
|
||||
SDL_RenderDrawPoint(renderer_, debugPoint.x, debugPoint.y);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -192,16 +191,16 @@ void Player::checkInput()
|
||||
|
||||
if (!autoMovement)
|
||||
{ // Comprueba las entradas de desplazamiento lateral solo en el caso de no estar enganchado a una superficie automatica
|
||||
if (input->checkInput(input_left))
|
||||
if (input_->checkInput(input_left))
|
||||
{
|
||||
vx = -0.6f;
|
||||
sprite->setFlipH(true);
|
||||
sprite_->setFlipH(true);
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_right))
|
||||
else if (input_->checkInput(input_right))
|
||||
{
|
||||
vx = 0.6f;
|
||||
sprite->setFlipH(false);
|
||||
sprite_->setFlipH(false);
|
||||
}
|
||||
|
||||
else
|
||||
@@ -215,19 +214,19 @@ void Player::checkInput()
|
||||
}
|
||||
else
|
||||
{ // El movimiento lo proporciona la superficie
|
||||
vx = 0.6f * room->getAutoSurfaceDirection();
|
||||
vx = 0.6f * room_->getAutoSurfaceDirection();
|
||||
|
||||
if (vx > 0.0f)
|
||||
{
|
||||
sprite->setFlipH(false);
|
||||
sprite_->setFlipH(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->setFlipH(true);
|
||||
sprite_->setFlipH(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (input->checkInput(input_jump))
|
||||
if (input_->checkInput(input_jump))
|
||||
{
|
||||
// Solo puede saltar si ademas de estar (state == s_standing)
|
||||
// Esta sobre el suelo, rampa o suelo que se mueve
|
||||
@@ -409,7 +408,7 @@ void Player::move()
|
||||
#endif
|
||||
|
||||
// Comprueba la colisión con las superficies
|
||||
const int pos = room->checkRightSurfaces(&proj);
|
||||
const int pos = room_->checkRightSurfaces(&proj);
|
||||
|
||||
// Calcula la nueva posición
|
||||
if (pos == -1)
|
||||
@@ -425,7 +424,7 @@ void Player::move()
|
||||
if (state != s_jumping)
|
||||
{
|
||||
v_line_t leftSide = {(int)x, (int)y + h - 2, (int)y + h - 1}; // Comprueba solo los dos pixels de abajo
|
||||
const int ly = room->checkLeftSlopes(&leftSide);
|
||||
const int ly = room_->checkLeftSlopes(&leftSide);
|
||||
if (ly > -1)
|
||||
{
|
||||
y = ly - h;
|
||||
@@ -454,7 +453,7 @@ void Player::move()
|
||||
#endif
|
||||
|
||||
// Comprueba la colisión
|
||||
const int pos = room->checkLeftSurfaces(&proj);
|
||||
const int pos = room_->checkLeftSurfaces(&proj);
|
||||
|
||||
// Calcula la nueva posición
|
||||
if (pos == -1)
|
||||
@@ -470,7 +469,7 @@ void Player::move()
|
||||
if (state != s_jumping)
|
||||
{
|
||||
v_line_t rightSide = {(int)x + w - 1, (int)y + h - 2, (int)y + h - 1}; // Comprueba solo los dos pixels de abajo
|
||||
const int ry = room->checkRightSlopes(&rightSide);
|
||||
const int ry = room_->checkRightSlopes(&rightSide);
|
||||
if (ry > -1)
|
||||
{
|
||||
y = ry - h;
|
||||
@@ -515,7 +514,7 @@ void Player::move()
|
||||
#endif
|
||||
|
||||
// Comprueba la colisión
|
||||
const int pos = room->checkBottomSurfaces(&proj);
|
||||
const int pos = room_->checkBottomSurfaces(&proj);
|
||||
|
||||
// Calcula la nueva posición
|
||||
if (pos == -1)
|
||||
@@ -544,7 +543,7 @@ void Player::move()
|
||||
#endif
|
||||
|
||||
// Comprueba la colisión con las superficies normales y las automáticas
|
||||
const int pos = std::max(room->checkTopSurfaces(&proj), room->checkAutoSurfaces(&proj));
|
||||
const int pos = std::max(room_->checkTopSurfaces(&proj), room_->checkAutoSurfaces(&proj));
|
||||
if (pos > -1)
|
||||
{ // Si hay colisión lo mueve hasta donde no colisiona y pasa a estar sobre la superficie
|
||||
y = pos - h;
|
||||
@@ -559,7 +558,7 @@ void Player::move()
|
||||
{ // Las rampas no se miran si se está saltando
|
||||
v_line_t leftSide = {proj.x, proj.y, proj.y + proj.h - 1};
|
||||
v_line_t rightSide = {proj.x + proj.w - 1, proj.y, proj.y + proj.h - 1};
|
||||
const int p = std::max(room->checkRightSlopes(&rightSide), room->checkLeftSlopes(&leftSide));
|
||||
const int p = std::max(room_->checkRightSlopes(&rightSide), room_->checkLeftSlopes(&leftSide));
|
||||
if (p > -1)
|
||||
{ // No está saltando y hay colisión con una rampa
|
||||
// Calcula la nueva posición
|
||||
@@ -588,12 +587,12 @@ void Player::move()
|
||||
}
|
||||
|
||||
// Actualiza la posición del sprite
|
||||
sprite->setPosX(x);
|
||||
sprite->setPosY(y);
|
||||
sprite_->setPosX(x);
|
||||
sprite_->setPosY(y);
|
||||
|
||||
#ifdef DEBUG
|
||||
debug->add("RECT_X: " + std::to_string(rx.x) + "," + std::to_string(rx.y) + "," + std::to_string(rx.w) + "," + std::to_string(rx.h));
|
||||
debug->add("RECT_Y: " + std::to_string(ry.x) + "," + std::to_string(ry.y) + "," + std::to_string(ry.w) + "," + std::to_string(ry.h));
|
||||
debug_->add("RECT_X: " + std::to_string(rx.x) + "," + std::to_string(rx.y) + "," + std::to_string(rx.w) + "," + std::to_string(rx.h));
|
||||
debug_->add("RECT_Y: " + std::to_string(ry.x) + "," + std::to_string(ry.y) + "," + std::to_string(ry.w) + "," + std::to_string(ry.h));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -602,7 +601,7 @@ void Player::animate()
|
||||
{
|
||||
if (vx != 0)
|
||||
{
|
||||
sprite->animate();
|
||||
sprite_->animate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -632,7 +631,7 @@ void Player::playJumpSound()
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
debug->add("JUMP: " + std::to_string(jumpCounter / 4));
|
||||
debug_->add("JUMP: " + std::to_string(jumpCounter / 4));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -645,7 +644,7 @@ void Player::playFallSound()
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
debug->add("FALL: " + std::to_string(fallCounter / 4));
|
||||
debug_->add("FALL: " + std::to_string(fallCounter / 4));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -661,28 +660,28 @@ bool Player::isOnFloor()
|
||||
// Comprueba las superficies
|
||||
for (auto f : underFeet)
|
||||
{
|
||||
onFloor |= room->checkTopSurfaces(&f);
|
||||
onFloor |= room->checkAutoSurfaces(&f);
|
||||
onFloor |= room_->checkTopSurfaces(&f);
|
||||
onFloor |= room_->checkAutoSurfaces(&f);
|
||||
}
|
||||
|
||||
// Comprueba las rampas
|
||||
onSlopeL = room->checkLeftSlopes(&underFeet[0]);
|
||||
onSlopeR = room->checkRightSlopes(&underFeet[1]);
|
||||
onSlopeL = room_->checkLeftSlopes(&underFeet[0]);
|
||||
onSlopeR = room_->checkRightSlopes(&underFeet[1]);
|
||||
|
||||
#ifdef DEBUG
|
||||
if (onFloor)
|
||||
{
|
||||
debug->add("ON_FLOOR");
|
||||
debug_->add("ON_FLOOR");
|
||||
}
|
||||
|
||||
if (onSlopeL)
|
||||
{
|
||||
debug->add("ON_SLOPE_L: " + std::to_string(underFeet[0].x) + "," + std::to_string(underFeet[0].y));
|
||||
debug_->add("ON_SLOPE_L: " + std::to_string(underFeet[0].x) + "," + std::to_string(underFeet[0].y));
|
||||
}
|
||||
|
||||
if (onSlopeR)
|
||||
{
|
||||
debug->add("ON_SLOPE_R: " + std::to_string(underFeet[1].x) + "," + std::to_string(underFeet[1].y));
|
||||
debug_->add("ON_SLOPE_R: " + std::to_string(underFeet[1].x) + "," + std::to_string(underFeet[1].y));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -699,13 +698,13 @@ bool Player::isOnAutoSurface()
|
||||
// Comprueba las superficies
|
||||
for (auto f : underFeet)
|
||||
{
|
||||
onAutoSurface |= room->checkAutoSurfaces(&f);
|
||||
onAutoSurface |= room_->checkAutoSurfaces(&f);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
if (onAutoSurface)
|
||||
{
|
||||
debug->add("ON_AUTO_SURFACE");
|
||||
debug_->add("ON_AUTO_SURFACE");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -725,13 +724,13 @@ bool Player::isOnDownSlope()
|
||||
underFeet[1].y += 1;
|
||||
|
||||
// Comprueba las rampas
|
||||
onSlope |= room->checkLeftSlopes(&underFeet[0]);
|
||||
onSlope |= room->checkRightSlopes(&underFeet[1]);
|
||||
onSlope |= room_->checkLeftSlopes(&underFeet[0]);
|
||||
onSlope |= room_->checkRightSlopes(&underFeet[1]);
|
||||
|
||||
#ifdef DEBUG
|
||||
if (onSlope)
|
||||
{
|
||||
debug->add("ON_DOWN_SLOPE");
|
||||
debug_->add("ON_DOWN_SLOPE");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -749,7 +748,7 @@ bool Player::checkKillingTiles()
|
||||
|
||||
for (auto c : colliderPoints)
|
||||
{
|
||||
check |= (room->getTile(c) == t_kill);
|
||||
check |= (room_->getTile(c) == t_kill);
|
||||
}
|
||||
|
||||
// Mata al jugador si hay colisión
|
||||
@@ -772,7 +771,7 @@ playerSpawn_t Player::getSpawnParams()
|
||||
params.vy = vy;
|
||||
params.jumpIni = jumpIni;
|
||||
params.state = state;
|
||||
params.flipH = sprite->getFlipH();
|
||||
params.flipH = sprite_->getFlipH();
|
||||
|
||||
return params;
|
||||
}
|
||||
@@ -780,7 +779,7 @@ playerSpawn_t Player::getSpawnParams()
|
||||
// Recarga la textura
|
||||
void Player::reLoadTexture()
|
||||
{
|
||||
sprite->getTexture()->reLoad();
|
||||
sprite_->getTexture()->reLoad();
|
||||
}
|
||||
|
||||
// Recarga la paleta
|
||||
@@ -800,7 +799,7 @@ void Player::reLoadPalette()
|
||||
// Establece el valor de la variable
|
||||
void Player::setRoom(Room *room)
|
||||
{
|
||||
this->room = room;
|
||||
this->room_ = room;
|
||||
}
|
||||
|
||||
// Actualiza los puntos de colisión
|
||||
|
||||
Reference in New Issue
Block a user