Skip to content

Commit b0ff30d

Browse files
committed
Updated GX to apply gravity consistently regardless of frame rate
1 parent 9e07e84 commit b0ff30d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

gx/gx.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1903,7 +1903,7 @@ var GX = new function() {
19031903
// calculate the number of seconds since the gravity started being applied
19041904
var t = (GX.frame() - _entities[eid-1].jumpstart) / GX.frameRate();
19051905
// adjust the y velocity for gravity
1906-
var g = _gravity * t ** 2 / 2;
1906+
var g = _gravity * t ** 2 / 2 * (60 / GX.frameRate());
19071907
if (g < 1) { g = 1; }
19081908
_entities[eid-1].vy = GX.entityVY(eid) + g;
19091909
if (GX.entityVY(eid) > _terminal_velocity) { GX.entityVY(eid, _terminal_velocity); }

service-worker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
// Names of the two caches used in this version of the service worker.
1515
// Change to v2, etc. when you update any of the local resources, which will
1616
// in turn trigger the install event again.
17-
const PRECACHE = 'precache-v65';
18-
const RUNTIME = 'runtime-v6';
17+
const PRECACHE = 'precache-v66';
18+
const RUNTIME = 'runtime-v7';
1919
const PREFIX = (self.location.origin.indexOf("github.io") == -1) ? "/" : "/qbjs/";
2020

2121
// A list of local resources we always want to be cached.

0 commit comments

Comments
 (0)