From cdc26001fd09c26938e1f032c481704f2599b2d1 Mon Sep 17 00:00:00 2001 From: Brian Fertig Date: Sat, 22 Aug 2026 16:20:22 -0600 Subject: [PATCH] Fix smash item physics radius to align visual bottom edge with collision boundary The circle hitbox was using a radius of 22 * WORLD_SCALE, which caused gravity items to hover above the ground and other bodies due to a gap between their visual bottom edge and physical collision boundary. Reduced the radius to 16 * WORLD_SCALE (displaySize/4) so that the Matter.js body's on-screen radius of 64 world pixels matches the item's actual visual extent, ensuring items land flush with terrain and other objects instead of floating above them. --- src/config.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/config.js b/src/config.js index cecd3cd..dcec53c 100644 --- a/src/config.js +++ b/src/config.js @@ -213,7 +213,16 @@ export const SCORE = { // which fly under a reduced fraction, see KID.ejectedGravityScale), // tumbling as it goes, then lands and stays where it lands. export const SMASH_ITEM = { - radius: 22 * WORLD_SCALE, // circle hitbox (~70% of the 64px frame's display half) + // Circle hitbox. The spritesheet art sits in the LOWER half of each 64x64 + // cell and fills down to the very bottom of that cell, so an item's VISUAL + // bottom edge is exactly displayHalf (= SMASH_ITEM.displaySize / 2 = 64 + // world px) below its centre. In this build a Matter circle's on-screen + // radius is 2x the value passed to shape.radius (32 -> 64 world px, the + // game's own convention), so we pass displaySize/4 to make the PHYSICAL + // bottom coincide with the VISUAL bottom. That is what stops a gravity item + // from hovering above the ground - its art actually reaches the terrain + // (and any other body it falls onto) instead of floating a gap above it. + radius: 16 * WORLD_SCALE, // = SMASH_ITEM.displaySize / 4 (body radius -> 64) displaySize: 64 * WORLD_SCALE, // one 64x64 frame, shown square density: 0.001, friction: 0.5,