Phaser 0.9 Released – Motion, Collision, GeomSprites and more

phaser_fruit_particles

The latest version of Phaser was pushed to github today. This marks the v0.9 release and consisted of a large re-factoring of the code base, as well as lots of enhancements and new features:

  • Everything now lives within the Phaser module, so it no longer creates anything in the global name space. It makes coding a tiny bit more verbose but is the right way to handle it. It should also allow for code-insight in editors like WebStorm to function correctly.
  • NEW: GeomSprites. This is a game object that can be added to the world, but that uses any of the geometry primitives for its data. So you can populate a GeomSprite with a Circle, Rectangle, Point or Line and then have it rendered in your game world. This is extremely useful for fast prototyping.
  • NEW: Collision class. This class handles all forms of object collision and intersection for both game objects and geometry. You’ll find methods for things such as checking for line intersection, circle overlaps, game object collision and more.
  • NEW: Geometry Intersection results. This compact little object is returned by intersection methods and contains the resulting data about the intersection, rather than just a true/false.
  • NEW: Motion class. This contains rafts of handy methods dealing with the movement and motion of game objects, such as ‘moveTowardsObject’ or ‘velocityFromAngle’ can be found in here.
  • NEW: Tween Manager. You can now create tweens without using a 3rd party library. All the usual tween eases are supported (Bounce, Back, Circular, Quintic, etc) and it’s hooked into the core game clock. This means that if your game pauses when it resumes all active tweens will adjust themselves accordingly and carry on as normal.
  • UPDATED: Input.Keyboard used to call event.preventDefault() on keydown, but that of course blocks all keyboard events from the browser – so simple things like pressing F5 to refresh the page stopped working. We removed that in the previous commit but it meant that using the arrow keys in a game would also scroll the browser window if large enough. Newly added to Input.Keyboard are addKeyCapture(), removeKeyCapture() and clearCaptures(). These allow you to consume key events but only for specific keys.

There are a couple of features left on the “to do” list before we will consider a Phaser 1.0 release and that includes tile map collision, documentation and enhancing the sound support. Once those are in we’ll release 1.0 and then turn to the community for suggestions on where to head next.

Right now we’ve very happy with what we’ve built. It’s compact (just 39KB minified and gzipped) yet extremely powerful, while still hopefully easy to use. That is of course a large part of where we need to go next: tutorials and a getting started guide. But first let’s take Phaser to a 1.0 release.

Support and general discussion can be found on the Phaser forum.

Latest updates can be found on github: https://github.com/photonstorm/phaser

Posted on April 18th 2013 at 8:43 pm by .
View more posts in Phaser. Follow responses via the RSS 2.0 feed.


2 Responses

Leave a comment
  • April 18th 2013 at 11:27 pm

    Getting Phaser to 1.0 will be a great milestone, both for you guys and for the community. Maybe adding support for box2Djs might come in handy after the fact.

    I would love to know if there’s a way to do live code editing with TypeScript (similar to what Bret Victor does in his talk, Inventing on Principle

    .

    I would also like to know if you guys support gamepads, I heard the Internet browser on Xbox 360 can play HTML5 games. It would be cool if we could target that platform.

  • April 19th 2013 at 9:09 am

    We’ve got plans re: live code editing, but nothing firm yet. For now we’ll use codepen. No real plans for Box2D, sorry – there just aren’t any good JavaScript versions of it imho. Joypad support is coming for sure though :)

Make yourself heard