Files
2026-05-19 22:35:10 +02:00

28 lines
1.0 KiB
C++

#pragma once
#include <object/entity.hpp>
#include <renderer/texture.hpp>
#include <renderer/font.hpp>
#include <object/sound.hpp>
namespace Game::AGame {
GAME_ENTITY(Player)
public:
void setShipTexture(std::shared_ptr<Game::Renderer::Texture> tex);
void setGroundTexture(std::shared_ptr<Game::Renderer::Texture> tex);
void respawnRandomSea(float landBoundaryX);
bool isShipMode() const { return mIsShipMode; }
void setShipMode(bool isShip) { mIsShipMode = isShip; } // Set form state for replay
void onCollisionEnter(Object::Entity* other) override;
private:
Object::Sound mSound;
float mSpeed = 200.f; // Pixels per second
[[maybe_unused]] float mHealth = 100.f;
std::shared_ptr<Game::Renderer::Texture> mShipTex;
std::shared_ptr<Game::Renderer::Texture> mGroundTex;
bool mIsShipMode = true;
float mShoreMargin = 40.f;
float mStateTransitionCooldown = 1.f;
float mStateTransitionCooldownTimer = 0.f;
END_GAME_ENTITY()
}