From 52123763d3446fd1d3f56ec4a2ea039daa54e114 Mon Sep 17 00:00:00 2001 From: Mal Date: Sun, 20 Oct 2024 15:08:42 +0200 Subject: [PATCH] Gravity fixed --- js/Game.js | 2 +- js/retro/RetroAnimation.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/js/Game.js b/js/Game.js index 578f9bf..b82befa 100644 --- a/js/Game.js +++ b/js/Game.js @@ -98,7 +98,7 @@ export class Game ); /* Handle falling */ - this.mrCroc.position.y += this.mrCroc.fallSpeed; + this.mrCroc.position.y += this.mrCroc.fallSpeed * delta * 0.6; this.mrCroc.fallSpeed += this.level.gravity * delta; /* Handle ground collision */ diff --git a/js/retro/RetroAnimation.js b/js/retro/RetroAnimation.js index 83a4534..ceb2268 100644 --- a/js/retro/RetroAnimation.js +++ b/js/retro/RetroAnimation.js @@ -62,4 +62,5 @@ export default class RetroAnimation extends RetroSprite this.isPlaying = false; } -} \ No newline at end of file +} +