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
   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
// update animation if updated
if (this.vel.x!=0 || this.vel.y!=0)
   // update objet animation
   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 !


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 !


melonJS & The Chronicles of Link

October 30, 2011

Sounds like a music band, right ?

But it’s not ! I actually wanted to post about this very nice remake/clone that Anthony brilliantly managed to put together using melonJS. And although being “only” a WIP demo for now, it looks really promising and shows (proves?) that melonJS is not only tailored for platform games, as lots of people seems to believe. And I must admit that I was myself impressed to see how fast Anthony built a first version !

You can visit his page here to try it, for more information about the game progress and status, and/or if you want to contact Anthony.

And finally, since last release a google group has been created as well, so feel free to pay us a visit there and discuss about melonJS with us 🙂


And as always, have fun !


melonJS 0.9.1 available

October 6, 2011

I was initially planning for melonJS 0.9.1 to be just a bug fix release (based on the first feedbacks received), but I finally found myself adding more than I initially wanted, at the point where calling it 0.9.1 almost does not really make sense !

Anyway, going straight to the point and without being too technical, here is what changed in this new version :

  • A traditional “batch” of bug fix
  • Better performances (see my previous post)
  • Better browser compatibility (various browser fix), including IE9 and the coming IE10 platform.
  • Better integration with Tiled, supported features should now be on pair with the last Tiled version (0.7.1)
  • Beta Dirty Rectangle support (that will be very useful later on mobile platforms)
  • Experimental WebGL support (contact me if you need more details on this)

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

For the next major version, I’m planning to add support for touch event and other stuff needed to get this baby running on iOS or/and Android devices, along with some other new features. I will also look at appMobi and PhoneGap, don’t hesitate to let me know if you have any recommandation/feedback on this last point.

Finally I would like to thank everybody for the warm enthusiasm and interests expressed towards melonJS, and of course for all the feedback that also helped me bring all the stuff in this version together 🙂

And, as always, have fun !

[EDIT] I added a “forum”, using google group, it’s not a super fancy forum and for sure is basically empty for now, but this a good place to start if you have any questions about the engine. Link is available from the melonJS homepage.


melonJS performances

September 17, 2011

Hi there !

With melonJS 0.9.1 being almost ready, I spent some time today doing a quick benchmark to see what was the real benefits of the code rewrite and few optimizations I put here and there.

So here is a small table showing the CPU usage for both version, this is also not a really extensive benchmark, as I just done on it my main development machine, which is powered by a C2D 2.66ghz, and running OSX 10.6.8 :

As you can see the new version shows (in average) more than 16% performances increase on my configuration, which is not bad at all I think. Oh, and I forgot to add that I used Alex4 for the benchmark, which is a high demanding game in terms of resources, since it’s using 3 parallax layers, etc…

melonJS 0.9.1 is mostly a bug fixing release but will also add some cool new features. Better Tiled Integration, and most of all Dirty Rectangle (that was disabled for the above benchmark). It will however still be tagged as “beta” when I will release it (since I still need more extensive testing, and some adjustment), but it will finally allow me to go to my next goal which is mobile devices, where I believe should be quite useful.

Still concerning performances and dirty rectangle, I have a 15% CPU usage (on the same machine) for my dirty Rectangle example, that uses (of course) a non scrolling level, and a canvas size of 1024×768. On my CoreDuo 2Ghz laptop, the same example is running at full speed (60fps), where before, without dirtyRect, it was struggling to reach 34fps. Nice, no ?

I’ll write later about the next version, but for those interested, you can have a look at the changelog on github (should be almost up-to-date).

Cheers !


Github – Me : 1 – 1

July 26, 2011

Finally, after weeks of fighting with the new OSX Github client, I went back to the old classic command line system, and finally managed to get my stuff in github ! (but I’m also not an expert on Github, so for sure my  mistakes)

It’s not yet perfect, the “doc” directory is missing, my “web” directory is on the server (despite of the .gitignore file), tabs are all messed up in the source, but if you want to grab the last version, and play with it,  you can grab it now.

As you’ll notice, I pushed my dev 0.9.1 version, which includes some bugfix, and some small features, see the Changelog for more details. It’s still a dev version, but stable enough.

Last point, I got lots of email about Alex4 not working : this is due to the ongoing maintenance on the TapJS website (Alex4 assets are now missing from the server, and the administration console is unavailable), and I guess it should be back to normal I guess in the few hours/days ?




melonJS 0.9.0 is available !

July 7, 2011

Hey guys,

I’m happy to tell you that melonJS is finally available. Originally I was planning to wait for the 1.0 version to be ready, but I finally realized that if I was waiting for melonJS to be perfect, I would never release it (…), so here comes the 0.9.0 version !

The following things are available through the download page :

  • minified version of melonJS (0.9.0)
  • source package of the library (I will put everything in github in the coming days, the time to learn how to use it correctly)
  • melonJS documentation (auto-generated using jsdoc)
  • a tutorial showing how to create a simple patformer using (of course) melonJS and Tiled.

Please keep in mind that this is all a first release, melonJS is still beta software (source code is not the cleanest one and still contains some debug stuff), and although I tried my best to have a good documentation and/or tutorial, it won’t be perfect at all.

I’m of course interested on any feedbacks (good and bad), either on missing information/documentation, about bug corrections, or on nice features to be added in melonJS. Feel free to contribute with anything as well.

To finish, a few words on my plan for the near future (in no particular order) :

  • optimization (i.e. tilemap drawing) and bug corrections
  • fully stabilize the API (lacks of coherence, or naming to be corrected)
  • go mobile (touch interface)
  • implement a dirty rectangle mechanism
  • implement support for a “standard” spritesheet format (like texturepacker, zwoptex or something)
  • add some particle management (this is not supported by the engine today)
  • look at possible H/W acceleration (CSS, WebGL)
  • Better integration with Tiled (if possible)

That’s all ! Hoping that you’ll have fun with melonJS,