Nearly Finished!
Devlog #5
Apples!
The snake now has some food that appears on the screen. Not much to say here about the feature, it’s snake! But the implementation is a little bit more interesting. In computers, random numbers aren’t much of a thing, so you’ll usually have to settle for pseudo random numbers, but, CPUs today have an RDRAND instruction for generating random numbers from thermal noise and whatnot inside the CPU. but even though it’s on practically every chip today, I still opted not to use it, because
- Unseeded, so you can’t make a game seed or stuff like that, and
- They aren’t present on processors before 2012!
And we want this snake to be able to run on the original i386, don’t we?
So instead I decided to use a simple pseudo random number generator I just whipped up on the spot by multiply the seed by some big numbers and xor’ing it with itself a couple times. it’s definitely not cryptographically secure, but it’s snake, so whatever.
What next?
Now that the game is done, I’m gonna add a couple more features just so the game is a bit more more comfortable to play. I plan on adding:
- Centering the game screen (For obvious reasons)
- Restart button (so you don’t have to reboot the emulator) (Or if anyone runs this bare metal for some reason, the computer)
- Choosing colors (Because fun!)
- Button queuing (for convenience)
- Maybe some visual flair (like drawing the snake as thin, some sprites if I can figure those out, and stuff like that)
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.