Add corner textures, and redo the folder layout. Doesnt work yet though.

This commit is contained in:
csd4ni3l
2025-11-06 20:17:23 +01:00
parent f9358df2b9
commit b246648099
19 changed files with 95 additions and 20 deletions

View File

@@ -1,4 +1,4 @@
import arcade, arcade.gui
import arcade, arcade.gui, random
from utils.constants import button_style
from utils.preload import button_texture, button_hovered_texture
@@ -13,6 +13,7 @@ class Game(arcade.gui.UIView):
self.pypresence_client.update(state='In Game', start=self.pypresence_client.start_time)
self.difficulty = difficulty
self.power_lines = []
self.anchor = self.add_widget(arcade.gui.UIAnchorLayout(size_hint=(1, 1)))
self.grid_size = list(map(int, difficulty.split("x")))
@@ -26,8 +27,19 @@ class Game(arcade.gui.UIView):
self.anchor.add(self.back_button, anchor_x="left", anchor_y="top", align_x=5, align_y=-5)
for row in range(self.grid_size[0]):
self.power_lines.append([])
for col in range(self.grid_size[1]):
self.power_grid.add(PowerLine(), row=row, column=col)
left_neighbor = self.power_lines[row][col - 1] if col > 0 else None
top_neighbor = self.power_lines[row - 1][col] if row > 0 else None
power_line = PowerLine(random.choice(["line", "corner"]), left_neighbor, top_neighbor)
self.power_grid.add(power_line, row=row, column=col)
self.power_lines[row].append(power_line)
if left_neighbor:
left_neighbor.right_neighbor = power_line
if top_neighbor:
top_neighbor.bottom_neighbor = power_line
def main_exit(self):
from menus.main import Main