Jump to content

Phaser event touch in mobile


nExt
 Share

Recommended Posts

Hello,

i'm a newbie, and today i know phaser framework.. i very interest it.

and now i read tutorial how do make flappy bird HTML5.

i have a problem :

 

in tutorial and demo code, have  this line :

 

var space_key = this.game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);

   space_key.onDown.add(this.jump, this);

 

it set event when user press space in keyboard.. but i develop for mobile device. so i wan't using touch event replace for space key press..

 

how do i can change it.. 

 

- and i have question : 

How do i build this app to android application (apk) and ios app (.ipa) ...etc..

i know intel xda can build more platform.. so can i using phaser with intel xdk tools ??

 

Thanks you for reading , and please help me.. !

Link to comment
Share on other sites

in the flappy bird tutorial replace the

 

// var space_key = this.game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);

// space_key.onDown.add(this.jump, this);
 
for 

 

this.input.onDown.add(this.jump, this);

 

in the browser work with the mouse
and i think it work with touch on mobile
but i'm not sure i never tested 
 
let me know if it works :)
Link to comment
Share on other sites

 

in the flappy bird tutorial replace the

 

// var space_key = this.game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);

// space_key.onDown.add(this.jump, this);
 
for 

 

this.input.onDown.add(this.jump, this);

 

in the browser work with the mouse
and i think it work with touch on mobile
but i'm not sure i never tested 
 
let me know if it works :)
 
ok.. it work : 

 

game.input.onDown.add(this.jump, this); 

 or
this.input.onDown.add(this.jump, this); 
 

 

 

and i have a question.

how do build game to ios app or android app..

i if i build to smartphone device , need i change some function ?

 

if have tools build to ipa file , or apk file , please share me ..!

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...