Updated webdev
This commit is contained in:
@@ -70,7 +70,9 @@ async function disconnect() {
|
||||
|
||||
let Playerposx = 500;
|
||||
let Playerposy = 300;
|
||||
|
||||
let bullets = [];
|
||||
let myBullet = new bullet();
|
||||
let playerSpeed = 5;
|
||||
|
||||
|
||||
async function Movementloop() {
|
||||
@@ -83,6 +85,20 @@ if (booleanArray[2]) {
|
||||
if (booleanArray[0]) {
|
||||
Playerposy -= 2;}
|
||||
}
|
||||
function keyPressed() {
|
||||
if (keyIsDown(LEFT_ARROW) && playerPosX > 0 + radius) {
|
||||
playerPosX -= playerSpeed;
|
||||
}
|
||||
if (keyIsDown(RIGHT_ARROW) && playerPosX < width - radius) {
|
||||
playerPosX += playerSpeed;
|
||||
}
|
||||
if (keyIsDown(UP_ARROW) && playerPosY > 0 + radius) {
|
||||
playerPosY -= playerSpeed;
|
||||
}
|
||||
if (keyIsDown(DOWN_ARROW) && playerPosY < height - radius) {
|
||||
playerPosY += playerSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// the function setup() is called once when the page is loaded
|
||||
|
Reference in New Issue
Block a user