patrickz.aiLet’s talk ↗

Build apps / Project lab

Build one mobile combat encounter

Make movement, one attack and restart work across keyboard and touch.

About 90 minutesSome experienceStack: Phaser 3Uses a coding agentRead free · No sign-up

Play Neon Brawler ↗See Patrick’s full project first, then build the tiny practice version below.

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

  1. Set your boundary

    Use one player, one enemy, health, attack cooldown and restart. Route input methods to the same actions.

  2. Make one combat scene

    Make one combat scene with placeholder shapes, and add movement before enemies.

  3. Draw temporary hitboxes

    Draw temporary hitboxes so attacks are visible during development.

  4. Add one enemy

    Add one enemy that chases, attacks on cooldown and can be knocked back.

  5. Add health and restart

    Add health, game over and restart. Restart clears both player and enemy state.

  6. 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].

More prompts to adapt ↗

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.

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.

KEEP GOING

Your next useful step

Browse all 57 guides ↗