Twitter icon Forward icon

Phaser Newsletter #3 - March 2014

Welcome to Issue 3. This month we've got details about Phaser 2.0.1, a great new MOBA game in development and a short overview of some of the new features to be found hidden away in Phasers depths.

Phaser 2.0.1 is out now

We're pleased to announce that Phaser 2.0.1 is now available for download from github. As we mentioned in the previous issue, version 2 of Phaser was a significant update for us. It allowed us to really focus on the API, remove lots of legacy baggage and basically give the whole framework a good spring clean.

It's amazing to think that is was only just over 6 months ago that we released Phaser 1.0 into the world. Suffice to say that since then we've been overwhelmed at the huge surge of developers taking to it!

Our github repository is consistently in the top JavaScript lists, we've over 3600 stars at the time of writing, and a wonderful, vibrant and friendly community. Phaser 2 is a natural evolution of what we started. We've focused specifically on performance and expansion with this release. Lots of developers have already reported to us considerably speed increases just by swapping to Phaser 2 (reports of 200% faster speeds on mobile aren't unheard of!).

There's also a full-body physics system available now, in the form of the excellent p2.js. The upgrade to Pixi 1.5 under the hood bought lots of new visual effects in, including blend modes and tints.

And we're also really pleased to have closed down over 550 issues reported on github. We literally went through every last bug reported to us, and fixed it. All kinds of little things that as a whole make the library that much more solid.

With the 2.0 release we're now freezing the API. Before we have to admit that the API changed somewhat on a whim, and we moved things around and changed things without too much consideration for fellow developers. With 2.0 that stops - we've spent long enough on this release that we're now extremely happy with the organisation of classes and methods, and while we may still need to make small tweaks in the future, none of them will be API breaking without prior community approval first. This means if you're using Phaser to teach in classes, or writing a book / tutorials around it, this is the version to base off.

Version 2.0.1 was a mostly maintanence release that focused on restorying some of the ArcadePhysics values and handling that you expressed you wanted on the forum. So if you use ArcadePhysics anywhere in your Phaser 2 game then we strongly suggest you upgrade.

Because it was such an API breaking change we wrote a Migration Guide, which we'd strongly recommend you have a read through. We also updated as many of the Examples to 2.x as we could. But if you do find any that no longer run, please tell us and we'll sort them out right away.

A lot of hard work went into the 2.0 release and we strongly believe it's the best version of Phaser we've ever created. We'd love to know what you can create with it, so please get in touch!

Download Phaser 2.0.1 from github

Phaser Examples have a new home

As part of the upgrade to 2.0 we took out the Examples from the main repository and put them in their own. It made a lot of sense to keep them bundled with Phaser at the start, but as the project grew we realised that the Examples needed their own space to grow, unhampered by being tied to a Phaser release.

So the Phaser Examples github repository was created. By splitting them up we can now release examples as quickly and as often as we like, and it also made the size of the main repository much smaller too.

We're happy to receive pull requests against the Phaser Examples if you've got any new ones you'd like to see added to the ever growing collection.

The Examples can also be found online at http://examples.phaser.io

Jiun - A Pixel Art MOBA in your browser

Jiun is a multiplayer online battle arena (MOBA) game created in Phaser by the talented team at Pinterac. Using a pixel art style the battles take place in fixed size scrolling arenas, with a variety of weapons, shields and even your bare fists available.

The action is fast and furious, with rounds over relatively quickly, but leaving you wanting another go. Taunts via the in-game chat adds to your motivation to fight again. There is no magic skills or auto-attack, as is common in lots of MOBA, instead it's all down to your skill.

You can see some work in progress videos on their YouTube channel.

The next beta round starts March 30th 2014, so sign-up, find me online and try to sink a few arrows into my back before I slice you down :)

https://jiun.net

Phaser and Physics: Polygonal Collisions Primer

Phaser community member codevinksy has posted this tutorial on how to use PhysicsEditor to create custom polygon collision shapes for Phaser objects.

It's a pretty easy process but is great to see it explained step-by-step with a demo at the end.

It's worth mentioning that the 2.0.1 release of Phaser comes with a plugin for PhysicsEditor now, so you can install our own plugin (created by the awesome Georgee) and export directly :)

http://codevinsky.com/phaser-and-physics-polygonal-collisions-primer/

Where has my body gone?

Screen shot above is from the game Monster Collector

One of the biggest changes in Phaser 2 is the way the physics systems have been abstracted out. In the past we were bound to ArcadePhysics, and every Sprite automatically had a physics body that did quite a lot of heavy lifting and processing, even if you weren't using it.

In 2.0 we totally changed the way this works. Now Sprites don't have a body by default at all. Indeed there isn't even a physics system running within Phaser by default any more. This is because we support 3 different physics libraries, with more on the way. And you can choose which of those you activate within Phaser or not.

For example to use ArcadePhysics you now have to add this line to your games:

game.physics.startSystem(Phaser.Physics.ARCADE);

If you have a sprite you wish to use physics on, then you add it by passing it to the physics managers enable function:

game.physics.arcade.enable(sprite);

Once done this creates a new body property on the Sprite, which you can then use as you did in the past. Setting velocity, bounce, acceleration and more.

You can use the ArcadePhysics methods such as velocityFromAngle and collide as before, just remember to specify arcade as the system:

game.physics.arcade.collide(a, b);

Each physics system has different properties available to it, and different ways to using it so be sure to check the Examples and documentation to find out what's new.

Outro

The release of Phaser 2 was a lot of work for us. Many long days and sleepless nights, coding away trying to make it the best we possibly can for everyone using it.

Now we've ironed out most of the post launch issues we're going to take stock for a while and kick back. We'll focus on tutorials, examples and more in-depth games to really show how best to use it. Because it doesn't matter how powerful a framework is, if you don't know how to get what you need from it, it may as well not exist at all.

Cheers,

Rich
& the Photon Storm team

"We have grown, but there is still much to be done. Many live in the darkness that must be shown the way. For it is the dawning of a new day." (JC Denton, Deus Ex)