Hi all,
I have a game with all the main code inside a while loop. What I want to do is generate a set of random x and y coordinates for say, 5 rectangles, and then redraw those rectangles in the same position each time the screen is cleared and everything's updated. How do I do that without it recalculating the random values each time?
I tried using something like
But that caused the program to freeze when I tried to run it (I'm using OS X Leopard 1.5.2, if that's important).
Any help anybody has would be appreciated.
Bookworm
I have a game with all the main code inside a while loop. What I want to do is generate a set of random x and y coordinates for say, 5 rectangles, and then redraw those rectangles in the same position each time the screen is cleared and everything's updated. How do I do that without it recalculating the random values each time?
I tried using something like
If gen = 0 [all the random code] gen = 1 EndIf
But that caused the program to freeze when I tried to run it (I'm using OS X Leopard 1.5.2, if that's important).
Any help anybody has would be appreciated.
Bookworm