initial commit
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ie3b66d17f6f660c9b9a719210bd86f9f6a6a6964
This commit is contained in:
commit
b381e2efbd
29 changed files with 1633 additions and 0 deletions
28
src/player.h
Normal file
28
src/player.h
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#ifndef PLAYER_H
|
||||
#define PLAYER_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
// Initialize player at position
|
||||
void player_init(Player *p, int x, int y);
|
||||
|
||||
// Move player, return 1 if moved/attacked, 0 if blocked
|
||||
int player_move(Player *p, int dx, int dy, Map *map, Enemy *enemies,
|
||||
int enemy_count, Item *items, int item_count);
|
||||
|
||||
// Player attacks enemy (deal damage)
|
||||
void player_attack(Player *p, Enemy *e);
|
||||
|
||||
// Pick up item
|
||||
void player_pickup(Player *p, Item *i);
|
||||
|
||||
// Use item
|
||||
void player_use_item(Player *p, Item *i);
|
||||
|
||||
// Use first available item in inventory, return 1 if used
|
||||
int player_use_first_item(Player *p);
|
||||
|
||||
// Get item at inventory index, returns NULL if invalid
|
||||
Item *player_get_inventory_item(Player *p, int index);
|
||||
|
||||
#endif // PLAYER_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue