Allow pausing the software on click

This commit is contained in:
Fándly Gergő 2022-05-07 16:57:05 +03:00
parent 06f13c4745
commit c451982e21

View File

@ -1,6 +1,7 @@
PVector goal; PVector goal;
Obstacles obstacles; Obstacles obstacles;
Genetic AI; Genetic AI;
boolean pause = false;
void setup(){ void setup(){
size(800, 800); size(800, 800);
@ -18,6 +19,10 @@ void setup(){
} }
void draw(){ void draw(){
if(pause) {
return;
}
background(255); background(255);
//draw goal //draw goal
@ -46,5 +51,5 @@ void draw(){
} }
void mouseClicked(){ void mouseClicked(){
AI.toggleDisplay(); pause = !pause;
} }