-
Notifications
You must be signed in to change notification settings - Fork 0
/
keys_2.c
45 lines (40 loc) · 1.58 KB
/
keys_2.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* keys_2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ofadhel <ofadhel@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/24 22:30:36 by ofadhel #+# #+# */
/* Updated: 2023/04/24 22:34:18 by ofadhel ### ########.fr */
/* */
/* ************************************************************************** */
#include "solong.h"
void up_coin(t_game *game)
{
game->map[game->player_y][game->player_x] = '0';
game->map[game->player_y - 1][game->player_x] = 'P';
game->player_y--;
game->coin_count--;
}
void down_coin(t_game *game)
{
game->map[game->player_y][game->player_x] = '0';
game->map[game->player_y + 1][game->player_x] = 'P';
game->player_y++;
game->coin_count--;
}
void right_coin(t_game *game)
{
game->map[game->player_y][game->player_x] = '0';
game->map[game->player_y][game->player_x + 1] = 'P';
game->player_x++;
game->coin_count--;
}
void left_coin(t_game *game)
{
game->map[game->player_y][game->player_x] = '0';
game->map[game->player_y][game->player_x - 1] = 'P';
game->player_x--;
game->coin_count--;
}