start project with header, struct, mlx functionnal, and basic key event action
This commit is contained in:
41
srcs/hook/key_is_action_1.c
Normal file
41
srcs/hook/key_is_action_1.c
Normal file
@@ -0,0 +1,41 @@
|
||||
#include "cube3d.h"
|
||||
|
||||
int is_esc(int *k_hook)
|
||||
{
|
||||
if (!ft_arrintchr(k_hook, KEY_ESC, 3))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int is_go_left(int *k_hook)
|
||||
{
|
||||
if (!ft_arrintchr(k_hook, KEY_A, 3))
|
||||
return 1;
|
||||
if (!ft_arrintchr(k_hook, KEY_Q, 3))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int is_go_right(int *k_hook)
|
||||
{
|
||||
if (!ft_arrintchr(k_hook, KEY_D, 3))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int is_go_forward(int *k_hook)
|
||||
{
|
||||
if (!ft_arrintchr(k_hook, KEY_W, 3))
|
||||
return 1;
|
||||
if (!ft_arrintchr(k_hook, KEY_Z, 3))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int is_go_backward(int *k_hook)
|
||||
{
|
||||
if (!ft_arrintchr(k_hook, KEY_S, 3))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user