Twitter icon Forward icon

Phaser Newsletter #2 - February 2014

Welcome to the second issue of the Phaser Newsletter. We've been hard at work since the first issue dropped and consequently have a bunch of news for you, including the retirement of the Phaser 1.x version family and what to look forward to with Phaser 2.0

We've also some new Phaser games for you to play and details about the Kiwi.js HTML5 game framework. So read on and enjoy!

Phaser 1.1.6 Released

Since issue one of the newsletter we've actually released Phaser 1.1.4, 1.1.5 and today 1.1.6. 1.1.4 was another substantial upgrade and introduced a lot of new features, which we'll readily admit not all of worked as well as we'd hoped. Hence the two subsequent fast releases.

On the positive side 1.1.4 introduced a new Tilemap system which was far better than any we'd released before. Integration with the Tiled map editor was better than ever before, and you could now define object groups and have them converted into sprites at run-time, as well as using multiple tile sets, map and layer properties and tile specific callbacks.

This version also bought in the new Timers. A way to create either one-shot or looping timers that could be hooked in to for various game tasks. One of the new examples, a multi-image slideshow, demonstrated how to create them.

Game set-up also became a lot easier with the ability to pass in a game configuration object. This allows you fine-grained control over how Phaser started-up, including being able to pass additional CSS properties to the Phaser canvas object.

Finally 1.1.4 saw the introduction of a new SAT based physics system, and while this opened up the ability to define proper polygon collision bounds for sprites, it also threw new spanners into the works and proved once and for all that our ArcadePhysics system, which we'd relied on for over a year, just wasn't going to be enough any more. Both releases 1.1.5 and 1.1.6 helped address some of the weird physics issues that were manifesting, but it was clear a bigger change was required., and that would come in the form of Phaser 2.0.

On the whole the 3 versions combined introduced over 150 new features and over 50 bug fixes. Lots of core areas received some much needed tlc and paved the way for what would become the next release.

Upgrade to Phaser 1.1.6 on github

Phaser 2.0 arrives March 13th

While we were hard at work updating Phaser, the guys over at Pixi.js were also taking their library through some significant internal changes. Phaser relies entirely on Pixi for all rendering, so anything they change impacts on us. Sometimes these are small changes we can slip into a regular point release, and other times they are significant API changing updates such as with their 1.5 release.

We were chomping at the bit to integrate 1.5 into Phaser. Because as well as some cool new features such as the ability to tint sprites, they had also revamped Pixis guts, allowing us to do away with literally thouands of lines of code that was no longer required.

Renderer Turbo Boost

The way in which Pixi handled its display list was vastly simplified and is now a lot faster. This opens it up for games that before would have been extremely difficult to pull-off, such as isometric games, or games that require constant depth-sorting.

Seeing this was the kickstart we needed to re-do all of Phasers game object classes. Literally every single one, from Sprite to Text, has been recoded from scratch. We've done away with masses of pre-update loop processing and removed loads of internal cache vars, and as a result we're seeing massive fps increases across the board while actually gaining flexibility, not reducing it.

Pixi also introduced Sprite Batches. This WebGL only feature shifts all of the transform calculations away from JavaScript and onto the GPU, and as a result can blast literally hundreds of thousands of sprites around (GPU depending of course). As WebGL spreads across the desktop and now into mobile this is a welcome addition.

Full body Physics

With a clean and fresh set of game objects, a greatly improved Group handler and fixes across the board, it was time for us to address the last remaining elephant in the room: ArcadePhysics. We had the option of either struggling on with it or doing what we'd been planning for a while: replacing it with a proper physics system. Needless to say we chose the later. Our system of choice was the excellent p2.js by Stefan Hedman. Although a very new physics system, Stefan has been releasing JavaScript physics APIs for a while now (Cannon.js being probably his most famous), and we really liked what we saw in p2. The API was clean, 2D focused and best of all: really tiny. Yet it still offered us all the things you'd expect: contact events, Springs, Constraints and a choice of solvers.

High on our success of spring cleaning with Pixi we dived into p2 and couldn't be more happy with the results. Integration went smoothly, a few bugs were fixed and Stefan has been awesome at responding to issues and helping with integration. It's a proper game-changer, in every sense of the word, and we cannot wait to see what you all create with it :)

