data drivin all code sucess

This commit is contained in:
Andrew Haynes Macbook
2026-01-16 15:03:16 -05:00
parent 7bbf50b581
commit 06d3f27b1e
13 changed files with 358 additions and 115 deletions
+6 -1
View File
@@ -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