Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, filename):
tm = pytmx.load_pygame(filename, pixelalpha=True)
self.width = tm.width * tm.tilewidth
self.height = tm.height * tm.tileheight
self.tmxdata = tm
self.matrix = [[0 for x in range(tm.width)] for y in range(tm.height)]
self.blue_spawns = []
self.red_spawns = []
def __init__(self, filename):
self.init_buffer([screen.get_width() / 2, screen.get_height() / 2])
tmx_data = pytmx.load_pygame("desert.tmx")
map_data = pyscroll.TiledMapData(tmx_data)
self.map_layer = pyscroll.BufferedRenderer(map_data, self.buffer_size)
f = pygame.font.Font(pygame.font.get_default_font(), 20)
t = ["scroll demo. press escape to quit",
"arrow keys move"]
self.text_overlay = [f.render(i, 1, (180, 180, 0)) for i in t]
self.center = [self.map_layer.width/2,self.map_layer.height/2]
self.camera_vector = [0, 0, 0]
self.running = False
def __init__(self, filename):
tm = pytmx.load_pygame(filename, pixelalpha=True)
self.size = tm.width * tm.tilewidth, tm.height * tm.tileheight
self.tmxdata = tm
def __init__(self, gameScreen):
self.gameMap = pytmx.load_pygame("Map/tileMaps/world.tmx", pixelalpha=True)
self.width = self.gameMap.width
self.height = self.gameMap.height
self.screenSize = gameScreen.get_size()
self.tileSize = 48
self.collisionRects = []
self.minigamePortal = []
self.informationTiles = []
self.destinations = {}
self.universities = []
self.teleports = []
self.npc = []
self.bank = []
self.slotmachine = []
for r in self.gameMap.get_layer_by_name("Collision"):
def __init__(self, filename):
tm = pytmx.load_pygame(filename, pixelalpha=True)
self.width = tm.width * tm.tilewidth
self.height = tm.height * tm.tileheight
self.tmxdata = tm