add player moves and test image

This commit is contained in:
Hugo LAMY
2022-03-30 12:55:39 +02:00
parent f645da7885
commit 08f7b89d82
10 changed files with 109 additions and 223 deletions

18
srcs/draw/player_limits.c Normal file
View File

@@ -0,0 +1,18 @@
#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);
}