DEV Community

Aneel Kumar
Aneel Kumar

Posted on

Experimental Keyboard Game

As my first article in here, I would like to share a simple game I had created sometime ago KeysHit.

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

Keep inspiring!

Top comments (23)

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 :)

Collapse
 
ben profile image
Ben Halpern

This is very cool. And I'm terrible at it. I bet @peter would like this.

Collapse
 
peter profile image
Peter Kim Frank

This is a really fun and inventive game. I'd say it's 90% about concentration and only 10% about typing, as all of my mistakes come from going "too fast" and not leaving enough keys up.

I think it'd be interesting to create a "survival mode" where order doesn't matter, but the slots fill up super quickly and you have to keep them clear them before the entire fills up (and the game ends).

My current high score is 23 โ€” take that @math2001 :)

Collapse
 
ben profile image
Ben Halpern

Yeah, it really has all the makings of an addictive one!

Thread Thread
 
aneelkkhatri profile image
Aneel Kumar

I myself find it challenging and addictive :)

Collapse
 
vasilvestre profile image
Valentin Silvestre

Wrong key!

SCORE: 51

I love it.

Collapse
 
aneelkkhatri profile image
Aneel Kumar

My highest score so far: 94

Collapse
 
vasilvestre profile image
Valentin Silvestre

111 now :D

Collapse
 
writingmetier profile image
WritingMetier

We are now looking for any specific edutools for youngsters. What do you think if we share it in our next article on the website? Your feedback will be appreciated

Collapse
 
tracypholmes profile image
Tracy Holmes

Ooooh this is an evil game. I think I've found something to try on my break(s)!

Collapse
 
codemouse92 profile image
Jason C. McDonald

Wow, this is deceptively hard!

I'm hoping you'll share a bit in the community (other articles perhaps?) about some of the challenges you faced in creating this?

Collapse
 
heabaw profile image
heabaw

I have known this site previously yet, it didn't slump on giving more data to its visitors. kamapisachi

Collapse
 
andy profile image
Andy Zhao (he/him)

Nice! That was a lot harder than I thought. Super clean design.

Collapse
 
gmartigny profile image
Guillaume Martigny

Whoa, you've really awaken the bot on this post !!

Collapse
 
lita7 profile image
Lita

This is the best informative post and I am glad to see this kind of brilliant informative post.
couponstechie.com/promo-codes/avg

Some comments may only be visible to logged-in visitors. Sign in to view all comments.