I'm using pygame to do all the drawing etc, but I've stumbled across a problem. I'm using a random number which then assigns a different colour to the Icon which gets spins. In other words, I draw 9 circles always in the same place, but then the colour changes depending on the random number.
I've done a little bit of testing, but the colours constantly change, and I don't know how to keep them the same, until the person presses spin again.
Note, my program is very bare as I was going to get it all drawn out then implement the game logic.
- Code: Select all
# Spin Icons
for i in range(1, 4):
for j in range(1, 4):
randIconColour = random.randrange(5) # Creates a random colour
randColour = [green, purple, yellow, blue, pink]
pygame.draw.ellipse(screen, randColour[randIconColour], [((85 * i) + (135 * (i - 1))), (117 * j), 80, 80])
This is the current code for drawing and creating the random colour, all of this is inside a game loop.
Thanks for any help, it would be much appreciated.