This is a html5/javascript test using the Phaser framework.
The goal is to create a background and fade in/out effect for several Phaser.state objects. The background and fade effects are created using separate global functions, so that they can be re-used in different state objects. Another goal is to use as few resources as possible so it doesn't interfere with the rest of the game.
For more info see:
http://phaser.io/
http://www.html5gamedevs.com/forum/14-phaser/
Also posted this on html5gamedevs forum:
http://www.html5gamedevs.com/topic/10613-use-same-background-and-effects-for-different-states/
questions, comments: bdr1976@gmail.com