Why Nostr? What is Njump?
2024-01-30 17:07:08
in reply to

npub1rg…sc7mc on Nostr: Tried to add random enemy placement to the dungeon, but they all appear in the same ...

Tried to add random enemy placement to the dungeon, but they all appear in the same room. I realize that the common way to do RNG in C and C++, srand(time(NULL)) uses time (in seconds) as a seed, and since the loop obviously runs multiple times per second, I'm getting the same results.

I think my solution would be to use my own RNG algorithm with a seed that increments every time it is called.

#gamedev #SFML

Author Public Key
npub1rgmp94lme55llcytua0qq3zm0dwl7xsrmz3mxvsnhckrdsywdgvq6sc7mc