Archive for December, 2011

h1

melonJS 0.9.2

December 31, 2011

melonJS 0.9.2 available !

I’m happy to anounce that melonJS 0.9.2 is now officially available for download.

There is no real revolution inside, but a lots of nice features an improvement that will make everybody’s life easier (multiple line spritesheet/fontsheet, friction management, code optimization, better documentation, etc…). Some of them are also based on feedbacks or help of some of you (scan, Ben2303, Anthony, Lucas to name a few), so thank you very much !

Please see the full changelog on github for more details on this new version, and also the online documentation. And as previously, everything is available through the melonJS download page.

Additionally, and as explained in my last post, the biggest changes is maybe that melonJS is now released under the terms of The MIT license. This is a popular, human-readable and simple license, that everybody knows and understand, and I believe that most of you will be happy about it.

Please also don’t hesitate to step by the melonJS forum and say hello 🙂

Updating your game to work with melonJS 0.9.2 :

Following a few API changes in this new version, here is a couple of tips to ease the upgrade from a previous version of melonJS.

 1/Check for player movement :

-> In the previous version of melonJS, the updateMovement() function was returning a Boolean, indicating if your player movement has changed (final velocity different from 0) :

// check & update player movement
var updated = this.updateMovement();
// update animation if updated
if (updated)
{
   // update objet animation
   this.parent(this);
   return true;
}
return false;

-> In the 0.9.2 version of melonJS, the updateMovement() function now returns a collision “vector”, giving you indication on how you collided with the environment (the level itself, not other entities). Assuming that you don’t need that information, if you just want to upgrade you existing game, the simple solution is to do the following :

// check & update player movement
this.updateMovement();
// update animation if updated
if (this.vel.x!=0 || this.vel.y!=0)
{
   // update objet animation
   this.parent(this);
   return true;
}
return false;

As you can see, we replace the “updated” variable by a check on (this.vel.x!=0 || this.vel.y!=0), and since this what was returned by the updateMovement in the previous version, it gives us exactly the same behavior.

2/fadeIn/fadeout effect :

in melonJS 0.9.2, the fade effect are now taking as input a duration in ms, where it was in framecount for the previous version :

before :

// set a fade transition effect
me.state.transition("fade","#000000", 30); // 30 frame

now :

// set a fade transition effect
me.state.transition("fade","#000000", 500); // 500ms

One last word : let’s eat some fish !

And finally I’ve been working on this demo. I had lots of questions about “is it possible to do something else than a platform  games with melonJS?”, so I did something else ! it’s not at the stage I wanted to (it missing a few points to make it really nice), but I will update it later.

So, in a few words :

– it’s a fish game (woow!)
– the main player control the big fish
– you must eat the small fish to survive (or your life bar will keep decreasing)
– the more fish you eat, the bigger you become, making it more harder to avoid the jellyfish
– if you are too big, you can fart to get smaller. you can also fart on the jellyfish to kill them.

The demos is here : www.melonjs.org/demos/fishwar/

Have a fun !

h1

melonJS License

December 18, 2011

With melonJS 0.9.2 about to be released, I wanted to clarify the license model for melonJS.

I believe that most of the people fully misunderstood my choice of the Common Creative License (Non Commercial Share-Alike), and the statement where I was saying that the library was free for private usage. I never intended to disallow commercial usage of it, but melonJS being then in early stage, my intention was just to create a dialog with people willing to use it (for commercial usage) and avoid a situation where “serious” developers would come back and complain about everything (and for sure people, including myself, love to complain even for free stuff).

Anyway, following some long debate here, and even an email from the people at Creative Common, I finally decided to relax the license model, and to change from the CC one, to the MIT license.

The MIT license is a popular, human-readable and simple license, that everybody knows and understand, and I believe that most of you will be happy about it.

I already updated the necessary files in github for those interested, and the website should follow in a couple of days, when I will officially release the new 0.9.2 version.

Last but not least, melonJS being an open-source project, I still hope that some of you will come back with some nice additions to the library, and to finally build some community spirit around the engine. Despite of my poor choice of license, this was my goal since day 1, when I decided to publically release melonJS.

That’s all, thank you for reading, and have fun !