Skip to main content

Platformer2DStateComponent

@zylem/game-lib


@zylem/game-lib / behavior / Platformer2DStateComponent

Interface: Platformer2DStateComponent

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:55

Properties​

currentSpeed​

currentSpeed: number

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:67

Current movement speed being applied


falling​

falling: boolean

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:61

Is falling (not jumping)


grounded​

grounded: boolean

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:57

Is the entity on the ground


jumpBuffered​

jumpBuffered: boolean

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:75

Is a jump allowed due to buffer?


jumpBufferTimer​

jumpBufferTimer: number

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:77

Time remaining in jump buffer


jumpCount​

jumpCount: number

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:63

Current jump count (for multi-jump)


jumpCutApplied​

jumpCutApplied: boolean

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:81

Has the jump cut been applied for this jump?


jumpCutRampTimer​

jumpCutRampTimer: number

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:89

Remaining seconds of jump-cut velocity ramp; while > 0, verticalVelocity lerps toward verticalVelocity * jumpCutMultiplier.


jumpedThisFrame​

jumpedThisFrame: boolean

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:87

True for the single frame on which a jump impulse was applied; prevents gravity from clobbering jump velocity.


jumpHeld​

jumpHeld: boolean

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:79

Is jump button currently held


jumping​

jumping: boolean

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:59

Is currently in a jump arc


jumpPressedLastFrame​

jumpPressedLastFrame: boolean

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:71

Was jump button pressed last frame (for edge detection)


jumpReleasedSinceLastJump​

jumpReleasedSinceLastJump: boolean

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:83

Has jump button been released since last jump (required for multi-jump)


jumpStartHeight​

jumpStartHeight: number

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:65

Y position when jump started


lastGroundedY​

lastGroundedY: number

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:69

Last known ground Y position


timeSinceGrounded​

timeSinceGrounded: number

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:73

Time in seconds since last grounded


timeSinceJump​

timeSinceJump: number

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:85

Time since current jump started (for multi-jump window)


verticalVelocity​

verticalVelocity: number

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:95

Controller-owned vertical velocity (units/second). The body is kinematic, so linvel() is meaningless — this field is the single source of truth for jump/gravity motion on the Y axis.