From 7cbc496619b2718a9207d2ec96c2919f6a9ede37 Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 21 Mar 2024 08:13:44 -0500 Subject: [PATCH] Removed useless call to super().__init__() in Cell.__init__() --- conway.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conway.py b/conway.py index f068276..3e8a4e6 100644 --- a/conway.py +++ b/conway.py @@ -17,7 +17,7 @@ class Colors(Enum): @dataclass class Render_Info: - screen_dimensions: XYPair = XYPair(300,300) + screen_dimensions: XYPair = XYPair(1000,1000) padding: XYPair = XYPair(1, 1) background_color = Colors.BLACK.value @@ -38,7 +38,6 @@ class Cell: calculate_spacing(self.position.y, self.dimensions.y, padding.y)) def __init__(self, position: XYPair, dimensions: XYPair, render_info: Render_Info, state: CellStates=CellStates.DEAD) -> None: - super().__init__() self.crowding_number = 0 self.position = position self.dimensions = dimensions @@ -130,6 +129,7 @@ class Board: cell.draw(screen) def handle_click(self, mouse_pos, render_info): + def pixel_to_index(x, w, p): return floor((x - p)/(w + 2*p)) @@ -157,7 +157,7 @@ class Board: def main(): render_info: Render_Info = Render_Info() screen = pygame.display.set_mode(render_info.screen_dimensions) - board = Board(XYPair(20, 20), render_info) + board = Board(XYPair(50, 50), render_info) pygame.display.set_caption("Conway's Game of Life") clock = pygame.time.Clock()