Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : Problems with Audio Files

$
0
0
You call startStory() if keyPressed AND key is space (only if both conditions are met). So in startStory(), there is no point in checking if key can be 1, it will never be.
Beside, you better use keyPressed(), the function, and manage global variables (boolean, current story, etc.) from the tests here, that you can test in your functions.
Don't forget that draw() is called 60 times per second (by default), so keyPressed is checked several times each time the user presses a key. The variable shows the current state while the function is triggered only once per action.

Viewing all articles
Browse latest Browse all 1768

Trending Articles