Make cells modular, add crosses and t junctions and houses which have example texture and dont work yet, improve code quality, fix cell texture not being the same when pressed

This commit is contained in:
csd4ni3l
2025-11-07 18:16:57 +01:00
parent edfad0e426
commit 17d66d5da0
16 changed files with 163 additions and 134 deletions

17
game/cells.py Normal file
View File

@@ -0,0 +1,17 @@
from game.cell import Cell
class House(Cell):
def __init__(self, left_neighbour, top_neighbour):
super().__init__("house", left_neighbour, top_neighbour)
class PowerSource(Cell):
def __init__(self, left_neighbour, top_neighbour):
super().__init__("power_source", 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)
if not cell_type == "cross":
self.on_click = lambda e: self.next_rotation()