Add demo GIF, Hot Air Baloon, add a way to customize notification timeout, rows and columns, make main menu buttons smaller, fix tetris not updating info label after restart

This commit is contained in:
csd4ni3l
2025-09-21 21:02:48 +02:00
parent 183eca33c5
commit 944b5ab212
13 changed files with 240 additions and 79 deletions

View File

@@ -17,6 +17,9 @@ class Game(arcade.gui.UIView):
self.running = True
self.last_update_time = time.perf_counter()
with open("settings.json", "r") as file:
self.settings = json.load(file)
if not os.path.exists("data.json"):
self.data = {}
else:
@@ -111,7 +114,7 @@ class Game(arcade.gui.UIView):
self.shape_tuple = self.create_shape(int(10 / 2), 0, self.shape_to_place)
def on_update(self, delta_time):
if self.running and time.perf_counter() - self.last_update_time >= 0.4:
if self.running and time.perf_counter() - self.last_update_time >= self.settings.get("notification_timeout", 0.4):
self.last_update_time = time.perf_counter()
self.move_shape(*self.shape_tuple, 0, 1)
@@ -175,6 +178,8 @@ class Game(arcade.gui.UIView):
self.spawn_shape()
self.info_label.text = "Use arrow keys or WASD to move the blocks\nThe game is shown inside notifications."
self.running = True
elif symbol == arcade.key.SPACE:
self.shape_tuple = self.rotate_shape(*self.shape_tuple)