There's now a Collision component that determines collision if its set. Closes #72.

This commit is contained in:
Zed A. Shaw 2025-08-06 11:43:39 -04:00
parent 9bf6926dc3
commit fc4eacadb0
6 changed files with 27 additions and 13 deletions

View file

@ -26,6 +26,10 @@ namespace components {
std::shared_ptr<sf::Shader> effect;
};
struct Collision {
bool has = true;
};
struct Position {
Point location{0,0};
Point aiming_at{0,0};
@ -151,6 +155,7 @@ namespace components {
ENROLL_COMPONENT(Animation, scale, simple, frames,
speed, easing, ease_rate, stationary);
ENROLL_COMPONENT(Sound, attack, death);
ENROLL_COMPONENT(Collision, has);
template<typename COMPONENT> COMPONENT convert(nlohmann::json &data) {
COMPONENT result;