def __init__(self, start_position, locations, path): path = module_path_to_os_path(path) self.locations = map(lambda nab: map(lambda location: path + location, nab), locations) self.x, self.y = start_position self.spawn_point = 'right' self.hero = 'Parzalon' self.keyboard = Keyboard_Handler() self.mouse = Mouse_Handler() self.scroller = layer.ScrollingManager()
# -*- coding: utf-8 -*- import os from pyglet import image from registry.utility import module_path_to_os_path from body import Body from registry.bodypart import * from registry import BASE Chest = BASE['Chest'] Head = BASE['Head'] Legs = BASE['Legs'] __author__ = 'Ecialo' path = module_path_to_os_path(__name__) class Human(Body): anim = {'walk': image.load(path + "walk.png"), 'stand': image.load(path + "stand.png"), 'jump': image.load(path + "stand.png"), 'sit': image.load(path + "sit.png")} parts_pos = {'walk': [(LEGS, (0, -77)), (CHEST, (0, 0)), (HEAD, (0, 57))], 'stand': [(LEGS, (0, -77)), (CHEST, (0, 0)), (HEAD, (0, 57))], 'jump': [(LEGS, (0, -77)), (CHEST, (0, 0)), (HEAD, (0, 57))], 'sit': [(LEGS, (0, -77)), (CHEST, (0, 0)), (HEAD, (0, 17))]} img = anim['stand'] base_speed = 7