-
Notifications
You must be signed in to change notification settings - Fork 0
/
hooks.c
48 lines (44 loc) · 1.42 KB
/
hooks.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
46
47
48
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* hooks.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: zbabahmi <zbabahmi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/05 06:43:38 by zbabahmi #+# #+# */
/* Updated: 2023/04/14 01:17:43 by zbabahmi ### ########.fr */
/* */
/* ************************************************************************** */
#include "so_long.h"
int print_mouves(int k, t_savage *criminal)
{
t_dim player_pos;
t_dim wanted_pos;
char next_pos;
next_pos = '\0';
player_pos = get_player_position(criminal);
if (k == 13)
{
up(criminal, &player_pos, &wanted_pos, next_pos);
}
if (k == 0)
{
left(criminal, player_pos, wanted_pos, next_pos);
}
if (k == 1)
{
down(criminal, player_pos, wanted_pos, next_pos);
}
if (k == 2)
{
right(criminal, player_pos, wanted_pos, next_pos);
}
if (k == 53)
exit (0);
return (0);
}
int ft_exit(void)
{
exit (0);
return (0);
}