Jump to content

Broken Tutorials?


Recommended Posts

I'm digging through the input tutorials. These don't work in my browser(Chrome). Tried with Edge - same thing.

keyboard-justpressed  << but works through localhost

override-default-controls << doesn't work even through localhost


Error: Uncaught TypeError: game.input.keyboard.justPressed is not a function.

or other input stuff that are not a function.


I tried this in my game:

upKey = game.input.keyboard.addKey(Phaser.Keyboard.W);downKey = game.input.keyboard.addkey(Phaser.Keyboard.S);leftKey = game.input.keyboard.addKey(Phaser.Keyboard.A);ightKey = game.input.keyboard.addKey(Phaser.Keyboard.D);                                               

And it works. game.input.keyboard.createCursorKeys(); works, too. That's how I had it at first.



Figured it out. Some previous version of Phaser had justPressed which in a newer version was updated to downDuration. And I saw that it's fixed in the source code at github. The one on the site is outdated. As for the override-default-controls tutorial, I've proposed some changes on gitHub.

Everything's fine. :)

Link to comment
Share on other sites


  • Recently Browsing   0 members

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