Files
42_INT_10_cube3d/srcs/draw/player_limits.c
2022-03-30 13:48:58 +02:00

19 lines
344 B
C

#include "cube3d.h"
void plr_limits(t_game *game, int x, int y)
{
int xmax;
int ymax;
xmax = game->sizel / (game->bpp / 8);
ymax = game->win_size_y;
if (x < 0)
plr_posx_increment(game);
else if (y < 0)
plr_posy_increment(game);
else if (x > xmax)
plr_posx_decrement(game);
else if (y > ymax)
plr_posy_decrement(game);
}