migrades portes i plataformes a solidActor

This commit is contained in:
2026-04-11 12:54:54 +02:00
parent 49f6ed41e6
commit 5b2f986d32
22 changed files with 686 additions and 286 deletions

View File

@@ -12,6 +12,7 @@
#include "game/options.hpp" // Para Cheat, Options
#include "utils/defines.hpp" // Para PlayArea, Tile, Flip
struct JA_Sound_t;
class SolidActor;
class Player {
public:
@@ -72,8 +73,6 @@ class Player {
void setRoom(std::shared_ptr<Room> room) { room_ = std::move(room); }
[[nodiscard]] auto isAlive() const -> bool { return is_alive_; }
[[nodiscard]] auto getVY() const -> float { return vy_; }
void applyPlatformDisplacement(float dx, float surface_y);
void clearPlatformFlag() { on_platform_ = false; }
void setPaused(bool value) { is_paused_ = value; }
void setIgnoreInput(bool value) { ignore_input_ = value; }
@@ -119,7 +118,7 @@ class Player {
bool is_alive_ = true;
bool is_paused_ = false;
bool ignore_input_ = false;
bool on_platform_ = false;
SolidActor* current_carrier_ = nullptr; // Actor con CARRY_ON_TOP sobre el que estamos de pie
bool turning_ = false;
Direction facing_ = Direction::RIGHT;
Room::Border border_ = Room::Border::TOP;
@@ -134,8 +133,11 @@ class Player {
void updateVelocity(float delta_time);
void applyGravity(float delta_time);
void handleJumpAndDrop();
[[nodiscard]] auto stuckAgainstWall() const -> bool;
void moveHorizontal(float delta_time);
void moveVertical(float delta_time);
void moveVerticalUp(float displacement);
void moveVerticalDown(float displacement);
void followSlope();
void exitSlope();
void detectSlopeEntry();