- added debouncing option
- added some gif for presentation
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user