Before you start
A coding agent, browser and placeholder shapes. Follow the repository’s current setup instructions.
Why this lesson exists
The original Phaser brawler prototype added movement before enemies and drew temporary hitboxes so attacks were visible during development. This lab keeps that order for one encounter, so you tune what you can see.
Do the exercise
Set your boundary
Use one player, one enemy, health, attack cooldown and restart. Route input methods to the same actions.
Make one combat scene
Make one combat scene with placeholder shapes, and add movement before enemies.
Draw temporary hitboxes
Draw temporary hitboxes so attacks are visible during development.
Add one enemy
Add one enemy that chases, attacks on cooldown and can be knocked back.
Add health and restart
Add health, game over and restart. Restart clears both player and enemy state.
Add touch controls
Add touch controls after keyboard behavior is stable. They call the same actions as the keys.
Next sessions, not today
- Title scene Add a title scene once the combat scene plays well.
- Real-device tuning Publish early and tune feel from real devices.
A prompt to adapt
Replace the bracketed parts with your own details.
Help me build one mobile combat encounter in Phaser 3 in a new practice folder. First version only: one player, one enemy, health, an attack with a cooldown and restart, using placeholder shapes, with keyboard and touch routed to the same actions. No title scene or publishing yet. Follow the current Phaser setup instructions and list the setup commands before changing any files. Then work in five checkpoints and, after each, tell me how to check it: 1. One combat scene with movement, before any enemy. 2. Temporary hitboxes so attacks are visible. 3. One enemy that chases, attacks on a cooldown and can be knocked back. 4. Health, game over and a restart that clears player and enemy state. 5. Touch controls that call the same actions as the keyboard. Starting tuning values: [speed, range, cooldown, damage]. My placeholder theme: [one sentence].
Once it runs, paste your code and ask:
Review these touch controls for a one-screen mobile combat encounter. Check thumb reach, simultaneous movement and attack, accidental presses, orientation changes and safe-area insets, and confirm touch and keyboard call the same actions.
Run this experiment
Move and attack simultaneously on touch. Lose, restart, rotate the device and test again. Display hitboxes while checking whether attacks connect.
Check your result
Use evidence from your output. A confident explanation from the AI is not enough.
If it isn’t working
If combat feels random, make collisions visible and record cooldown values before adjusting art or effects.
Optional. Progress stays in this browser.
Where this came from
Public project repository ↗. The practice lesson is an adaptation, not a verbatim transcript. About the sources.
Prepared September 2026. Tools and interfaces change; use current official setup instructions. Session lengths are estimates.
patrickz