When will it ship?

Phaser 2.0 is 95% feature complete and right now we're on a bug-fixing streak. Our aim is to close all issues on github before launch, and we're cracking through them at the moment to achieve that. We are also updating all of the Examples to ensure they work fully, revising the documentation and preparing new demos.

Baring "acts of God" (or client work) we're looking good for our target release date of March 13th. Exactly 6 months after the release of 1.0.

If you wish to follow progress you can do so in the new Phaser sub-forum and github branch. They're still called "1.2" but we realised that it was such an API changing upgrade we had to give it a more substantial release, hence 2.0. So if you see any comments relating to Phaser 1.2 anywhere, that is the same thing as 2.0.

Welcome to Phaser Labs

Although we've got an extensive selection of Examples, we really wanted to create somewhere that we could throw new experiments on and not have to worry massively about the code behind them. Rather they would be show-off pieces or little tests, whatever fell out of our keyboards during the creation of Phaser 2.0.

So we created Phaser Labs and we upload a new code experiment or two each week. Right now you can mess around with physics, view a load of wriggly maggots or see the new 'fixed to camera' commands in action. Have a play and keep your eye out for new updates weekly!

http://labs.phaser.io

Trending on github

It's a small thing, but we were really pleased to see that Phaser was #3 last week in githubs top trending repositories across the whole of their JavaScript category. As it stands we're actually #7 for the whole month of February, coming after the likes of the massive angular.js or gulp.

It was only a few months ago that we were celebrating achieveing 1000 github stars, but as I write this we're closing in fast on 3000 stars. Let's see what kind of an impact 2.0 will bring :)

Flappy Bert

Unless you've been living under a rock for the past month, you'll no doubt be aware (and probably sick to death) of all the Flappy Bird clones doing the rounds. Needless to say there have been a large number of them created in Phaser, just check the current Phaser Games List for evidence, which incidentally now lists no less than 115 games made in Phaser!

But one of our favourites has to be Flappy Bert by the guys at Sesame Street. Created with Phaser 1.1.4 this desktop and mobile friendly homage to Flappy Bird was widely covered by the press, including this great write-up on Rock, Paper Shotgun, another over at Gamespot, and even as far as Slate, Metro, the Daily Star and Hollywood Life, probably making it one of the most played Phaser games yet.

Kiwi.js - The WordPress of HTML5 Game Engines

Kiwi.js is an HTML5 game framework maintained by the New Zealand based Instinct Entertainment that's well worth looking at. This may seem like a strange thing to be saying in a Phaser newsletter, but we firmly believe there is plenty of room in the HTML5 ocean, and Kiwi has a number of features that Phaser doesn't that may be exactly what you're looking for.

Kiwi.js is created exclusively in TypeScript and compiled to JavaScript. It's actually the only HTML5 game framework to my knowledge that is built this way, which means if you're a TypeScript coder you don't have to worry about definition files being out of date, or something not being exposed or typed properly. Of course you can still use Kiwi.js from plain JavaScript too, and most of the tutorials are written from that perspective, but if you are a TypeScript coder you'll feel right at home here.

It uses an Entity Component System (ECS), which means game objects can be extended via components, and new components can be created with ease.

It supports rendering to both Canvas and WebGL, but they've also ensured from the start that it works under CocoonJS, so you can compile it to a native mobile app without struggling with browser issues. If you know for a fact that a native app is one of your target platforms then this should be a strong factor in Kiwi's favour.

They also keep extending it with plugins. The most recent plugins include support for Leapmotion, TouchButtons, BitmapText and LocalStorage.

With regular updates and tutorials it's well worth taking a look at. Full details on their web site at http://www.kiwijs.org

Outro

This brings us to the end of another issue. I've no doubt that the next will be celebrating the release of Phaser 2.0 and bringing you some tips and tricks on getting the most from it.

If there is anything you'd like to see in the newsletter, or items you'd like to contribute then please get in touch. You can simply reply to the email and it'll come direct to me. Otherwise have fun coding and join us on the forums.

Cheers,

Rich
& the Photon Storm team

"The right man in the wrong place can make all the difference in the world." (Half-Life 2)