2026-08-24 15:17:53 +02:00
|
|
|
import type {
|
|
|
|
|
Character,
|
|
|
|
|
CharacterConfig,
|
2026-08-24 15:54:44 +02:00
|
|
|
} from "engine/world/CharacterController"
|
2026-08-04 02:09:54 +02:00
|
|
|
|
2026-08-24 15:17:53 +02:00
|
|
|
export type Player = Character & {
|
2026-08-04 02:09:54 +02:00
|
|
|
pitch: number
|
|
|
|
|
}
|
|
|
|
|
|
2026-08-24 15:17:53 +02:00
|
|
|
/** Concrete player tuning. Movement and collision behavior live in engine. */
|
2026-08-04 02:09:54 +02:00
|
|
|
export namespace Player {
|
2026-08-24 15:17:53 +02:00
|
|
|
export const actorCollisionRange = 3
|
2026-08-04 02:09:54 +02:00
|
|
|
|
2026-08-24 15:17:53 +02:00
|
|
|
export const config: CharacterConfig = {
|
|
|
|
|
radius: 0.35,
|
|
|
|
|
speed: 6,
|
|
|
|
|
runMultiplier: 2,
|
|
|
|
|
gravity: 22,
|
|
|
|
|
jumpSpeed: 14,
|
|
|
|
|
eyeHeight: 1.6,
|
2026-08-04 02:09:54 +02:00
|
|
|
}
|
|
|
|
|
|
2026-08-24 15:17:53 +02:00
|
|
|
export function create(): Player {
|
|
|
|
|
return {
|
|
|
|
|
position: { x: 0, y: 0, z: 8 },
|
|
|
|
|
yaw: 0,
|
|
|
|
|
pitch: 0,
|
|
|
|
|
velocityY: 0,
|
|
|
|
|
onGround: true,
|
2026-08-04 02:09:54 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|