Added controller support
This commit is contained in:
@@ -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
|
// the function setup() is called once when the page is loaded
|
||||||
function setup(){
|
function setup(){
|
||||||
@@ -14,5 +28,5 @@ function draw(){
|
|||||||
background(0,0,0,10);
|
background(0,0,0,10);
|
||||||
|
|
||||||
// draw a circle at the mouse position
|
// draw a circle at the mouse position
|
||||||
circle(mouseX, mouseY, 50);
|
circle(Playerposx, Playerposy, 50);
|
||||||
}
|
}
|
Reference in New Issue
Block a user