added test animation
This commit is contained in:
parent
f65bb04f5b
commit
8ee2660fb9
@ -15,8 +15,20 @@ class Dial(pygame.sprite.Sprite):
|
|||||||
self.max = (10.0 / 6.0) * PI
|
self.max = (10.0 / 6.0) * PI
|
||||||
self.min = (8.0 / 6.0) * PI
|
self.min = (8.0 / 6.0) * PI
|
||||||
self.value = 1
|
self.value = 1
|
||||||
|
self.reverse = True
|
||||||
def update(self):
|
def update(self):
|
||||||
|
if self.reverse:
|
||||||
|
self.value -= 0.01
|
||||||
|
else:
|
||||||
|
self.value += 0.01
|
||||||
|
|
||||||
|
if self.value < 0:
|
||||||
|
self.value = 0
|
||||||
|
self.reverse = not self.reverse
|
||||||
|
if self.value > 1:
|
||||||
|
self.value = 1
|
||||||
|
self.reverse = not self.reverse
|
||||||
|
|
||||||
self.image.fill((0, 0, 0))
|
self.image.fill((0, 0, 0))
|
||||||
pygame.draw.arc(self.image, (255, 255, 255), self.rect, self.min - (self.max * self.value), self.min, 32)
|
pygame.draw.arc(self.image, (255, 255, 255), self.rect, self.min - (self.max * self.value), self.min, 32)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user