start/stop/pause processing?
in
Programming Questions
•
6 months ago
i am writing a program for a ping pong game which pauses/starts/stops the ball bouncing when the key 's' is pressed... i.e press 's', the game stops/pauses. by pressing 's' again the game continues. so far im using a boolean statement which pauses the game ok but how do i get it to continue when i press 's' again?
so far this is roughly what i have:
boolean matched = true;
void draw()
{
if (matched = true)
{
do this
}
}
void keyPressed()
{
if (key == 's')
{
matched = false;
xDirection = 0;
yDirection = 0;
}
}
1