How to change color of sprite over time

Skip to first unread message


Jul 15, 2016, 3:59:29 PM7/15/16
to melonJS - A lightweight HTML5 game engine
I am just starting to learn this library and am very happy so far :)

I am a bit stuck with the following problem:

I want to add some trail effect to a moving object that will fade over time. This is what I've got so far:

(move with WASD or arrow keys)


But I want to change the colors of the items in the trail in the same way the fading is done.

In phaser this could be done tinting the sprite, but I have no clue about how to achieve that on melonjs.

Note: if the effect can be done with basic shapes instead of images that will work too.
Note2: if there is a better way of doing the trailing that using the tweening, please lead the newbie.

I have posted the question also in Stack Overflow:

Reply all
Reply to author
0 new messages