Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

Thanks for trying it, gimgangsan! sorry it didn't work for you!

The game tells the two Shift keys apart by the key code the browser reports. Could you open https://www.toptal.com/developers/keycode, press your right Shift and tell me what event.code shows? Also, which browser and keyboard are you using? If it says ShiftLeft, your browser or keyboard is reporting both Shifts as the left one (privacy-focused Firefox versions such as LibreWolf  do this with "resist fingerprinting" turned on. These hide which physical key was pressed). In that case, a regular Chrome, Edge or Firefox should work.

Do let me know!

Cheers!

I'm using chrome browser. But I'm not sure about the keyboard it was  just free gift for purchasing my computer.

Also event.code just blank. Also not sure why is this. Maybe just because it's cheap keyboard xD

{
 "key": "Shift",
 "keyCode": 16,
 "which": 16,
 "code": "",
 "location": 0,
 "altKey": false,
 "ctrlKey": false,
 "metaKey": false,
 "shiftKey": true,
 "repeat": false
}

Thanks for checking gimgangsan, that explains it! 

Your keyboard sends the right Shift without saying which Shift it is (code is empty and location is 0; a normal right Shift says ShiftRight / 2). 

Could you do the same test with your left Shift and tell me what it shows? If the left one says ShiftLeft, I can make the game treat an unidentified Shift as the right one, and it should work for you.

Good thing here, it is! Left shift is registered as ShiftLeft.

{
 "key": "Shift",
 "keyCode": 16,
 "which": 16,
 "code": "ShiftLeft",
 "location": 1,
 "altKey": false,
 "ctrlKey": false,
 "metaKey": false,
 "shiftKey": true,
 "repeat": false
}
(1 edit)

Thanks for confirming gimgangsan, that was exactly the clue I needed!

Your keyboard sends the right Shift without saying which side it is, so the game never saw it. I've just uploaded a fix: a Shift that doesn't identify itself now counts as the right one. 

Could you refresh the page and give it another try? I'd love to know if it works now.

It's working great! And the game is very fun :D

Just a minor issue: crouching (left shift hold) and dashing (right shift hold) do not respond right after the key is registered.

I guess it's because the code checks the elapsed time to distinguish tap and hold.

Not sure though, but I think making the tap event trigger when the key is released and the hold event trigger when the key is pressed (or check elapsed time for very short time) can solve this problem.

So glad it works now, and thank you for the kind words, gimgangsan! 

You're right about the cause: Shift does double duty (tap = lane change, hold = slide/sprint), so the game waits about a quarter of a second to tell them apart before showing the slide or sprint. 

Scoring uses the moment you pressed the key, though, so the delay is only visual and never costs you an obstacle. Starting the hold on key-down would make every lane change flash a slide first, so for the jam I'm keeping it as is. A small "anticipation" pose on key-down is on my list for after the jam. 

Thanks for such a thoughtful report! I really appreciate it! =)

Cheers!