data drivin all code sucess
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <SFML/Graphics/Color.hpp>
|
||||
#include <SFML/Graphics/RectangleShape.hpp>
|
||||
#include <SFML/System/Vector2.hpp>
|
||||
#include <SFML/Graphics/CircleShape.hpp>
|
||||
|
||||
enum class CollisionDir { None, Left, Right, Top, Bottom };
|
||||
class Entity;
|
||||
@@ -41,6 +42,10 @@ class Player : public Entity {
|
||||
float gravity;
|
||||
bool m_jumping { false };
|
||||
bool m_dash { false };
|
||||
sf::RectangleShape bounding_box { { 0, 100 } };
|
||||
void initialize_bounding_box();
|
||||
void update_bounding_box();
|
||||
void check_bounding_box(std::array<std::array<Object*, MAX_COLS>, MAX_ROWS> wall_list);
|
||||
void handle_movment(Timer& dash);
|
||||
void handle_gravity();
|
||||
bool get_jumping();
|
||||
@@ -52,7 +57,7 @@ class Player : public Entity {
|
||||
|
||||
private:
|
||||
bool get_vertical_bottom_collision_by_offset(std::array<std::array<Entity*, MAX_COLS>, MAX_ROWS>);
|
||||
sf::Vector2f _min_velocity;
|
||||
sf::Vector2f _min_velocity { 0, 0 };
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user