deleted square
This commit is contained in:
20
web/game.js
20
web/game.js
@@ -10,9 +10,7 @@ let playerPosX = 500
|
|||||||
let playerPosY = 300;
|
let playerPosY = 300;
|
||||||
let playerSpeed = 3;
|
let playerSpeed = 3;
|
||||||
let booleanArray = window.booleanArray;
|
let booleanArray = window.booleanArray;
|
||||||
// let squareX = 100;
|
|
||||||
// let squareY = 100;
|
|
||||||
// const squareSize = 100;
|
|
||||||
|
|
||||||
let shotSpeed = 5;
|
let shotSpeed = 5;
|
||||||
let projectile;
|
let projectile;
|
||||||
@@ -76,18 +74,6 @@ async function Movementloop() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// function object_collision() {
|
|
||||||
// var squareCenterX = squareX + squareSize / 2;
|
|
||||||
// var squareCenterY = squareY + squareSize / 2;
|
|
||||||
|
|
||||||
// var distance = dist(playerPosX, playerPosY, squareCenterX, squareCenterY);
|
|
||||||
|
|
||||||
// if (distance < squareSize / 2 + radius) {
|
|
||||||
// squareX = random(0, width - squareSize);
|
|
||||||
// squareY = random(0, height - squareSize);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
function shoot(directionX, directionY) {
|
function shoot(directionX, directionY) {
|
||||||
shot = true;
|
shot = true;
|
||||||
|
|
||||||
@@ -136,10 +122,6 @@ function draw() {
|
|||||||
score();
|
score();
|
||||||
text(time, 10, 20);
|
text(time, 10, 20);
|
||||||
|
|
||||||
|
|
||||||
// square(squareX,squareY,squareSize);
|
|
||||||
// object_collision();
|
|
||||||
|
|
||||||
if (shot == false) {
|
if (shot == false) {
|
||||||
shoot(playerPosX, playerPosY);
|
shoot(playerPosX, playerPosY);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user