miaoda-game-road-phaser
v0.3.1
Published
Phaser Graphics renderer for miaoda-game-road-core frames.
Readme
miaoda-game-road-phaser
Draw miaoda-game-road-core render frames with Phaser Graphics. It converts the core's centered, y-up projection to Phaser's top-left, y-down screen coordinates.
pnpm add miaoda-game-road-phaser miaoda-game-road-coreimport {RoadRenderer} from 'miaoda-game-road-phaser';
const renderer = new RoadRenderer(this.add.graphics(), this.scale.width, this.scale.height);
renderer.draw(roadEngine.frame(camera, sprites));
this.scale.on('resize', size => renderer.resize(size.width, size.height));The renderer draws sky, grass, rumble strips, road, and lane marks in painter order. Palette colors are Phaser numeric colors. Billboard sprites, movement, collisions, and race rules remain game-owned.
