Spikes, better gameHandler, map width and height computed automatically & big peanut hard map
This commit is contained in:
@@ -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,
|
||||
]
|
||||
@@ -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 "🏁"
|
||||
@@ -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 "🔥"
|
||||
Reference in New Issue
Block a user