
Made a deep-sea exploration game in Phaser 4: custom light map, normal maps derived from pixel art, and all audio synthesised with Web Audio
HADAL is a browser game about diving to the bottom of the Mariana Trench: https://game-hadal.vercel.app/en/
A few Phaser 4 things that might interest people here:
- Lighting: a light map (sunlight that fades by depth, the lamp cone, caustics near the surface), applied to the scene through a camera Blend filter.
- Normal maps generated automatically from every pixel-art sprite. One gotcha: Phaser doesn't flip normals with
setFlipX, so each sprite also gets a mirrored texture. - Additive glow: with
setForceCompositethe camera is composited through alpha, so additive light darkened the scene. Drawing glow into aDynamicTexturewithBlendModes.ADDfixed it. - No sound files: everything is synthesised live with Web Audio.
Happy to go into detail on any of it, or to hear how others handle lighting in Phaser 4.
u/slinto — 13 days ago