aboutsummaryrefslogtreecommitdiffstats
path: root/include/components.hpp
diff options
context:
space:
mode:
authordrumsetmonkey <abelleisle@roadrunner.com>2017-04-27 21:33:13 -0400
committerdrumsetmonkey <abelleisle@roadrunner.com>2017-04-27 21:33:13 -0400
commit2de1af94cfa794ae5dd7913c797d673b58289949 (patch)
tree3acb4e822943efb714ff04d4e88307127e34f52e /include/components.hpp
parent40f2ab396ccca1a12cc74d18c9758da5bc2f1afc (diff)
parent00de7a4b0aa48c3cb42c45e0f203902ca034b94c (diff)
Updated sprites
Diffstat (limited to 'include/components.hpp')
-rw-r--r--include/components.hpp25
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
*/