u8g2-copy/sys/sdl/gm2/item.h

38 lines
681 B
C
Raw Normal View History

2017-07-14 19:52:01 +08:00
/*
item.h
*/
#ifndef _ITEM_H
#define _ITEM_H
#include <stdint.h>
2017-07-15 15:09:08 +08:00
struct _pos_struct
2017-07-14 19:52:01 +08:00
{
uint8_t x;
2017-07-15 15:09:08 +08:00
uint8_t y;
};
typedef struct _pos_struct pos_t;
struct _item_struct
{
pos_t pos;
uint8_t dir; /* movement has two parts: 1. dir is set, then 2. dir is executed */
2017-07-14 19:52:01 +08:00
uint8_t tile; /* current foreground tile, defaults to the value from the template list */
uint8_t template_index; /* index into item_template_list[] */
};
typedef struct _item_struct item_t;
2017-07-15 15:09:08 +08:00
void posStep(pos_t *pos, uint8_t dir);
void moveAllItems(void);
uint8_t getMapTileByPos(pos_t *pos);
2017-07-14 19:52:01 +08:00
void setupLevel(uint8_t level);
uint8_t getMapTile(uint8_t x, uint8_t y);
#endif /* _ITEM_H */