RogueLife/src/item.h

29 lines
546 B
C

//---
// items: Dropped objects that can be picked up from the ground
//---
#pragma once
#include "comp/entity.h"
#include "geometry.h"
enum {
ITEM_LIFE = 0,
};
typedef struct {
int type;
union {
/* ITEM_LIFE: Amount of HP restored */
struct { int HP; } life;
};
} item_data_t;
/* Create an item. This is just an AOE with a particular type. */
entity_t *item_make(item_data_t const *data, vec2 position);
/* Give an item to a player entity. */
void item_pick_up(item_data_t const *data, entity_t *player);