something changed

This commit is contained in:
DarthMooMancer
2025-10-19 02:56:17 -04:00
parent d384dff919
commit 023b638e54
3 changed files with 70 additions and 60 deletions
+7 -5
View File
@@ -5,16 +5,19 @@
#include <SFML/Graphics/RectangleShape.hpp>
#include <SFML/System/Vector2.hpp>
enum class CollisionDir { None, Left, Right, Top, Bottom };
class Entity {
public:
Entity(sf::Vector2<float> size, sf::Vector2<float> starting_position, sf::Vector2f initial_velocity, float thickness, sf::Color inside_color, sf::Color border_color = sf::Color::White);
Entity(sf::Vector2<float> size, sf::Vector2<float> pos, sf::Vector2f velocity, float border_thickness, sf::Color inside_color = sf::Color::Black, sf::Color border_color = sf::Color::White);
CollisionDir find_intersection(Entity &entity);
sf::Vector2f velocity;
void set_velocity(sf::Vector2f velocity);
void set_velocity_x(int velocity);
void set_velocity_y(int velocity);
sf::Vector2<float> get_velocity();
sf::RectangleShape rect;
protected:
sf::Vector2f _velocity;
sf::Color _inside_color;
sf::Color _border_color;
float _border_thickness;
@@ -22,12 +25,11 @@ protected:
class Player : public Entity {
public:
Player(sf::Vector2<float> size, sf::Vector2<float> starting_position, float acceleration, float initial_acceleration, float thickness, sf::Vector2f initial_velocity, sf::Color inside_color, sf::Color border_color = sf::Color::White);
Player(sf::Vector2<float> size, sf::Vector2<float> pos, sf::Vector2f velocity, float border_thickness, float gravity, float max_acceleration, sf::Color inside_color, sf::Color border_color);
float m_acceleration;
float m_jump_strength;
bool m_jumping;
void handle_movment();
sf::Vector2<float> get_velocity();
bool get_jumping();
};