changed dial ring to blue

This commit is contained in:
Nicholas Dyer 2023-02-20 13:31:38 -05:00
parent c86374516e
commit f1ab4e7be6
No known key found for this signature in database
GPG Key ID: E4E6388793FA2105
2 changed files with 5 additions and 5 deletions

View File

@ -13,7 +13,7 @@ VALID_SURFACES = [
def main(windowed_mode=False): def main(windowed_mode=False):
""" """
Main looping method. Main scene manager to display the scenes of the application
:param windowed_mode: boolean to start the game in windowed mode :param windowed_mode: boolean to start the game in windowed mode
""" """
pygame.init() pygame.init()

View File

@ -18,7 +18,7 @@ class Dial(pygame.Surface):
def update(self): def update(self):
self.fill((0, 0, 0, 0)) self.fill((0, 0, 0, 0))
pygame.draw.circle(self, (0, 255, 0), self.center, self.dial_size / 2, 5) pygame.draw.circle(self, (64, 64, 255), self.center, self.dial_size / 2, 5)
if self.moving: if self.moving:
pygame.draw.circle(self, (48, 48, 48), self.center, self.dial_size / 2 * 0.95) pygame.draw.circle(self, (48, 48, 48), self.center, self.dial_size / 2 * 0.95)
else: else:
@ -29,7 +29,7 @@ class Dial(pygame.Surface):
y_1 = (-1 * math.sin(angle) * self.dial_size / 2 * 0.75) + (self.dial_size / 2) y_1 = (-1 * math.sin(angle) * self.dial_size / 2 * 0.75) + (self.dial_size / 2)
x_2 = (math.cos(angle) * self.dial_size / 2 * 0.99) + (self.dial_size / 2) x_2 = (math.cos(angle) * self.dial_size / 2 * 0.99) + (self.dial_size / 2)
y_2 = (-1 * math.sin(angle) * self.dial_size / 2 * 0.99) + (self.dial_size / 2) y_2 = (-1 * math.sin(angle) * self.dial_size / 2 * 0.99) + (self.dial_size / 2)
pygame.draw.line(self, (0, 255, 0), (x_1, y_1), (x_2, y_2), 10) pygame.draw.line(self, (64, 64, 255), (x_1, y_1), (x_2, y_2), 10)
def set_setting(self, new_setting): def set_setting(self, new_setting):
self.setting = max(0, min(new_setting, 1)) self.setting = max(0, min(new_setting, 1))
@ -52,8 +52,8 @@ class MouseHandler:
mouse_diff = (self.prev_mouse_pos[0] - self.mouse_pos[0], self.prev_mouse_pos[1] - self.mouse_pos[1]) mouse_diff = (self.prev_mouse_pos[0] - self.mouse_pos[0], self.prev_mouse_pos[1] - self.mouse_pos[1])
movement_speed = math.sqrt((mouse_diff[0] ** 2) + (mouse_diff[1] ** 2)) movement_speed = math.sqrt((mouse_diff[0] ** 2) + (mouse_diff[1] ** 2))
mouse_angle = math.atan2(self.mouse_pos[0] - center[0], self.mouse_pos[1] - center[1]) mouse_angle = math.atan2(self.mouse_pos[0] - center[0], self.mouse_pos[1] - center[1])
diff_angle = math.atan2(mouse_diff[0], mouse_diff[1]) mouse_diff_angle = math.atan2(mouse_diff[0], mouse_diff[1])
speed_coeff = math.cos((mouse_angle - (0.5 * math.pi)) - diff_angle) speed_coeff = math.cos((mouse_angle - (0.5 * math.pi)) - mouse_diff_angle)
return movement_speed * speed_coeff return movement_speed * speed_coeff