javascript - Phaser attach signal to game input -


i'm trying understand how phaser works, using phaser classes create object without gameobjectfactory. have following code:

var controler = new phaser.input(game); var printsomthing = new phaser.signal();     printsomthing.add(function(){             alert("anything")         }); controler.ondown = printsomthing; 

but code not working, , there no errors in console. doing wrong?

you cant' replace 'ondown', because it's signal.

controller.ondown.add(function(){             alert("anything")         }); 

and if you're really

trying understand how phaser work

... it's best check rich base of phaser examples , documentation.

http://phaser.io/examples/v2/category/input


Comments