Build 10 games and learn game development along the way in this fast paced game development course

Get the source code of 12 commercial games, loaded 50+ million times, and learn the secrets of game design

Learn how to make a successful Flash game from a real world example. Fully commented source code

Create realistic Flash physics games from scratch with advanced features, from Angry Birds to Crush the Castle

HTML5 Totem Destroyer fully working prototype using Phaser

One of the frameworks I am using to release some HTML5 games is Phaser.

I already showed you how to include and use p2 physics with Phaser in the post quick HTML5 physics test with Phaser 2.0 and p2 physics, now it’s time to see something more complete and complex like a Totem Destroyer prototype.

If you are a long time reader, you should remember some old posts about this topic, like the AS3 full Totem Destroyer prototype and the complete HTML5 Totem destroyer engine using PhysicsJS.

Now it’s time to use Phaser to create the same thing.

By the end of this post, you will learn how to:

* Create static and dynamic bodies
* Attach images to bodies (actually is attach physics bodies to sprites)
* Destroy object with mouse click
* Handle collision listeners
* Use sensor bodies

Have a look at the result:

Click to destroy light-brown boxes, try to make the totem touch the ground or fly off the screen. Using sensors to detect when something is not on the screen is not the best practice available, but I needed a way to show you how to create sensors.

And this is the fully commented source code:

Phaser and p2 are a really explosive couple, stay tuned to see what I have for you next days, meanwhile you can download the entire project, images included.

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (8 votes, average: 4.00 out of 5)
Loading...Loading...
Learn how to make a successful commercial Flash game from a real world example: get the fully commented source code of Globez, a Flash game played millions of times which generated a four figure income. Limited copies available.

Get it now
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 2 comments

  1. blandon

    on April 22, 2014 at 11:54 am

    No matter its html 5 or 6, JS makes me sake

  2. Marcio Andrey Oliveira

    on April 30, 2014 at 12:09 am

    Very nice example.

    On my mobile phone (Motorola Razr i – Android 4.1.2) it’s too slow.

    Can we improve its performance? How?

Thank you for the download!!

I hope you will find it useful and make something interesting out of it

To keep up to date with the blog, why don't you like my Facebook page and follow me on Twitter?

Want to learn more? Don't miss this:

Learn how to make a successful commercial Flash game from a real world example: get the fully commented source code of Globez, a Flash game played millions of times which generated a four figure income. Limited copies available.

Get it now

×