updated code to work with latest version of Phaser 2.0.2