DEV Community

Discussion on: Experimental Keyboard Game

Collapse
 
math2001 profile image
Mathieu PATUREL • Edited

Already addicted to this game! The idea of having at least 2 keys active is just great! 👍

A little dev note

e.keyCode (just has e.which) has been deprecated. Instead, you get to use some way cooler stuff: e.key, e.code: you don't get an integer like you would with keyCode or which, you get the actual pressed letter. Say you press d, you'd get:

e.key = 'd'
e.code = 'keyD'
Enter fullscreen mode Exit fullscreen mode

On any web page, open up the console and paste this so that you can see the different value it can take:

document.body.addEventListener('keydown', e => { console.log(e.key, e.code) })
Enter fullscreen mode Exit fullscreen mode

(try ctrl 😉)

I noticed it because it doesn't work on Firefox Nightly.

The font?

Could you try to change the font to a monospaced one so that we don't confound the 0 and o?

I am really liking this dev community, and am hoping to learn from and contribute to it.

Same. And I'm pretty sure it's what everyone feels when they discover this...

Current best score: 18

Collapse
 
aneelkkhatri profile image
Aneel Kumar

Thanks @math2001 for the feedback. I made the changes.
Thanks again :)