#pragma once #include #include #include "platform.hpp" class Player { sf::RectangleShape shape; float speed; float velocityY; float jumpStrength; bool onGround; float gravity; float groundLevel; bool facingRight; std::vector runFrames; sf::Texture idleFrame; sf::Sprite sprite; size_t currentFrame; float animationTimer; float animationSpeed; bool isMoving; void loadRunAnimation(); void loadIdleFrame(); public: Player(); void update(float deltaTime, const std::vector& platforms); void draw(sf::RenderWindow& window); // Геттери sf::RectangleShape& getShape() { return shape; } float getVelocityY() const { return velocityY; } bool isOnGround() const { return onGround; } // Сеттери void setPosition(const sf::Vector2f& pos) { shape.setPosition(pos); } void setVelocityY(float v) { velocityY = v; } void setOnGround(bool val) { onGround = val; } bool isFacingRight() const { return facingRight; } };