Build a HTML5 game like “Ballz” using Phaser and ARCADE physics – adding multiball

If you followed the series about Ballz, you should remember in step 2 I told you I wanted to make the entire prototype fit in 200 lines.

Well, I needed some more lines – 231 brackets included – but I managed to create the complete prototype, with levels and multiball.

Have a look:

Tap/click and drag to the bottom to aim the ball, release to launch it. Get the orange balls to activate multiball mode.

If you have a mobile device, you can play it directly from this link.

On my laptop I managed to play with 100 balls with no stress, try to edit line 59 to start with more extra balls.

And here is the source code. Uncommented at the moment because I have to optimize it, mostly adding object pooling to save resources and a proper game over state.

And this was another demonstration of Phaser awesomeness, so much fun, so little code. Download the source code and see you with the final version.