From f1ab4e7be6155d8a63c8668a2c0a44431ece0719 Mon Sep 17 00:00:00 2001 From: nickedyer Date: Mon, 20 Feb 2023 13:31:38 -0500 Subject: [PATCH] changed dial ring to blue --- thermopi/main.py | 2 +- thermopi/surfaces/dial.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/thermopi/main.py b/thermopi/main.py index 8036986..183f83e 100644 --- a/thermopi/main.py +++ b/thermopi/main.py @@ -13,7 +13,7 @@ VALID_SURFACES = [ 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 """ pygame.init() diff --git a/thermopi/surfaces/dial.py b/thermopi/surfaces/dial.py index e6b3c30..189d18e 100644 --- a/thermopi/surfaces/dial.py +++ b/thermopi/surfaces/dial.py @@ -18,7 +18,7 @@ class Dial(pygame.Surface): def update(self): 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: pygame.draw.circle(self, (48, 48, 48), self.center, self.dial_size / 2 * 0.95) 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) 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) - 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): 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]) 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]) - diff_angle = math.atan2(mouse_diff[0], mouse_diff[1]) - speed_coeff = math.cos((mouse_angle - (0.5 * math.pi)) - diff_angle) + mouse_diff_angle = math.atan2(mouse_diff[0], mouse_diff[1]) + speed_coeff = math.cos((mouse_angle - (0.5 * math.pi)) - mouse_diff_angle) return movement_speed * speed_coeff