In phaser.js capture touch events on the canvas -
i'm trying make simple game has single input based on lessmilk.com's flappy bird tutorial. on keyboard hit space jump, on touch enabled devices i'd have users touch anywhere on canvas jump.
looking @ input docs seems straight forward capture touch input sprite, i'd user able click/touch anywhere.
what's "phaser way" capture touch events? need hacky create invisible sprite covering entire canvas? should bypass phaser , attach dom event handlers?
seems i'd been misunderstanding role of phaser's input manager. i'd been trying use game.input.touch
hook events needed using higher level input.ondown
event:
// click / touch jump game.input.ondown.add(this.jump, this);
Comments
Post a Comment