koala wrote:I didn't play this Snake that much, just to see are things working fine (apparently they are not
). I've played original Snake a long time ago and I was good, but I don't remember the highscore.
It seems rand() is good enough for block position randomization
.
Game I am currently working on is a card game and it'll take some time to finish it.
Hi Koala,
On my new test game in development, I have a prize that I plan to have appear in a different spot in the maze each time it's hit by the player, and while I have a functioning solution ready to use, I would like to learn a new way of doing it, with your game Snake as inspiration.
I was wondering how you are able to get the block to appear at different, random spots on the map each time it's caught?
I checked the code of the player and the block, but didn't find where you might have the code for random placement, rand(); to make the target block appear in random spots each time.
If you have a brief tip you can share about how to get the block to appear in a random spot each time it's contacted, that would be a help, but only if you have time for a short answer. I know you're busy on your new projects, so no hurry. Thanks!