Jump to content

Strange Keystroke Behavior


Heppell08
 Share

Recommended Posts

its not so much of an error, it can be worked around but wanted to know if anyone else has this problem.

In my game i looked at the Kern of Duty stuff and used the same methodology to code a bit of story into my game with a nice bit of the writing style used on the Kern file. 

I thought i'd make life a bit simpler and give it its very own js file so i could animate and play around a bit more indepth with it. Works perfectly.

Now my little observation is the key stroke input/update.

I have touch screen coding running throughout the game and figured, some people get a bit bored watching the cinematic in games (only from personal perspective anyway) so i added a timer and made some text visible after a certain time giving instruction on how to skip the scene if the player wanted to.

i created a quick button input variable and assigned it to spacebar. Added in the update loop after a given time that the button could be pressed and the game would begin. Strangely i auto skips after the timer even though i tell it to wait for either: 

justPressed or justReleased.

But it only works and doesn't skip if i set it to:

onDown;

Anyway here is the bit code i'm now using:

if(skipTimer > 50 && skipButton.isDown || this.input.activePointer.isDown)        {            this.game.state.start('Game');        }

If they get changed to released/pressed/onDown etc etc it auto skips. Any ideas? i mainly ask because i'd prefer the touch screen players to just 'tap' and the skip would commence.

Thanks :)

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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