Android
Active member
- Joined
- Mar 6, 2007
- Messages
- 35
- Programming Experience
- 1-3
I'm writing a simple game and have a class for the ball. The constructor of this class sets the amount for the ball to increment each frame to make it move for both the x and y axis This is done with random numbers.
With one ball this all works fine but then if I call the class again for a second ball although everything still works the random numbers that are generated in this instance of the class are always exactly the same as the numbers that are generated for the first instance of this class. This means that both balls are always in the same place so you can only see one of them.
Is there anyway that I can make it so that the numbers generated by different instances of the class are different in every instance?
Thanks
With one ball this all works fine but then if I call the class again for a second ball although everything still works the random numbers that are generated in this instance of the class are always exactly the same as the numbers that are generated for the first instance of this class. This means that both balls are always in the same place so you can only see one of them.
Is there anyway that I can make it so that the numbers generated by different instances of the class are different in every instance?
Thanks