diff options
author | elioat <elioat@tilde.institute> | 2024-12-27 08:15:13 -0500 |
---|---|---|
committer | elioat <elioat@tilde.institute> | 2024-12-27 08:15:13 -0500 |
commit | 3a4c1117bfc0b902fdec41467bc6528d2f7a6f6d (patch) | |
tree | 0fb77b1dcec44380f3949c505b1d5b5da3c9e196 /html/rogue/js/camera.js | |
parent | a7fea5f379187ea7e7ff643215b801832459ed67 (diff) | |
download | tour-3a4c1117bfc0b902fdec41467bc6528d2f7a6f6d.tar.gz |
*
Diffstat (limited to 'html/rogue/js/camera.js')
-rw-r--r-- | html/rogue/js/camera.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/html/rogue/js/camera.js b/html/rogue/js/camera.js index c389b6e..aaeeea9 100644 --- a/html/rogue/js/camera.js +++ b/html/rogue/js/camera.js @@ -16,11 +16,11 @@ const Camera = { const centerX = state.canvas.width / 2; const centerY = state.canvas.height / 2; - // Calculate distance from center of screen + // Distance from center of the screen const deltaX = screenX - centerX; const deltaY = screenY - centerY; - // Only move camera if player is outside deadzone + // Only move the camera if the player is outside of the deadzone if (Math.abs(deltaX) > Config.camera.DEADZONE_X) { const adjustX = deltaX - (deltaX > 0 ? Config.camera.DEADZONE_X : -Config.camera.DEADZONE_X); this.x += adjustX * Config.camera.FOLLOW_SPEED; |