From c451982e2132746959e3ca0d89f9cf502594a244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1ndly=20Gerg=C5=91?= Date: Sat, 7 May 2022 16:57:05 +0300 Subject: [PATCH] Allow pausing the software on click --- AIPathFinder.pde | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/AIPathFinder.pde b/AIPathFinder.pde index a9599cc..e2600dc 100644 --- a/AIPathFinder.pde +++ b/AIPathFinder.pde @@ -1,6 +1,7 @@ PVector goal; Obstacles obstacles; Genetic AI; +boolean pause = false; void setup(){ size(800, 800); @@ -18,6 +19,10 @@ void setup(){ } void draw(){ + if(pause) { + return; + } + background(255); //draw goal @@ -46,5 +51,5 @@ void draw(){ } void mouseClicked(){ - AI.toggleDisplay(); + pause = !pause; }