Files
engine/include/elements.hpp
T
2025-10-16 21:27:07 -04:00

37 lines
944 B
C++

#ifndef PLAYER_HPP
#define PLAYER_HPP
#include <SFML/Graphics/RectangleShape.hpp>
#include <SFML/System/Vector2.hpp>
class Entity {
public:
Entity(sf::Vector2<float> size, sf::Vector2<float> starting_position, float thickness, sf::Color inside_color, sf::Color border_color);
bool find_intersection(Entity &entity);
sf::RectangleShape rect;
protected:
sf::Color inside_color;
sf::Color border_color;
float top_left;
float bottom_left;
float top_right;
float bottom_right;
float border_thickness;
};
class Player : public Entity {
public:
Player(sf::Vector2<float> size, sf::Vector2<float> starting_position, float acceleration, float initial_acceleration, float thickness, float velocity_x, sf::Color inside_color, sf::Color border_color);
sf::Vector2<float> m_velocity;
float m_acceleration;
float m_jump_strength;
bool m_jumping;
void handle_movment();
sf::Vector2<float> get_velocity();
bool get_jumping();
};
#endif