diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2017-01-20 10:32:08 -0500 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2017-01-20 10:32:08 -0500 |
commit | 1ac412a5496fb6c63c47f199dfc7facd5f4c080a (patch) | |
tree | de51badd136251a8034e1c91fec1fb06b236a96a /include | |
parent | df22618e71ceeb73d3f4c6b8f74d9c07fce3ccea (diff) |
item drop, pick up
Diffstat (limited to 'include')
-rw-r--r-- | include/components.hpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/include/components.hpp b/include/components.hpp index 449f7c3..5292fb2 100644 --- a/include/components.hpp +++ b/include/components.hpp @@ -12,6 +12,7 @@ #include <vector> #include <events.hpp> +#include <inventory.hpp> #include <random.hpp> #include <texture.hpp> #include <vector2.hpp> @@ -64,7 +65,7 @@ struct Physics { * Constructor that sets the gravity constant, if not specified it becomes 0. * @param g The non default gravity constant. */ - Physics(float g = 0.0f): g(g) {} + Physics(float g = 1.0f): g(g) {} float g; /**< The gravity constant, how fast the object falls */ }; @@ -105,6 +106,13 @@ struct Name { std::string name; }; +struct ItemDrop { + ItemDrop(InventoryEntry& ie) + : item(ie) {} + + InventoryEntry item; +}; + /** * @struct Solid * @brief Allows an entity to collide with other objects. @@ -154,6 +162,14 @@ struct SpriteData { offset_tex.y = offset.y/tmpsize.y; } + SpriteData(Texture t) + : tex(t) { + size_tex = 1; + offset_tex = 0; + size = tex.getDim(); + offset = 0; + } + Texture tex; vec2 size; vec2 offset; |