miaoda-game-raycast-grid-phaser
v0.3.2
Published
Phaser Graphics renderer for miaoda-game-raycast-grid-core wall columns.
Readme
miaoda-game-raycast-grid-phaser
Phaser Graphics rendering for wall columns from miaoda-game-raycast-grid-core, plus optional pointer-lock mouse look. Choose it for solid-color classic raycasters; textured walls, billboards, and floor sampling remain game-owned.
pnpm add miaoda-game-raycast-grid-phaser miaoda-game-raycast-grid-coreconst renderer = new RaycastGridRenderer(this.add.graphics(), 960, 540);
renderer.draw(columns, column => ({color: column.hit?.side === 'horizontal' ? 0x76543a : 0x9a704c}), {
background: {ceiling: {color: 0x151520}, floor: {color: 0x21160f}},
});
const look = new PointerLockLookController(this.input, this.input.mouse!, {
enabled: () => missionActive,
onLook: ({yawDelta, pitch}) => cameraController.look(yawDelta, pitch),
});The renderer converts corrected depth into clipped Phaser rectangles. It rejects an inside camera column by default; fix the spawn/recovery position, or opt in only for diagnostics. Mouse look requests pointer lock after gameplay input, while the game owns yaw, horizon, firing, ADS, and pause policy. Call destroy() on the look controller at Scene shutdown.
