Jump to content

Search the Community

Showing results for tags 'activePointer.isdown'.

  • 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. I don't know why this is happening but the getGold() function inside the this.input.activePointer.isDown is not working on mobile but working fine on browsers. I compiled the code using cordova/phonegap to put it on mobile. What should happen: player tap and hold on the screen > animation should play > everytime it hits the last frame it should get gold What's happening (browser): player taps and hold on screen > animation plays > everytime it hits the last frame it gets gold What's happening (mobile): player taps and hold on screen > animation plays Code: function update() {if(this.input.activePointer.isDown) { player.animations.play('mine'); var curframe = player.animations.currentAnim.frame; if(curframe == 3) { getGold(function() { var convertedScore = (score / 3.0864716706).toFixed(3); if(convertedScore == 100) { showAlert("CONGRATULATIONS! \nYOU REACHED THE \nGOAL of 100 CARAT!"); } }); }} else { player.animations.stop(); player.frame = 0;}}function getGold(callback) { score = score + (Math.floor(Math.random() * maxgoldpersec) + mingoldpersec); var convertedScore = (score / 3.0864716706).toFixed(3); scoreText.text = "Gold: " + convertedScore + ' carat'; if(callback) { callback(); }}
×
×
  • Create New...