forked from jaildesigner-jailgames/jaildoctors_dilemma
fix: en windows no es calculaven be les colisions
This commit is contained in:
@@ -40,7 +40,7 @@ Game::Game(GameMode mode)
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
Debug::get()->setEnabled(true);
|
Debug::get()->setEnabled(false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Crea objetos e inicializa variables
|
// Crea objetos e inicializa variables
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ void Player::move()
|
|||||||
proj.x = static_cast<int>(x_ + vx_);
|
proj.x = static_cast<int>(x_ + vx_);
|
||||||
proj.y = static_cast<int>(y_);
|
proj.y = static_cast<int>(y_);
|
||||||
proj.h = HEIGHT_;
|
proj.h = HEIGHT_;
|
||||||
proj.w = ceil(abs(vx_)); // Para evitar que tenga un ancho de 0 pixels
|
proj.w = static_cast<int>(std::ceil(std::fabs(vx_))); // Para evitar que tenga un ancho de 0 pixels
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
debug_rect_x_ = proj;
|
debug_rect_x_ = proj;
|
||||||
@@ -376,7 +376,7 @@ void Player::move()
|
|||||||
SDL_Rect proj;
|
SDL_Rect proj;
|
||||||
proj.x = static_cast<int>(x_);
|
proj.x = static_cast<int>(x_);
|
||||||
proj.y = static_cast<int>(y_ + vy_);
|
proj.y = static_cast<int>(y_ + vy_);
|
||||||
proj.h = ceil(abs(vy_)); // Para evitar que tenga una altura de 0 pixels
|
proj.h = static_cast<int>(std::ceil(std::fabs(vy_))); // Para evitar que tenga una altura de 0 pixels
|
||||||
proj.w = WIDTH_;
|
proj.w = WIDTH_;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|||||||
Reference in New Issue
Block a user