Jump to content

Search the Community

Showing results for tags 'onhold'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Hi everyone, I'm new in Phaser and start make a flying bird game. Ive already searched for my problem everywhere and read examples, still have no clue. My question about onhold on screen, i dont want people keep tapping on screen to get the bird fly. I want the bird fly when people hold finger on screen, and the bird fall when stop hold screen. Here my code: function create() { game.physics.startSystem(Phaser.Physics.ARCADE); // When all assets are loaded, go to the 'menu' state bird = game.add.sprite(100, 0, 'bird'); game.physics.enable(bird, Phaser.Physics.ARCADE); bird.animations.add('bird'); bird.animations.play('bird', 6, true); bird.body.gravity.y = 100; game.inputEnabled = true; game.input.onDown.add(fly, this); // This is Working game.input.onHold.add(fly, this); // This is Not Working } function fly () { bird.body.velocity.y =-10; } Question here http://www.html5gamedevs.com/topic/1574-gameinputondown-question/ close mine, but i don't know how to fix! Thanks everyone!
×
×
  • Create New...