Spikes, better gameHandler, map width and height computed automatically & big peanut hard map

This commit is contained in:
2026-10-10 16:21:11 +02:00
parent 14a39b7154
commit 17f00ebca2
12 changed files with 131 additions and 37 deletions
+2 -2
View File
@@ -13,11 +13,11 @@ from game.blocks.block import Block
class Map:
def __init__(self, map_data: dict):
self.name = map_data.get('name', 'Unknown')
self.width = int(map_data.get('width', 0))
self.height = int(map_data.get('height', 0))
self.difficulty = float(map_data.get('difficulty', 0.0))
self.min_moves = map_data.get('min_moves', None)
self.layout = map_data.get('layout', [])
self.width = max(len(row) for row in self.layout) if self.layout else 0
self.height = len(self.layout) if self.layout else 0
def get_block_at(self, x, y) -> Block | None:
if 0 <= x < self.width and 0 <= y < self.height: