def load_hazards(self): for obj in self.map.get_layer_by_name('hazards'): x, y, width, height = int(obj.x), int(obj.y), int(obj.width), int( obj.height) self.hazards[x, y] = Hazards.load(obj.type, Rect((x, y), (width, height)))
def load_ladders(self): for obj in self.map.get_layer_by_name('ladders'): x, y, width, height = int(obj.x), int(obj.y), int(obj.width), int( obj.height) self.ladders[x, y] = GameObject(Rect((x, y), (width, height)))
def in_view(self, rect): vrect = Rect((self.offset.x, self.offset.y), (self.size[0], self.size[1])) return rect.colliderect(vrect)
def load_sprites(self): image_at = self.spritesheet.image_at self.image = image_at(Rect((85, 0), (16, 16))) self.fill_sprites()
def load_sprites(self): image_at = self.spritesheet.image_at self.pellet_image = image_at(Rect((3, 2), (8, 6)), colorkey=-1)
def get_rect(self): return Rect((self.get_left(), self.get_top()), (self.get_width(), self.get_height()))