Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MAP_WIDTH = 46
- MAP_HEIGHT = 20
- smap = ['##############################################',
- '####################### #################',
- '##################### # ###############',
- '###################### ### ###########',
- '############################# ####',
- '################ ######## ###### ####',
- '############### #################### ####',
- '################ ###### ##',
- '######## ####### ###### # # # ##',
- '######## ###### ### ##',
- '######## ##',
- '#### ###### ### # # # ##',
- '#### ### ########## #### ##',
- '#### ### ########## ###########=##########',
- '#### ################## ##### #####',
- '#### ### #### ##### #####',
- '#### # #### #####',
- '######## # #### ##### #####',
- '######## ##### ####################',
- '##############################################',
- ]
- class Tile:
- #a tile of the map and its properties
- def __init__(self, blocked, block_sight = False):
- self.blocked = blocked
- #by default, if a tile is blocked, it also blocks sight
- if block_sight == False: block_sight = blocked
- self.block_sight = block_sight
- def make_map():
- global map, player
- #fill map with "blocked" tiles
- map = [[Tile(False)
- for y in range(MAP_HEIGHT) ]
- for x in range(MAP_WIDTH) ]
- for yy in range (MAP_HEIGHT):
- for xx in range (21):
- if smap[yy][xx]=='#':
- map[yy][xx]=Tile(True)
- make_map()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement