diff options
Diffstat (limited to 'include/components.hpp')
-rw-r--r-- | include/components.hpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/include/components.hpp b/include/components.hpp index fe56a88..87d4293 100644 --- a/include/components.hpp +++ b/include/components.hpp @@ -98,7 +98,7 @@ struct Physics : public Component { * Constructor that sets the gravity constant, if not specified it becomes 0. * @param g The non default gravity constant. */ - Physics(float g = 1.0f): g(g) {} + Physics(float g = 0.2f): g(g) {} Physics(XMLElement* imp, XMLElement* def) { fromXML(imp, def); } @@ -108,7 +108,7 @@ struct Physics : public Component { void fromXML(XMLElement* imp, XMLElement* def) final { if (imp->QueryFloatAttribute("gravity", &g) != XML_NO_ERROR) { if (def->QueryFloatAttribute("value", &g) != XML_NO_ERROR) - g = 1.0f; + g = 0.2f; } } }; @@ -611,10 +611,11 @@ struct Aggro : public Component { }; struct Hit : public Component { - Hit(int d) - : damage(d) {} + Hit(int d, bool p = false) + : damage(d), pierce(p) {} int damage; + bool pierce; void fromXML(XMLElement* imp, XMLElement* def) final { (void)imp; @@ -622,6 +623,22 @@ struct Hit : public Component { } }; +struct Trigger : public Component { + Trigger(const std::string& t) + : text(t) {} + Trigger(XMLElement* imp, XMLElement* def) { + fromXML(imp, def); + } + + std::string text; + + void fromXML(XMLElement* imp, XMLElement* def) final { + (void)imp; + (void)def; + text = "You got me!"; + } +}; + /** * SYSTEMS */ |