update spirit

This commit is contained in:
jakciehan
2026-06-07 22:10:03 +08:00
parent 427a33c55b
commit 9c57deff6d
82 changed files with 5465 additions and 149 deletions
+3 -2
View File
@@ -7,9 +7,10 @@ function makeGroundPlatform(): IPlatform {
function makeModel(color: PlayerColorState = PlayerColorState.Red) {
return new PlayerMotionModel({
aabb: { x: 0, y: 16, w: 16, h: 32 }, // character 16x32 resting on y=0 ground
aabb: { x: 100, y: 16, w: 16, h: 32 }, // character 16x32 resting on y=0 ground; x=100 avoids level-edge clamp
platforms: [makeGroundPlatform()],
initialColorState: color,
levelLengthPx: 2000,
});
}
@@ -27,7 +28,7 @@ describe('PlayerMotionModel — horizontal movement (req 2.1, 5.1-5.2)', () => {
m.setHorizontalInput(1);
m.update(1);
expect(m.vx).toBe(MOVE_SPEED[PlayerColorState.Red]);
expect(m.aabb.x).toBeCloseTo(100, 1);
expect(m.aabb.x).toBeCloseTo(200, 1);
});
it('moves at 150 px/s in yellow state', () => {