aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/inventory.hpp22
-rw-r--r--include/particle.hpp16
-rw-r--r--include/weather.hpp2
3 files changed, 23 insertions, 17 deletions
diff --git a/include/inventory.hpp b/include/inventory.hpp
index fa24de4..15877e9 100644
--- a/include/inventory.hpp
+++ b/include/inventory.hpp
@@ -6,30 +6,36 @@
#include <components.hpp>
#include <events.hpp>
-struct Item {
- GLuint icon;
+struct InventoryEntry {
+ GLuint icon;
+ std::string name;
+ std::string type;
+
+ int count;
+ int max;
+ vec2 loc;
};
-using InventoryEntry = std::pair<Item, unsigned int>;
-
class InventorySystem : public entityx::System<InventorySystem>, public entityx::Receiver<InventorySystem> {
private:
entityx::Entity currentItemEntity;
std::vector<InventoryEntry> items;
- unsigned int maxItemCount;
public:
- InventorySystem(unsigned int mic = 1)
- : maxItemCount(mic) {}
+ InventorySystem(int size = 4) {
+ items.resize(size);
+ loadItems();
+ }
void configure(entityx::EventManager &ev);
- void loadIcons(void);
+ void loadItems(void);
void update(entityx::EntityManager &en, entityx::EventManager &ev, entityx::TimeDelta dt) override;
void receive(const KeyDownEvent &kde);
+ void render(void);
};
#endif // INVENTORY_HPP_
diff --git a/include/particle.hpp b/include/particle.hpp
index 92ab7e4..55228c0 100644
--- a/include/particle.hpp
+++ b/include/particle.hpp
@@ -9,22 +9,22 @@
#include <entityx/entityx.h>
enum class ParticleType : char {
- Drop,
- Confetti,
- SmallBlast,
- SmallPoof
+ Drop = 1,
+ Confetti = 2,
+ SmallBlast = 4,
+ SmallPoof = 8
};
struct Particle {
- vec2 location;
+ int timeLeft;
vec2 velocity;
+ vec2 location;
ParticleType type;
- int timeLeft;
vec2 color; // assets/colorIndex.png
Particle(vec2 p, ParticleType t, int tl, vec2 c)
- : location(p), type(t), timeLeft(tl), color(c) {}
-};// __attribute__ ((packed));
+ : timeLeft(tl), location(p), type(t), color(c) {}
+};
class ParticleSystem : public entityx::System<ParticleSystem> {
private:
diff --git a/include/weather.hpp b/include/weather.hpp
index 0820871..8e148dd 100644
--- a/include/weather.hpp
+++ b/include/weather.hpp
@@ -56,7 +56,7 @@ public:
newPartDelay = 0;
partSystem.add(vec2(offset.x - game::SCREEN_WIDTH + randGet() % game::SCREEN_WIDTH * 2,
offset.y + game::SCREEN_HEIGHT / 2 + 50),
- ParticleType::Confetti, 6000, 0);
+ ParticleType::Confetti, 10000, 0);
}
break;
default: