diff --git a/Script.js b/Script.js index dde9fa5..76108ac 100644 --- a/Script.js +++ b/Script.js @@ -34,17 +34,17 @@ function init() { } function keyDownPressed(e) { - if (e.keyCode == 81) { + if (e.keyCode == 87) { keys.up = true; - } else if (e.keyCode == 65) { + } else if (e.keyCode == 83) { keys.down = true } - if (e.keyCode == 79) { + if (e.keyCode == 65) { keys.left = true; } - if (e.keyCode == 80) { + if (e.keyCode == 68) { keys.right = true; } @@ -57,17 +57,17 @@ function keyDownPressed(e) { function keyUpPressed(e) { - if (e.keyCode == 81) { + if (e.keyCode == 87) { keys.up = false; - } else if (e.keyCode == 65) { + } else if (e.keyCode == 83) { keys.down = false; } - if (e.keyCode == 79) { + if (e.keyCode == 65) { keys.left = false; } - if (e.keyCode == 80) { + if (e.keyCode == 68) { keys.right = false; } @@ -98,13 +98,13 @@ function gameLoop(timestamp){ } class PlayerObject{ - constructor(x,y){ + constructor(x, y){ this.x = x; this.y = y; - this.width = 200; + this.width = 150; this.height = 150; this.color = 'blue'; - this.speed = 10; + this.speed = 5; this.lives = 3; this.score = 0; this.health = 100; @@ -127,4 +127,4 @@ class PlayerObject{ } } -let player1 = new PlayerObject(100.100); \ No newline at end of file +let player1 = new PlayerObject(100,100); \ No newline at end of file diff --git a/Style.css b/Style.css index 6c71760..3e0c52b 100644 --- a/Style.css +++ b/Style.css @@ -21,5 +21,5 @@ body { width: 1280px; height: 650px; margin: 0px; - background-color: black; + background-color: rgb(0, 0, 0); } \ No newline at end of file