X-Git-Url: https://harishankar.org/repos/?p=butaba-adventures.git;a=blobdiff_plain;f=level.py;h=e634b00bb5ac3b03b11d635c5f7e8c80c7581793;hp=4ba77a98dfcde327ceceb33b6e9195de3d52dfa2;hb=667ea7c15261100aae75b61de8664863b58f01e4;hpb=e233a6fc3203883436813db4a7a76242d77b6483 diff --git a/level.py b/level.py index 4ba77a9..e634b00 100644 --- a/level.py +++ b/level.py @@ -1,7 +1,5 @@ # level.py - level data and class -import object - # Background level data # A level is a list of list of tuples. Level is a 10x10 room of 48 pixel images # @@ -10,13 +8,11 @@ import object # second item is tile col in the tilest # third item defines whether solid or not (0 or 1) -# constants for in-game use -KEY_CHEST1 = 1000 -KEY_ROOM1 = 1001 # Class to represent levels class Level: - def __init__ (self, bgdata, levelleft=None, levelright=None, leveltop = None, levelbottom = None, objects=[]): + def __init__ (self, bgdata, levelleft=None, levelright=None, + leveltop = None, levelbottom = None, objects=[], npcs=[]): self.background = bgdata # portals for level above, below, left or right of the character self.levelleft = levelleft @@ -26,3 +22,6 @@ class Level: # objects in the level as a list self.objects = objects + + # npcs in the level as a list + self.npcs = npcs