Fixed bug, and changed colours
This commit is contained in:
6
game.py
6
game.py
@ -40,7 +40,7 @@ class Game(gameUtils.Game):
|
|||||||
circleR = self.wheelSurf.size[0] / 2
|
circleR = self.wheelSurf.size[0] / 2
|
||||||
|
|
||||||
# Draw the base circle
|
# Draw the base circle
|
||||||
pygame.draw.circle(self.wheelSurf, (100, 100, 100), (circleR, circleR), circleR)
|
pygame.draw.circle(self.wheelSurf, (25, 25, 25), (circleR, circleR), circleR)
|
||||||
# Calculate the gap, in radians, between each item
|
# Calculate the gap, in radians, between each item
|
||||||
gap = maths.pi * 2 / len(items)
|
gap = maths.pi * 2 / len(items)
|
||||||
|
|
||||||
@ -52,12 +52,12 @@ class Game(gameUtils.Game):
|
|||||||
# Calculate the end position of a line based on the vector
|
# Calculate the end position of a line based on the vector
|
||||||
endPos = np.add(np.multiply(vector, circleR), circleR)
|
endPos = np.add(np.multiply(vector, circleR), circleR)
|
||||||
# Draw the dividing line
|
# Draw the dividing line
|
||||||
pygame.draw.line(self.wheelSurf, (c, 0, 0), (circleR, circleR), endPos)
|
pygame.draw.line(self.wheelSurf, (128, 128, 128), (circleR, circleR), endPos)
|
||||||
|
|
||||||
# Create a surface that our text will be rendered onto
|
# Create a surface that our text will be rendered onto
|
||||||
textSurf = pygame.Surface(self.wheelSurf.size, pygame.SRCALPHA)
|
textSurf = pygame.Surface(self.wheelSurf.size, pygame.SRCALPHA)
|
||||||
# Render the item text
|
# Render the item text
|
||||||
text = font.render(item, True, (0, 0, 255))
|
text = font.render(item, True, (255, 255, 255))
|
||||||
# Draw the item text onto the text surface, centred to the right
|
# Draw the item text onto the text surface, centred to the right
|
||||||
textSurf.blit(text, (textSurf.size[0]-text.get_width(), self.size[1]//2 - text.get_height()//2))
|
textSurf.blit(text, (textSurf.size[0]-text.get_width(), self.size[1]//2 - text.get_height()//2))
|
||||||
# Draw debug lines
|
# Draw debug lines
|
||||||
|
|||||||
Reference in New Issue
Block a user