Temorinkitojimo Posted April 25, 2014 Share Posted April 25, 2014 Hi everyone! I am currently doing the Flappy Bird Tutorial on lessmilk.com.In the tutorial, the jump function is called when the spacekey is hit. // Call the 'jump' function when the spacekey is hit var space_key = this.game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR); space_key.onDown.add(this.jump, this);I would like to add touch input to the game, however when I add: game.input.pointer1.isDown(this.jump, this);the game does not even start (I can make the "bird" go up and down, but the pipes aren't coming. Can someone lead me to the right path? Link to comment Share on other sites More sharing options...
rich Posted April 26, 2014 Share Posted April 26, 2014 game.input.onDown.add(this.jump, this); Link to comment Share on other sites More sharing options...
RunCodeLive Posted August 24, 2014 Share Posted August 24, 2014 game.input.onDown.add(this.jump, this);Hey, just wondering how in the method called (in this case function jump(){}) I can determine the location of the touch event. Thanks! Link to comment Share on other sites More sharing options...
lewster32 Posted August 24, 2014 Share Posted August 24, 2014 The function is passed two parameters, the pointer and the original event - you can determine the location by pointer.position:function jump(pointer, event) { console.log(pointer.position);}game.input.onDown.add(jump, this); Link to comment Share on other sites More sharing options...
Recommended Posts