Wednesday, November 19, 2014

melonJS 2.0.0 has landed !


We are very excited to finally announce the release of melonJS 2.0.0 ! This new version is a big step forward for us, as it marks the final collision detection system revamping we have been working on for months. Much of the work for that was partially available in the previous 1.1.x release, but we were able to put more emphasis into it for this release. Since we consider it a major milestone, the team decided to "rename" the previous 1.2.0 beta version to a final 2.0.0 version.

In this release, we were able to close several long-standing issues with the engine, bringing it up to speed with features that developers have come to expect from a modern game engine.

Download here: https://github.com/melonjs/melonJS/releases/tag/2.0.0

Here's a list of highlights for version 2.0.0:

  • Shape-based collision layer has replaced the tile-based collision layer.
  • WebGL support has landed! (Currently alpha-quality)
  • Many fixes and improvements with collision detection in isometric maps.
  • Physics bodies now support multiple shapes.
  • Automatic collision response handling is enabled by default, and fully customizable.
  • Support for most of the new features in Tiled 0.10, like :
    • Shape scaling and rotation (especially in TMX maps,)
    • TMX Tileset animations

Full details in the CHANGELOG...

The two biggest changes being shape-based collisions and WebGL !

Shape-based collisions finally closes every open issue ticket involving collision detection except this one. Fortunately, that bug is easy to workaround, and can likewise be easily fixed. Along with fixing a lot of bugs that were in the old system, the collision shapes support also greatly enhances the developer experience with isometric maps. Previously, collision shapes could not follow the natural flow of the world in an isometric perspective. Now a designer can place any number of "poly-line" objects into the collision layer of an isometric map, and melonJS will automatically apply the appropriate collision response.

The surprising thing is how little work was necessary to complete the isometric support after the basic collision shapes code was in place; shapes in an isometric map only had to be perspective-transformed with a simple rotate and scale operation. This does mean your objects will always be placed in pixel coordinate space (not isometric coordinate space) but this is a feature we may improve upon if developers voice their opinion that working in isometric coordinate space is preferable.

For more information on collision shapes, and how you can update your game to use them, please visit the following forum post: https://groups.google.com/d/msg/melonjs/pUliTbw-W_c/RYUI5JcS41sJ

Automatic collision response means that entities can now behave "solid" while colliding with one another. Previously this required additional code. Now it just happens by default, and can be disabled by return false; from your onCollision callback. This last point is an important step to customizing collision detections; For an example, the "platform" collision tile is no longer supported, but can be added easily with a few extra lines in the onCollision callback. See the Platformer example for the actual code.

Finally, we have started the processes of creating WebGL bindings for melonJS. It is currently an opt-in flag that can be passed to the me.video.init() method. The default is me.video.CANVAS, and you may chose to enable WebGL with me.video.WEBGL, or autodetect (fallback to Canvas if WebGL is unavailable) using me.video.AUTO. The WebGL renderer is currently slower than Canvas, as it is brand new and entirely unoptimized (hence alpha-quality).

The Upgrade Guide lists additional changes, which you will find helpful if you are porting an existing game, and the corresponding updated documentation is available here. With that, please start testing today, and check back in about two weeks for the final release! As always, please post any bugs to our issue tracker, and visit the forums if you have any support requests.

- the melonJS team

No comments:

Post a Comment