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
+3 -1
View File
@@ -2,10 +2,12 @@ from .stoneBlock import StoneBlock
from .spawnPointBlock import SpawnPointBlock
from .finishBlock import FinishBlock
from .coinBlock import CoinBlock
from .spikesBlock import SpikesBlock
BLOCKS = [
StoneBlock,
SpawnPointBlock,
FinishBlock,
CoinBlock
CoinBlock,
SpikesBlock,
]
+1 -1
View File
@@ -16,8 +16,8 @@ class FinishBlock(Block):
return False
def on_collision(self, gameState: GameState):
gameState.set_stop_game(True)
gameState.set_game_won(True)
gameState.set_stop_game(True)
def to_string(self):
return "🏁"
+24
View File
@@ -0,0 +1,24 @@
import os
from game.blocks.block import Block
from game.gameState import GameState
class SpikesBlock(Block):
@property
def character(self):
return '^'
@property
def type(self):
return 'spikes'
@property
def solid(self):
return False
def on_collision(self, gameState: GameState):
gameState.set_game_won(False)
gameState.set_stop_game(True)
def to_string(self):
return "🔥"