Rotate
I think it would be a good feature if the SpriteObject could rotate itself at least at 90 degrees. So it would be used like so:
this.rotate(true); // rotates the image 90 degrees
now I could flipX/flipY and get the image result I want.
Edit: here is some code that rotates canvas 90 degrees
http://pastebin.com/VSDMx30L
I haven't personally tested it, but I'm pretty sure it works correct.
what do you mean ?
in the current 0.9.4 (github) melonJS already support rotation and also anchor point, so that you can specify around which point to perform it.
basically if you want to apply a 90 degrees rotation to a sprite, what you need to do is : this.mySpriteEntity.angle = Number.prototype.degToRad (90);
is this what you want or you want an "helper" function that just rotate by 90 degrees every time it's called ? if the second, I don't know, as I'm already thinking about removing the doClimb function, etc... they are useless and does not help people understanding how the engine is working (I saw people using doClimb for movement on the y axis in a RPG....)
Yes, thank you for the note. Since I was using 0.9.3 and didn't find anything in the documentation, I thought such possibility wasn't implemented.
I have just realized that rotating sprite just rotates the image but not the collision box. Shouldn't this feature also rotate the collision box?
This is let to the "end-user" to decide, as for the scaling function.
Note that anyway with the current collision detection implementation being rectangle based, the only one managable are the 90 degrees based rotation.