diff options
Diffstat (limited to 'include/item.h')
| -rw-r--r-- | include/item.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/include/item.h b/include/item.h new file mode 100644 index 0000000..7f40c45 --- /dev/null +++ b/include/item.h @@ -0,0 +1,64 @@ + +#ifndef ITEM_H + +#define ITEM_H + +#include "main.h" +#include "interface.h" +#include "list.h" +#include "tux.h" + +typedef struct item_struct +{ + int type; // typ veci + + int x; // poloha veci + int y; + + int w; // rozmery veci + int h; + + int frame; //poradove cislo animacie + int count; + + SDL_Surface *img; //obrazok + +} item_t; + +#define ITEM_MAX_COUNT 3 + +#define ITEM_GUN_MAX_FRAME 8 +#define ITEM_MINE_MAX_FRAME 1 +#define ITEM_EXPLOSION_MAX_FRAME 10 +#define ITEM_BONUS_MAX_FRAME 8 + +#define ITEM_GUN_WIDTH 50 +#define ITEM_GUN_HEIGHT 20 + +#define ITEM_MINE_WIDTH 15 +#define ITEM_MINE_HEIGHT 11 + +#define ITEM_EXPLOSION_WIDTH 40 +#define ITEM_EXPLOSION_HEIGHT 40 + +#define ITEM_BIG_EXPLOSION_WIDTH 100 +#define ITEM_BIG_EXPLOSION_HEIGHT 100 + +#define ITEM_BONUS_WIDTH 20 +#define ITEM_BONUS_HEIGHT 20 + +extern bool_t isItemInicialized(); +extern void initItem(); +extern item_t* newItem(int x, int y, int type); +extern void addNewItem(list_t *listItem); +extern void drawItem(item_t *p); +extern void drawListItem(list_t *listItem); +extern void eventListItem(list_t *listItem); +extern void eventConflictShotWithItem(list_t *listItem, list_t *listShot); +extern int isConflictWithListItem(list_t *listItem, int x, int y, int w, int h); +extern void eventGiveTuxItem(tux_t *tux, list_t *listItem); +extern void destroyItem(item_t *p); +extern void quitItem(); + +#endif + |