enabled tap to test

This commit is contained in:
Nicholas Dyer 2023-02-19 19:34:28 -05:00
parent 4442bed2c2
commit 36ca8638f6
No known key found for this signature in database
GPG Key ID: E4E6388793FA2105

View File

@ -20,8 +20,10 @@ class Dial(pygame.sprite.Sprite):
self.image = pygame.transform.rotate(self._base_image, self.rotation)
self.rect = self._base_image.get_rect()
self.test_cw = True
self.test = True
def update(self):
if self.test:
if self.test_cw:
self.position += 0.01
else:
@ -37,7 +39,8 @@ class Dial(pygame.sprite.Sprite):
self.rect = self.image.get_rect(center=self.rect.center)
self.rect.center = (math.sin(math.radians(self.rotation)) * -300 + 360,
math.cos(math.radians(self.rotation + 180)) * 300 + 360)
def set_test(self, test_value):
self.test = test_value
def main(windowed_mode):
pygame.init()
@ -74,6 +77,11 @@ def main(windowed_mode):
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE:
running = False
if event.type == pygame.MOUSEBUTTONDOWN:
dial.set_test(True)
if event.type == pygame.MOUSEBUTTONUP:
dial.set_test(False)
mouse_pos = pygame.mouse.get_pos()