-
Notifications
You must be signed in to change notification settings - Fork 0
/
my_core.c
52 lines (48 loc) · 1.04 KB
/
my_core.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
49
50
51
52
/*
** EPITECH PROJECT, 2017
** my_core.c
** File description:
**
*/
void server_core()
{
while (GAME.local.touch < 14 && GAME.remote.touch < 14) {
GAME.local.impact = get_input();
// check_input(GAME.local.impact);
usleep(100);
my_send();
get_result();
usleep(100);
GAME.remote.impact.x = 64;
GAME.remote.impact.y = 48;
my_putstr("\nwaiting for enemy's attack...\n");
recieve_shot();
check_input(GAME.remote.impact);
manage_view_s();
}
}
void client_core()
{
// t_coord shot;
// shot = get_input();
// check_input(shot);
// manage_view_s;
while (GAME.local.touch < 14 && GAME.remote.touch < 14) {
usleep(100);
GAME.remote.impact.x = 64;
GAME.remote.impact.y = 48;
my_putstr("\nwaiting for enemy's attack...\n");
recieve_shot();
check_input(GAME.remote.impact);
// my_put_nbr(GAME.remote.impact.x);
// my_putchar('\n');
// my_put_nbr(GAME.remote.impact.y);
GAME.local.impact = get_input();
// check_input(GAME.local.impact);
usleep(100);
my_putchar('d');
my_send();
get_result();
manage_view_s();
}
}