From 1ac412a5496fb6c63c47f199dfc7facd5f4c080a Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Fri, 20 Jan 2017 10:32:08 -0500 Subject: item drop, pick up --- include/components.hpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'include') 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 #include +#include #include #include #include @@ -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; -- cgit v1.2.3