1 # level.py - level data and class
3 # Background level data
4 # A level is a list of list of tuples. Level is a 10x10 room of 48 pixel images
6 # every tuple represents a single background tile
7 # first item is tile row in the tileset
8 # second item is tile col in the tilest
9 # third item defines whether solid or not (0 or 1)
12 # Class to represent levels
14 def __init__ (self
, bgdata
, levelleft
=None, levelright
=None,
15 leveltop
= None, levelbottom
= None, objects
=[], npcs
=[]):
16 self
.background
= bgdata
17 # portals for level above, below, left or right of the character
18 self
.levelleft
= levelleft
19 self
.levelright
= levelright
20 self
.leveltop
= leveltop
21 self
.levelbottom
= levelbottom
23 # objects in the level as a list
24 self
.objects
= objects
26 # npcs in the level as a list