changed screen size
This commit is contained in:
12
web/game.js
12
web/game.js
@@ -1,7 +1,7 @@
|
|||||||
//--------------------Game--------------------
|
//--------------------Game--------------------
|
||||||
// Game variables
|
// Game variables
|
||||||
const width = 1000;
|
const width = 1260;
|
||||||
const height = 600;
|
const height = 620;
|
||||||
|
|
||||||
// Player variables
|
// Player variables
|
||||||
const playerSize = 10;
|
const playerSize = 10;
|
||||||
@@ -12,7 +12,7 @@ let playerSpeed = 4;
|
|||||||
let booleanArray = window.booleanArray;
|
let booleanArray = window.booleanArray;
|
||||||
let lives = 1;
|
let lives = 1;
|
||||||
|
|
||||||
let bossPosX = 500;
|
let bossPosX = width / 2;
|
||||||
let bossPosY = 100;
|
let bossPosY = 100;
|
||||||
let shotSpeed = 9;
|
let shotSpeed = 9;
|
||||||
let projectile;
|
let projectile;
|
||||||
@@ -73,7 +73,7 @@ function life() {
|
|||||||
fill(255, 0, 0);
|
fill(255, 0, 0);
|
||||||
textSize(40);
|
textSize(40);
|
||||||
textAlign(CENTER);
|
textAlign(CENTER);
|
||||||
text("Game Over", 500, 300);
|
text("Game Over", width/2, height/2);
|
||||||
if (key == ' ') {
|
if (key == ' ') {
|
||||||
lives = 1;
|
lives = 1;
|
||||||
time = 0;
|
time = 0;
|
||||||
@@ -172,8 +172,8 @@ function draw() {
|
|||||||
circle(x4, y4, 50);
|
circle(x4, y4, 50);
|
||||||
circle(x5, y5, 50);
|
circle(x5, y5, 50);
|
||||||
} else {
|
} else {
|
||||||
x2 = bossPosX;
|
x2 = width / 2;
|
||||||
y2 = bossPosY;
|
y2 = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
bullets.forEach(myBullet => {
|
bullets.forEach(myBullet => {
|
||||||
|
Reference in New Issue
Block a user