Avoidle Word Game is up!
Categories: gamedev javascript
I was able to finish a working version of the word game I've been working on for the past week or so, and I'm pretty happy with it. Technically it's still in the testing phase, but it is up and playable:
I really enjoyed making it, and my JavaScript / Jquery has improved immensely during the project. Some of the more challenging and interesting pieces were:
- Learning how to learn localStorage in order to save player stats. It can be a little finicky changing back and forth from strings using JSON.stringify and json objects using JSON.parse.
- Figuring out how to choose the same random 6 consonants for each player based on the current EST date. I mentioned this in my last blog post, but I ended up getting a suggestion from a fellow dev and was able to turn the date string into an md5 hash and then use that to generate the random consonants.
Let me know if you see any bugs or have any suggestions, as I'd love to hear them. I still have a few more things to complete such as adding settings (dark mode, hard mode etc.), but I hope to finish those soon.
Creating a Wordle-Inspired Word Game
Categories: gamedev javascript
Over the weekend, I was inspired by the sudden popularity (and enjoyment level) of Wordle, and decided to try to duplicate much of the functionality in HTML/CSS/JavaScript. I came up with a slightly different game where you are given 6 consonants (in red) and you have to try to come up with 4 five-letter words using as few of the red letters as possible, with a maximum of 20 points. I'm still working out some bugs, but it is playable in its current state. Feel free to check it out here:
https://codepen.io/Cal_Pal/full/GROEVGR
The most interesting and challenging part was figuring out how to select the random 6 letters based on the current day, and make them the same for each visitor. With some advice from a friend, I was able to implement the following method for this:
- Take the date string (i.e. 02142022) and generate an MD5 hash string from it.
- Split the hash into separate strings of 3 characters each
- Convert each 3 character string from hex to decimal and calculate modulo 21 (the number of consonants), then add these new numbers to an array
- Use the first 6 unique numbers from this array to get a consonant at that index
I'm honestly not sure if there will ever be a case where there are not enough unique numbers in this final array to get 6 "random" consonants, but I guess we will find out. If so, I'll need to use a longer hash somehow.
To do:
- Fix a bug where entering a word using the on-screen letter buttons and then pressing "Enter" will both submit the word and insert the focused letter intot the next available cell.
- Display instructions when the website is first visited, similar to Wordle
- Probably change the name of the game as well as the design
- Move the game from Codepen to my own website
0 Comments
Godot Game Dev
Categories: gamedev
I've also been working on learning Godot, a game development engine that a few of my dev friends are learning in order to make a game together. This week I've been following a tutorial to make an ARPG, and it's been going pretty smoothly. So far, I have a small 'level' scene, with a character that can move around, roll, and attack, as well as some enemies and destructable bushes.
(Not my art or animations, they came from the tutorial)
0 Comments
0 Comments