Added controller support

This commit is contained in:
sam
2023-11-24 11:47:35 +01:00
parent 5f44cd1450
commit 3a3ac9390d

View File

@@ -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);
}