add player moves and test image
This commit is contained in:
18
srcs/draw/player_limits.c
Normal file
18
srcs/draw/player_limits.c
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user