r/howdidtheycodeit • • Jul 21 '22

Question How did they code samurai kirby?

https://youtu.be/cRqnnme1q74
27 Upvotes

16 comments sorted by

View all comments

Show parent comment

3

u/Hexatona Jul 21 '22

Did the NES have randomness though?

if it didn't, it likely had some kind of table for how long to delay "!" for, that it would iterate through for the appearance of randomness.

11

u/Slime0 Jul 21 '22

All you need for randomness is a starting number and an iterative algorithm for changing it each time you need a random number. LCGs are a common, simple approach that work well for games. The starting number can be fixed, but I believe Tetris on the NES used the time at which the player first presses start to initialize it.

5

u/[deleted] Jul 21 '22

Games often implemented their own PRNG, like this

2

u/Putnam3145 IndieDev Jul 22 '22

This is a SNES game, but PRNGs had been in use for a looong time even before the NES was a thing