From 082b90451a7637bcf2c34d59f58bb0b3d2ed57d7 Mon Sep 17 00:00:00 2001 From: elioat Date: Sat, 6 Jul 2024 15:17:34 -0400 Subject: * --- js/mountain/game.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'js/mountain') diff --git a/js/mountain/game.js b/js/mountain/game.js index 5601d94..1b4d96e 100644 --- a/js/mountain/game.js +++ b/js/mountain/game.js @@ -6,13 +6,22 @@ const ctx = canvas.getContext('2d'); canvas.width = 800; canvas.height = 600; -const GRAVITY = 0.5; -const JUMP_STRENGTH = -12; -const MOVE_SPEED = 5; +const GRAVITY = 4; +const JUMP_STRENGTH = -33; +const MOVE_SPEED = 7; let keys = { left: false, right: false, up: false, down: false, space: false }; let levels = [ + [ + // Next level example + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5], + [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] + ], [ [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], @@ -34,11 +43,6 @@ let levels = [ [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] - ], - [ - // Next level example - [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5], - [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] ] // Add more levels as needed ]; -- cgit 1.4.1-2-gfad0