improve performance by using arcade Sprites instead of buttons, add win check and display winning, small fixes and improvements

This commit is contained in:
2025-11-08 15:48:24 +01:00
parent 96ebdef4e3
commit 5973d1143f
4 changed files with 66 additions and 25 deletions

View File

@@ -1,17 +1,17 @@
from game.cell import Cell
class House(Cell):
def __init__(self, left_neighbour, top_neighbour):
super().__init__("house", left_neighbour, top_neighbour)
def __init__(self, x, y, left_neighbour, top_neighbour):
super().__init__("house", x, y, left_neighbour, top_neighbour)
class PowerSource(Cell):
def __init__(self, left_neighbour, top_neighbour):
super().__init__("power_source", left_neighbour, top_neighbour)
def __init__(self, x, y, left_neighbour, top_neighbour):
super().__init__("power_source", x, y, left_neighbour, top_neighbour)
self.on_click = lambda e: self.next_rotation()
class PowerLine(Cell):
def __init__(self, cell_type, left_neighbour, top_neighbour):
super().__init__(cell_type, left_neighbour, top_neighbour)
def __init__(self, cell_type, x, y, left_neighbour, top_neighbour):
super().__init__(cell_type, x, y, left_neighbour, top_neighbour)
if not cell_type == "cross":
self.on_click = lambda e: self.next_rotation()