I need to change my collision and movement physics engine entirely

This commit is contained in:
Andrew Haynes Macbook
2026-01-26 21:38:09 -05:00
parent ef6a5bf507
commit 1ff8d450c4
11 changed files with 177 additions and 216 deletions
+14 -14
View File
@@ -13,7 +13,6 @@
#include <SFML/Graphics/Color.hpp>
#include <SFML/System/Vector2.hpp>
#include <array>
#include <string>
#include <vector>
@@ -21,34 +20,35 @@
struct ObjectData
{
sf::Vector2<float> size { TILESIZE, TILESIZE };
sf::Vector2<float> pos { TILESIZE, TILESIZE };
sf::Color interior_color { sf::Color::Black };
sf::Color exterior_color { sf::Color::White };
float edge { -2.0f };
const sf::Vector2<float> size { TILESIZE, TILESIZE };
const sf::Vector2<float> pos { TILESIZE, TILESIZE };
const sf::Color interior_color { sf::Color::Black };
const sf::Color exterior_color { sf::Color::White };
const float edge { -2.0f };
};
struct EntityData : ObjectData
struct EntityData
{
sf::Vector2<float> velocity { 0, 0 };
ObjectData object;
const sf::Vector2<float> velocity { 0, 0 };
};
struct PlayerData : EntityData
struct PlayerData
{
float max_dash_acceleration { 0.0f };
float max_vertical_acceleration { 0.0f };
EntityData entity;
const float max_dash_acceleration { 0.0f };
const float max_vertical_acceleration { 0.0f };
};
struct LevelData
{
// std::array<std::array<char, MAX_COLS>, MAX_ROWS> data {};
const char data[MAX_ROWS][MAX_COLS + 1];
};
struct TimerData
{
std::string name { "NULL" };
float max_time { 1.f };
const std::string name { "NULL" };
const float max_time { 1.f };
};
extern const std::vector<ObjectData> object_data;