forked from NotAShelf/rogged
movement: generalize; use vectors (#16)
Generalized movement, so that all entities move the same. Reviewed-on: NotAShelf/rogged#16 Reviewed-by: raf <raf@notashelf.dev> Co-authored-by: Squirrel Modeller <squirrelmodeller@protonmail.com> Co-committed-by: Squirrel Modeller <squirrelmodeller@protonmail.com>
This commit is contained in:
parent
1d738c35d4
commit
4dfe52ae72
9 changed files with 124 additions and 89 deletions
|
|
@ -6,8 +6,8 @@
|
|||
// Initialize player at position
|
||||
void player_init(Player *p, int x, int y);
|
||||
|
||||
// Move player to (x+dx, y+dy); returns 1 if moved, 0 if blocked
|
||||
int player_move(Player *p, int dx, int dy, Map *map);
|
||||
// Apply status effects, healing, etc
|
||||
void player_on_move(Player *p);
|
||||
|
||||
// Find a living enemy at tile (x, y); returns NULL if none
|
||||
Enemy *player_find_enemy_at(Enemy *enemies, int count, int x, int y);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue