-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcub3d_player_collusion.c
executable file
·31 lines (28 loc) · 1.26 KB
/
cub3d_player_collusion.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* cub3d_player_collusion.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mg <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/10/06 12:50:56 by mg #+# #+# */
/* Updated: 2020/10/06 16:11:21 by mg ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub3d.h"
int c3d_player_wall_collusion(t_param *cub3d, int x, int y)
{
if (cub3d->map.grid
[(int)(y / cub3d->map.tile_size)]
[(int)(x / cub3d->map.tile_size)] == 1)
return (1);
return (0);
}
int c3d_player_sprite_collusion(t_param *cub3d, int x, int y)
{
if (cub3d->map.grid
[(int)(y / cub3d->map.tile_size)]
[(int)(x / cub3d->map.tile_size)] == 2)
return (1);
return (0);
}