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 playerSpeed = 3;
|
||||
let booleanArray = window.booleanArray;
|
||||
// let squareX = 100;
|
||||
// let squareY = 100;
|
||||
// const squareSize = 100;
|
||||
|
||||
|
||||
let shotSpeed = 5;
|
||||
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) {
|
||||
shot = true;
|
||||
|
||||
@@ -135,10 +121,6 @@ function draw() {
|
||||
|
||||
score();
|
||||
text(time, 10, 20);
|
||||
|
||||
|
||||
// square(squareX,squareY,squareSize);
|
||||
// object_collision();
|
||||
|
||||
if (shot == false) {
|
||||
shoot(playerPosX, playerPosY);
|
||||
|
Reference in New Issue
Block a user