BlueGit

projects-timfalken-com meteors

chore: rebuild game.js with cluster-only halved float-down (t1124)

timfa Grok Bot · pushed by timfa

Authored 2026-11-13 · 4 days ago

Hash
50b6366635df787147e68d84dfc93fe07f80f91f
Parent
eae87dfb
1 file changed +40 −19
build/game.js +40 −19
@@ -262,10 +262,11 @@ else if (typeof globalThis !== 'undefined')
262 262 * one jump from the floor clears the 13-tile field with room to spare;
263 263 * at 4 you still need more than one jump, but each is 50% taller.
264 264 * Air (fallTime): 1 s (hard, fast fall) .. 5 s (easy, slow fall).
265 * After a jump peaks, blocks float down at DESCENT_SPEED_SCALE *
266 * FIELD_HEIGHT / fallTime tiles/s (DESCENT_SPEED_SCALE is 0.5 since
267 * t1122: all descent speeds are halved). Relative differences between
268 * planets (1 / fallTime) are unchanged. Upward launch is not affected.
265 * Spawn, unsupported and cargo blocks fall at FIELD_HEIGHT / fallTime
266 * tiles/s. After a jump peaks, a flying cluster floats down at
267 * DESCENT_SPEED_SCALE * that speed (0.5 since t1122 / t1124: only the
268 * cluster float-down is halved). Relative differences between planets
269 * (1 / fallTime) are unchanged. Upward launch is not affected.
269 270 * Mass (riseTime): 0.5 s (hard, fast jump) .. 3 s (easy, slow jump).
270 271 * Time to reach the apex, independent of jump height.
271 272 *
@@ -283,9 +284,10 @@ var FIELD_HEIGHT = 13;
283 284 /** t1119: every match jump (the gravity-applied minimum and the
284 285 * vertical / extra-block bonuses derived from it) is 50% higher. */
285 286 var JUMP_HEIGHT_SCALE = 1.5;
286 /** t1122: every descent speed is halved. Terminal fallSpeed, spawn
287 * fall, unsupported / released / cargo fall, and the post-apex
288 * float-down all use this scale. Upward launch is unchanged. */
287 /** t1122 / t1124: only a flying cluster's post-apex float-down
288 * (terminal speed and the apex ease into it) is halved. Spawn fall,
289 * unsupported / released singles and dropped cargo use the full
290 * fallSpeed. Upward launch is unchanged. */
289 291 var DESCENT_SPEED_SCALE = 0.5;
290 292
291 293
@@ -321,13 +323,16 @@ function createPlanet (opts)
321 323 riseTime: riseTime,
322 324 colors: colors,
323 325 baseJumpHeight: JUMP_HEIGHT_SCALE * FIELD_HEIGHT / jumpsToClear,
324 fallSpeed: DESCENT_SPEED_SCALE * FIELD_HEIGHT / fallTime,
325 // Time to ease from vy=0 at the apex to terminal fallSpeed.
326 // Shorter when air resistance is low (small fallTime). The ease
327 // duration is unchanged; fallAccel scales with the halved
328 // fallSpeed so the ease still lasts apexEaseTime seconds.
326 // Single-block fall (spawn, unsupported, dropped cargo).
327 fallSpeed: FIELD_HEIGHT / fallTime,
328 // Time to ease from vy=0 at the apex to terminal speed.
329 // Shorter when air resistance is low (small fallTime).
329 330 apexEaseTime: 0.15 * fallTime,
330 fallAccel: (DESCENT_SPEED_SCALE * FIELD_HEIGHT / fallTime) / (0.15 * fallTime),
331 fallAccel: (FIELD_HEIGHT / fallTime) / (0.15 * fallTime),
332 // t1122 / t1124: flying-cluster float-down only. Same ease
333 // duration; accel scales with the halved terminal speed.
334 clusterFallSpeed: DESCENT_SPEED_SCALE * FIELD_HEIGHT / fallTime,
335 clusterFallAccel: (DESCENT_SPEED_SCALE * FIELD_HEIGHT / fallTime) / (0.15 * fallTime),
331 336 // Visual landing bounce: faster at low air resistance. Stage-3 params.
332 337 bounceDuration: 0.12 * fallTime,
333 338 bounceSquash: 0.16
@@ -1409,10 +1414,25 @@ GameCore.prototype.clusterMembers = function (clusterId)
1409 1414 * Advance a jump (cluster or manual) by dt. Uses exact kinematics so a
1410 1415 * jump of height H peaks at exactly H after riseTime. Returns dy.
1411 1416 * Mutates body.vy and body.phase ('up' / 'down'). body.decel is the
1412 * upward deceleration. After the apex, vy eases from 0 to -fallSpeed
1413 * at planet.fallAccel, then stays at terminal fallSpeed.
1417 * upward deceleration. After the apex, vy eases from 0 to the
1418 * terminal descent speed at the matching accel, then stays there.
1419 * Flying clusters (forCluster) use the halved cluster float-down
1420 * (t1122 / t1124); manual jumps use the full single-block fallSpeed.
1414 1421 */
1415 GameCore.prototype.advanceJump = function (body, dt)
1422 GameCore.prototype.descentParams = function (forCluster)
1423 {
1424 var p = this.planet;
1425 if (forCluster)
1426 {
1427 return {
1428 fallSpeed: p.clusterFallSpeed,
1429 fallAccel: p.clusterFallAccel
1430 };
1431 }
1432 return { fallSpeed: p.fallSpeed, fallAccel: p.fallAccel };
1433 };
1434
1435 GameCore.prototype.advanceJump = function (body, dt, forCluster)
1416 1436 {
1417 1437 var dy = 0;
1418 1438 var left = dt;
@@ -1443,8 +1463,9 @@ GameCore.prototype.advanceJump = function (body, dt)
1443 1463 }
1444 1464 if (body.phase === 'down' && left > 0)
1445 1465 {
1446 var target = -this.planet.fallSpeed;
1447 var accel = this.planet.fallAccel;
1466 var desc = this.descentParams(forCluster);
1467 var target = -desc.fallSpeed;
1468 var accel = desc.fallAccel;
1448 1469 if (accel < 1e-12)
1449 1470 {
1450 1471 body.vy = target;
@@ -1494,7 +1515,7 @@ GameCore.prototype.integrateClusters = function (dt)
1494 1515 { continue; }
1495 1516
1496 1517 this.prepareClusterBody(cluster);
1497 var dy = this.advanceJump(cluster, dt);
1518 var dy = this.advanceJump(cluster, dt, true);
1498 1519 cluster.anchorY += dy;
1499 1520 this.syncClusterMembers(cluster);
1500 1521
@@ -262,10 +262,11 @@ else if (typeof globalThis !== 'undefined')
262 * one jump from the floor clears the 13-tile field with room to spare;
262 * one jump from the floor clears the 13-tile field with room to spare;
263 * at 4 you still need more than one jump, but each is 50% taller.
263 * at 4 you still need more than one jump, but each is 50% taller.
264 * Air (fallTime): 1 s (hard, fast fall) .. 5 s (easy, slow fall).
264 * Air (fallTime): 1 s (hard, fast fall) .. 5 s (easy, slow fall).
265 * After a jump peaks, blocks float down at DESCENT_SPEED_SCALE *
265 * Spawn, unsupported and cargo blocks fall at FIELD_HEIGHT / fallTime
266 * FIELD_HEIGHT / fallTime tiles/s (DESCENT_SPEED_SCALE is 0.5 since
266 * tiles/s. After a jump peaks, a flying cluster floats down at
267 * t1122: all descent speeds are halved). Relative differences between
267 * DESCENT_SPEED_SCALE * that speed (0.5 since t1122 / t1124: only the
268 * planets (1 / fallTime) are unchanged. Upward launch is not affected.
268 * cluster float-down is halved). Relative differences between planets
269 * (1 / fallTime) are unchanged. Upward launch is not affected.
269 * Mass (riseTime): 0.5 s (hard, fast jump) .. 3 s (easy, slow jump).
270 * Mass (riseTime): 0.5 s (hard, fast jump) .. 3 s (easy, slow jump).
270 * Time to reach the apex, independent of jump height.
271 * Time to reach the apex, independent of jump height.
271 *
272 *
@@ -283,9 +284,10 @@ var FIELD_HEIGHT = 13;
283/** t1119: every match jump (the gravity-applied minimum and the
284/** t1119: every match jump (the gravity-applied minimum and the
284 * vertical / extra-block bonuses derived from it) is 50% higher. */
285 * vertical / extra-block bonuses derived from it) is 50% higher. */
285var JUMP_HEIGHT_SCALE = 1.5;
286var JUMP_HEIGHT_SCALE = 1.5;
286/** t1122: every descent speed is halved. Terminal fallSpeed, spawn
287/** t1122 / t1124: only a flying cluster's post-apex float-down
287 * fall, unsupported / released / cargo fall, and the post-apex
288 * (terminal speed and the apex ease into it) is halved. Spawn fall,
288 * float-down all use this scale. Upward launch is unchanged. */
289 * unsupported / released singles and dropped cargo use the full
290 * fallSpeed. Upward launch is unchanged. */
289var DESCENT_SPEED_SCALE = 0.5;
291var DESCENT_SPEED_SCALE = 0.5;
290
292
291
293
@@ -321,13 +323,16 @@ function createPlanet (opts)
321 riseTime: riseTime,
323 riseTime: riseTime,
322 colors: colors,
324 colors: colors,
323 baseJumpHeight: JUMP_HEIGHT_SCALE * FIELD_HEIGHT / jumpsToClear,
325 baseJumpHeight: JUMP_HEIGHT_SCALE * FIELD_HEIGHT / jumpsToClear,
324 fallSpeed: DESCENT_SPEED_SCALE * FIELD_HEIGHT / fallTime,
326 // Single-block fall (spawn, unsupported, dropped cargo).
325 // Time to ease from vy=0 at the apex to terminal fallSpeed.
327 fallSpeed: FIELD_HEIGHT / fallTime,
326 // Shorter when air resistance is low (small fallTime). The ease
328 // Time to ease from vy=0 at the apex to terminal speed.
327 // duration is unchanged; fallAccel scales with the halved
329 // Shorter when air resistance is low (small fallTime).
328 // fallSpeed so the ease still lasts apexEaseTime seconds.
329 apexEaseTime: 0.15 * fallTime,
330 apexEaseTime: 0.15 * fallTime,
330 fallAccel: (DESCENT_SPEED_SCALE * FIELD_HEIGHT / fallTime) / (0.15 * fallTime),
331 fallAccel: (FIELD_HEIGHT / fallTime) / (0.15 * fallTime),
332 // t1122 / t1124: flying-cluster float-down only. Same ease
333 // duration; accel scales with the halved terminal speed.
334 clusterFallSpeed: DESCENT_SPEED_SCALE * FIELD_HEIGHT / fallTime,
335 clusterFallAccel: (DESCENT_SPEED_SCALE * FIELD_HEIGHT / fallTime) / (0.15 * fallTime),
331 // Visual landing bounce: faster at low air resistance. Stage-3 params.
336 // Visual landing bounce: faster at low air resistance. Stage-3 params.
332 bounceDuration: 0.12 * fallTime,
337 bounceDuration: 0.12 * fallTime,
333 bounceSquash: 0.16
338 bounceSquash: 0.16
@@ -1409,10 +1414,25 @@ GameCore.prototype.clusterMembers = function (clusterId)
1409 * Advance a jump (cluster or manual) by dt. Uses exact kinematics so a
1414 * Advance a jump (cluster or manual) by dt. Uses exact kinematics so a
1410 * jump of height H peaks at exactly H after riseTime. Returns dy.
1415 * jump of height H peaks at exactly H after riseTime. Returns dy.
1411 * Mutates body.vy and body.phase ('up' / 'down'). body.decel is the
1416 * Mutates body.vy and body.phase ('up' / 'down'). body.decel is the
1412 * upward deceleration. After the apex, vy eases from 0 to -fallSpeed
1417 * upward deceleration. After the apex, vy eases from 0 to the
1413 * at planet.fallAccel, then stays at terminal fallSpeed.
1418 * terminal descent speed at the matching accel, then stays there.
1419 * Flying clusters (forCluster) use the halved cluster float-down
1420 * (t1122 / t1124); manual jumps use the full single-block fallSpeed.
1414 */
1421 */
1415GameCore.prototype.advanceJump = function (body, dt)
1422GameCore.prototype.descentParams = function (forCluster)
1423{
1424 var p = this.planet;
1425 if (forCluster)
1426 {
1427 return {
1428 fallSpeed: p.clusterFallSpeed,
1429 fallAccel: p.clusterFallAccel
1430 };
1431 }
1432 return { fallSpeed: p.fallSpeed, fallAccel: p.fallAccel };
1433};
1434
1435GameCore.prototype.advanceJump = function (body, dt, forCluster)
1416{
1436{
1417 var dy = 0;
1437 var dy = 0;
1418 var left = dt;
1438 var left = dt;
@@ -1443,8 +1463,9 @@ GameCore.prototype.advanceJump = function (body, dt)
1443 }
1463 }
1444 if (body.phase === 'down' && left > 0)
1464 if (body.phase === 'down' && left > 0)
1445 {
1465 {
1446 var target = -this.planet.fallSpeed;
1466 var desc = this.descentParams(forCluster);
1447 var accel = this.planet.fallAccel;
1467 var target = -desc.fallSpeed;
1468 var accel = desc.fallAccel;
1448 if (accel < 1e-12)
1469 if (accel < 1e-12)
1449 {
1470 {
1450 body.vy = target;
1471 body.vy = target;
@@ -1494,7 +1515,7 @@ GameCore.prototype.integrateClusters = function (dt)
1494 { continue; }
1515 { continue; }
1495
1516
1496 this.prepareClusterBody(cluster);
1517 this.prepareClusterBody(cluster);
1497 var dy = this.advanceJump(cluster, dt);
1518 var dy = this.advanceJump(cluster, dt, true);
1498 cluster.anchorY += dy;
1519 cluster.anchorY += dy;
1499 this.syncClusterMembers(cluster);
1520 this.syncClusterMembers(cluster);
1500
1521