- added debouncing option

- added some gif for presentation
This commit is contained in:
asus
2024-01-19 20:09:21 +01:00
parent 60b4a82489
commit 211204e888
8 changed files with 40 additions and 15 deletions

View File

@@ -30,4 +30,7 @@
# include "cube3d_proto.h"
# include "get_next_line.h"
# include <time.h> // for time
# include <sys/time.h> // for gettimeofday
#endif

View File

@@ -18,7 +18,7 @@
*/
/* nbr pixel player move */
# define PLR_MV 4
# define PLR_MV 10
/* degree of rotation of the player per press */
# define PLR_ROT 1
/* nbr key you can press at the same time */
@@ -33,10 +33,9 @@
# define SCREEN_FOCAL 70
/* size of a cell on the map */
# define CELL 100
// minimum time in milliseconds between two keypress
# define DEBOUNCE_TIME 500
/*
* keys macro
*/
/*
* keys macro

View File

@@ -162,15 +162,16 @@ typedef struct s_plr
typedef struct s_game
{
void *mlx_ptr;
t_win win;
t_img img;
t_plr plr;
t_rcast rcast;
t_txt txt;
t_map map;
int fd;
int k_hook[MAX_NB_KEY];
void *mlx_ptr;
t_win win;
t_img img;
t_plr plr;
t_rcast rcast;
t_txt txt;
t_map map;
int fd;
int k_hook[MAX_NB_KEY];
struct timeval last_keypress_time;
} t_game;
#endif