From 3a3ac9390dc4d8db4aea77bc985ffc3bb3693eb7 Mon Sep 17 00:00:00 2001 From: sam Date: Fri, 24 Nov 2023 11:47:35 +0100 Subject: [PATCH] Added controller support --- webdev/web/game.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/webdev/web/game.js b/webdev/web/game.js index b33f57c..eb3c7a1 100644 --- a/webdev/web/game.js +++ b/webdev/web/game.js @@ -1,3 +1,17 @@ +let Playerposx = 500; +let Playerposy = 300; + +if (booleanArray) { + if (booleanArray[1]) { + Playerposx += 1;} + if (booleanArray[3]) { + Playerposx -= 1;} + if (booleanArray[0]) { + Playerposy += 1;} + if (booleanArray[2]) { + Playerposy -= 1;} + +} // the function setup() is called once when the page is loaded function setup(){ @@ -14,5 +28,5 @@ function draw(){ background(0,0,0,10); // draw a circle at the mouse position - circle(mouseX, mouseY, 50); + circle(Playerposx, Playerposy, 50); } \ No newline at end of file