something changed
This commit is contained in:
@@ -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();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user