Jump to content

Search the Community

Showing results for tags 'hotkeys'.

  • 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. Greetings, I was looking the forum for an answer, but wasn't able to find even the issue. Maybe it's just my wrong usage of Phaser mechanics. Anyway, I'll be gratefull for any information. The matter: I got two separate files ("game.js" and "player.js"). While game.js used as a "state", player.js is just an attached library with some functions. There is hotkey binding in player.js, which is called in game.js within "update" property. You know, to make an object move around. But when the hotkey is pressed, there are from 60 to 150 identical assignments happens. It is about 100 times more on the average than is needed. Question: Is there a solution to make just one assignment? Additional information: I'll try to explain the whole structure in few words. In "game.js" there is variable with object ePow = { x: 100*(settable int), y: 100*(settable int), currentX: 0, currentY: 0 } It is called within "creaton" property of game.js from player.js's another prototype, but I think it isn't important. In "player.js" there is prototype "keybind", which contains creation of hotkeys, listeners for hotkeys and assignment functions. Points of interest within keybind: 1. this.(game.js's context with sprite object).velocity.x = (game.js's context).ePow.currentX; 2. function thrustLeft () { (game.js's context).ePow.currentX = (game.js's context).ePow.x * -1; 3. this.(hotkey).onDown.addOnce(thrustLeft); When hotkeys is pressed console shows me, that value was assignet for 127 times, for example. Help
×
×
  • Create New...