|
|
I'm trying to make my character jump when espace key is pressed. |
if (event.idata1 == GLFW_KEY_ESCAPE)
you're checking for a key event for the key escapef (event.idata1 == GLFW_KEY_SPACE && event.idata3 == GLFW_PRESS
if (GLFW_KEY_SPACE == GLFW_RELEASE)
|
|
|
|
if (event.idata1 == GLFW_KEY_SPACE && event.idata3 == GLFW_PRESS)
event.indata1
is an int key and that event.indata3
is an int action
|
|
int GLFW_KEY_SPACE
is equal to 32
and GLFW_RELEASE
is equal to 0
, so you will never satisfy the conditions for that if statement.
|
|
|
|
|
|
(0, 0) (1, 0.902) (2, 1.706) (3, 2.412) (4, 3.02) (5, 3.53) (6, 3.942) (7, 4.256) (8, 4.472) (9, 4.59) (10, 4.61) (11, 4.532) (12, 4.356) (13, 4.082) (14, 3.71) (15, 3.24) (16, 2.672) (17, 2.006) (18, 1.242) (19, 0.38) (20, 0) // landed! |