Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Jerczu

Hi guys I was wondering how to achieve that let's say I have tiled background as in the jump'n'run is there a way for me to fade it to some colour and then fade it back like an atmospheric effect to achieve storm and thunder effect. So when the lightning strikes background fades to white for a bit and comes back to what it was before.

1 decade ago by dominic

Have a look at the draw() method in lib/impact/game.js. You could overwrite this method in your own game class and draw an additional background layer with some changing alpha. E.g.:

/* draw normal background layers */

ig.system.context.globalAlpha = lightningAlpha;
/* draw lighting layer */
ig.system.context.globalAlpha = 1;

/* draw entities */

Or you could just clear the screen with a semi transparent color:
ig.system.clear( 'rgba(255, 255, 255, 0.5)' );

1 decade ago by Jerczu

Awesome! Will try it as soon as possible :)
Page 1 of 1
« first « previous next › last »