-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_key_pressed.c
43 lines (40 loc) · 1.41 KB
/
ft_key_pressed.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_key_pressed.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: atabiti <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/20 08:51:47 by atabiti #+# #+# */
/* Updated: 2022/03/25 11:42:29 by atabiti ### ########.fr */
/* */
/* ************************************************************************** */
#include "so_long.h"
int ft_key_s(int key, struct s_s2 *a)
{
if (key == 1)
{
if (a->exactarray[a->y_p + 1][a->x_p] != '1')
{
a->collects = check_collectible_down(a, a->collects);
deal_key5(a, a->collects);
ft_printer(a->ft_movements);
}
else
return (0);
}
return (0);
}
int ft_key_d(int key, struct s_s2 *a)
{
if (key == 2)
{
if (a->exactarray[a->y_p][a->x_p + 1] != '1')
{
a->collects = check_collectible_right(a, a->collects);
deal_key2(a, a->collects);
ft_printer(a->ft_movements);
}
}
return (0);
}