Added simple scripting for yaml files.
This commit is contained in:
parent
8355dccb33
commit
b332d579e9
6 changed files with 506 additions and 4 deletions
10
gamemap.py
10
gamemap.py
|
@ -411,11 +411,12 @@ class MapExit(Thing):
|
|||
|
||||
class MapEntrance(Thing):
|
||||
yaml_flag = u'!MapEntrance'
|
||||
defaultGraphic = ('clear', 'clear', 'x')
|
||||
# no graphic - should not be drawn
|
||||
|
||||
def __init__(self, x: int, y: int, exitid: int):
|
||||
if prefix:
|
||||
description = "{0} {1}".format(prefix, name)
|
||||
def __init__(self, x: int, y: int, exitid: int, name = None):
|
||||
if name == None:
|
||||
name = 'entrance {}'.format(exitid)
|
||||
super(MapEntrance, self).__init__('a', name, x, y, description, 1)
|
||||
self.exitid = exitid
|
||||
|
||||
|
@ -458,6 +459,7 @@ class GameMap(object):
|
|||
self.floorColors = []
|
||||
self.wallColors = []
|
||||
self.persistent = []
|
||||
self.enterScript = ''
|
||||
|
||||
@staticmethod
|
||||
def __cleanStr(text: str, end = '\n'):
|
||||
|
@ -674,6 +676,8 @@ list of lists of tuples."""
|
|||
level.playerStart = info['playerStart']
|
||||
if 'description' in info:
|
||||
level.description = info['description']
|
||||
if 'enterScript' in info:
|
||||
level.enterScript = info['enterScript']
|
||||
|
||||
# get map colors
|
||||
if 'floorColors' in info:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue