• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

My second Javascript Web-based game

Status
Not open for further replies.
Level 29
Joined
Jul 29, 2007
Messages
5,174
I suggest you to try making the same thing with canvas this time, just so you'd be able to see the difference and which one you like better.
Knowing a variety of ways to make something will lead to better choices in the future.

To check if a name is valid, use a regular expression. For example, /[a-zA-Z]+/.test(name) will tell you if it's only using the ABC. Regular expressions are great, so learning how to use them is important.
You are looping over the bad names, but then calling indexOf, which is a method of Array that already handles this looping. You can call it once.

And like I previously mentioned, put your code in an anonymous self-calling function, and only expose an API. As a punishment, I "won" with 999999 points :p
 
Last edited:
Level 5
Joined
Feb 1, 2009
Messages
111
Updated typing game with new visuals including font shine, better word focus recognition, better score tracking that takes into account accuracy, streak multiplier, more stat information at the end of your game, and the best part ...

If you check the console log at the end of your game it tells you how many points you scored for each word you typed.
 
Status
Not open for further replies.
Top