update spirit
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user