Collision response
Click anywhere to drop a physics ball — they collide with each other and the world bounds.
Notes
- A physics group with
collideWorldBoundskeeps every member inside the canvas. physics.add.collider(group, group)makes group members collide with each other — the second pass over the group is what gives you ball-on-ball bouncing.setCircle(radius)switches the body from the default rectangular AABB to a circle. Phaser’s Arcade defaults to rectangles even for round sprites.- Pointer events fire on the iframe —
pointer.x/pointer.yare already in canvas coordinates. - See Arcade Physics for groups, colliders, overlaps, and the rest.