fix compilation bugs
This commit is contained in:
parent
a2b0736329
commit
6501d06447
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -15,29 +15,29 @@ void analyze_input(struct game *game, const int last_key)
|
|||
|
||||
case KEY_UP:
|
||||
game->player.direction = UP;
|
||||
game->player.map_y -= 2;
|
||||
game->player.y -= 2;
|
||||
break;
|
||||
|
||||
case KEY_RIGHT:
|
||||
game->player.direction = RIGHT;
|
||||
game->player.map_x += 2;
|
||||
game->player.x += 2;
|
||||
break;
|
||||
|
||||
case KEY_DOWN:
|
||||
game->player.direction = DOWN;
|
||||
game->player.map_y += 2;
|
||||
game->player.y += 2;
|
||||
break;
|
||||
|
||||
case KEY_LEFT:
|
||||
game->player.direction = LEFT;
|
||||
game->player.map_x -= 2;
|
||||
game->player.x -= 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int rtc_key(void)
|
||||
{
|
||||
int opt = GETKEY_DEFAULT & ~GETKEY_MOD_SHIFT & ~GETKEY_MOD_ALPHA;
|
||||
int opt = GETKEY_DEFAULT & ~GETKEY_MOD_SHIFT & ~GETKEY_MOD_ALPHA & ~GETKEY_REP_ARROWS;
|
||||
int timeout = 1;
|
||||
|
||||
key_event_t ev = getkey_opt(opt, &timeout);
|
||||
|
|
|
@ -26,5 +26,5 @@ void draw_player(const struct game game)
|
|||
{
|
||||
extern const bopti_image_t img_player;
|
||||
|
||||
dsubimage(game.player.map_x, game.player.map_y, &img_player, 9 * game.player.animation_frame, 13 * game.player.direction, 8, 12, DIMAGE_NONE);
|
||||
dsubimage(game.player.x, game.player.y, &img_player, 9 * game.player.animation_frame, 13 * game.player.direction, 8, 12, DIMAGE_NONE);
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ void main_loop(void)
|
|||
if (t >= 0) timer_start(t);
|
||||
|
||||
struct player player = {8, 0, 2, 0};
|
||||
struct game game = {0, 0, map_one, player, 0};
|
||||
struct game game = {map_one, 0, 0, player, 0};
|
||||
|
||||
while (key != KEY_EXIT)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue