11 int move_player(struct pos
* playerpos
, enum tile
* map
, enum dir direction
)
15 if(playerpos
->x
> 0 &&
16 get_tile(map
, playerpos
->y
, playerpos
->x
- 1) == TILE_FLAT
) {
22 if((playerpos
->y
< 15) &&
23 get_tile(map
, playerpos
->y
+ 1, playerpos
->x
) == TILE_FLAT
) {
29 if(playerpos
->y
> 0 &&
30 get_tile(map
, playerpos
->y
- 1, playerpos
->x
) == TILE_FLAT
) {
36 if(playerpos
->x
< 15 &&
37 get_tile(map
, playerpos
->y
, playerpos
->x
+ 1) == TILE_FLAT
) {
46 int step(enum tile
* map
, struct pos
* playerpos
, int input
)
50 move_player(playerpos
, map
, LEFT
);
53 move_player(playerpos
, map
, DOWN
);
56 move_player(playerpos
, map
, UP
);
59 move_player(playerpos
, map
, RIGHT
);