Latest Posts

  • Phaser 2 and our plans for the future

    phaser2-github

    Exactly 6 months after the release of Phaser 1.0 we released version 2. It was a huge update. Not so much in terms of new features, although it did bring its fair share of tasty new treats to the table. But more so it underwent a large internal change. We upgraded to the latest version of Pixi.js, our renderer and this in turn allowed us to literally shave thousands of lines of code out.

    The core update loops of all the game objects like Sprite and Button, were dramatically reduced. Lots of the things that caused Phaser 1.x to not be quite as optimal as it could be were eliminated. Expensive routines and processes were either removed entirely or disabled where possible.

    It was a big update, but it felt good. It felt clean and fresh. Like when you tidy-up your work space, or white wash a room ready for painting. You know you’re building on top of something sound.

    There were a number of API breaking changes moving from v1 to v2, which is why we jumped version number so high (originally it was just going to be the 1.2 release). It was a lot of simple but important alterations. Things like the Group class now properly extending a DisplayObjectContainer, so they can easily be nested and shifted around the display list. Or Sprites no longer having physics bodies by default, or input handlers, which meant the amount of code they process during their basic update is now utterly minimal. Those features are still available of course, you just have to activate them explicitly. The changes were so extensive we produced a Migration Guide to help developers shift over.

    The TriForce

    Traditionally Phaser has had the ArcadePhysics system built in. This was a port of the one found in Flixel and our Flixel Power Tools. It was fundamentally basic, but still covered quite a lot of bases and most importantly was very easy to use. However the limitations really started to bug us, and we tried to address them in the 1.1.4 release of Phaser, with less than stellar results.

    A strong reason for us developing Phaser 2 was so that we could use a proper full-body physics system, in our case the excellent p2.js by Stefan Hedman. And for a good while this was the only physics system we had built in. But as we worked through the weeks of development, it became apparent that there was a real need to keep ArcadePhysics around. Not the broken 1.1.4 version, but the earlier release that mostly just worked, because it didn’t try to be too clever.

    Read More

  • Phaser 1.1.4 (“Kandor”) released. Check out the new features and roadmap.

    We planned to release Phaser 1.1.4 towards the end of 2013, but as with all the best laid plans that never quite happened. As we dug further into it we found some key areas that we desperately wanted to update and as we travelled deeper into the rabbit hole more and more things were changed. After weeks of intense work, refactoring, testing and example building we finally broke the surface and 1.1.4 has moved from dev to master on github.

    There have been some significant internal API changes, so if you had a game in build under 1.1.3 please be aware of these before blindly upgrading! Here are some of the headlines:

    phaser_polygons

    New SAT Based Physics System

    The previous physics system relied on AABB for all collision. It was fast, but very limited. You couldn’t use circles, rotated rectangles or create slopes of any kind. We do still plan to use a full proper physics system in Phaser 2.0, but in the meantime we felt that we really needed to give our current one a shot in the arm, and this is the result.Utilising SAT.js internally you can now create much more complex collision shapes and responses. We also made some large changes to the way the delta timer and integration works and added a bunch of new debugging features too.

    New Tilemap System

    The tilemap system in 1.1.3 was ok, but had some strange limitations. For example if you rotated a sprite it would often pop through a tile into the other side and there was no support for the more advanced features from the Tiled map editor. The new tilemap system resolves the vast majority of these issues. It uses a much more robust ‘edge chain’ for collision detection. It supports multiple tilesets per map. It supports tile specific callbacks and properties defined in Tiled are carried over into Phaser. You can now turn a whole group of tiles into a group of Sprites with one command and mix layer order around with ease. We’ve still more work to do with the tilemaps, but on the whole it’s a marked improvement over the previous version.

    Read More

  • Phaser games in Ludum Dare 28

    Ludum Dare 28 took place over the weekend of December 13th – 16th 2013 and saw a staggering 2064 entries. The theme this time was “You only have one” and as usual this theme was pushed in many different and wonderful directions. It was the first LD to take place with a true post 1.0 release of Phaser available, and while I was hoping that a couple of devs may enter Phaser made games, I had no idea that over 20 of them would! And those are just the ones we know about, there may well be more.

    Forum member XekeDeath did a fantastic job of collating them all in a single forum thread, with links to each of them. It was great to see the creativity and some truly polished entries. There were also number of ‘first timers’, their first time entering LD and in most cases their first use of Phaser at all! The fact they managed to pick-up a brand new framework, and code a complete game in it, in just 48 hours is pretty staggering.

    Congratulations to everyone who entered. Here are a few screen shots from some of the games. I’ve played them all and left feedback on the forum, but if yours isn’t on the forum please tell me. Do check out the full list. I’m very much looking forward to the next LD! And of course Global Game Jam in early 2014.

    Monkey Rally

    Monkey Rally

    One Sword

    OneSword

    Read More

  • Advanced Phaser and TypeScript Projects

    This tutorial is a follow-up to the TypeScript with Phaser beginners guide. I will assume you have worked through that tutorial already and have a working set-up in which you can compile Phaser projects. From this base we will expand on the simple approach taken in the beginners guide and show how to structure a more advanced project that benefits from the power of TypeScript.

    Create a new Project

    In the first tutorial everything was hanging off a single app.ts file with one bundled class. This time around we’re going to break it up into more individual classes. In Visual Studio create a new empty TypeScript project, then add the phaser TypeScript definition and JS library files to it as outlined in Step 2 in the first tutorial.

    Download this asset pack and unzip it into the project folder. We’ll reference these files in our code.

    Create a new TypeScript file called Game.ts and add this code to it:

    Here we have created a new Module called Castlevania under which all of our game classes will live. Obviously you’d change this to whatever your game is actually called, unless you’re genuinely working on a Castlevania game, in which case I’m eternally jealous :)

    The Game class is extending Phaser.Game. As a result we need to call super in the constructor and pass in our game settings. Once done we add 4 States to the game: Boot, Preloader, MainMenu and Level1, and then start the Boot state. You don’t have to add ALL of the States at this point, but there is no harm in doing so.

    Read More

  • How to use Phaser with TypeScript

    In this tutorial we’ll cover setting-up a Phaser TypeScript project. We’re going to specifically cover using Visual Studio, but the concepts will be similar regardless of which IDE you’re using.

    This guide is based on TypeScript 0.9.5 and Visual Studio 2013. Ensure you have both of these installed before carrying on, as it probably won’t work with earlier builds of TypeScript. You will also need a local copy of the Phaser repository. See the Phaser Getting Started Guide for details on how to download this.

    Step 1: Create a New Project

    In Visual Studio create a new Project. Make sure you pick “HTML Application built with TypeScript” as the Template, which can be found under the TypeScript template category on the left. We’ve called our sample project “PhaserTypeScript”.

    part1

    After a short while it will create the Solution and open a file called app.ts containing the default TypeScript Greeter class example:

    part2

    Read More

More posts to tickle your grey matter ...

Page 1 of 8412345678910...Last »