def __init__(self, fps=40): Engine.__init__(self, fps) try: import psyco psyco.profile() except ImportError: print "psyco not detected, if your game runs slowly try installing \ it from http://psyco.sourceforge.net." pygame.display.set_caption("Ascent of Justice") pygame.display.set_icon(data.icon)
def main(): e = Engine() WorldMap.mapname = "outside_temple.map" WorldMap.startpos = [25,16] e.DEFAULT = StartMenu e.fullscreen = True e.fps = 40 e.size = (800, 600) e.run()
def run(self): Engine.run(self)
if __name__=='__main__': from directicus.engine import Engine e = Engine() e.run()
self.keys[1] = 1 elif event.key == pygame.K_UP: self.keys[2] = 1 elif event.key == pygame.K_DOWN: self.keys[3] = 1 elif event.key == pygame.K_ESCAPE: import sys sys.exit() elif event.key in [pygame.K_LSHIFT,pygame.K_RSHIFT]: if self.selected: self.cursor = pygame.sprite.Sprite() self.cursor.image = self.selected.image.copy() self.cursor.rect = self.cursor.image.get_rect() self.cursor.rect.center = pygame.mouse.get_pos() def EVT_KeyUp(self,event): self.cursor = None if event.key == pygame.K_LEFT: self.keys[0] = 0 elif event.key == pygame.K_RIGHT: self.keys[1] = 0 elif event.key == pygame.K_UP: self.keys[2] = 0 elif event.key == pygame.K_DOWN: self.keys[3] = 0 if __name__=='__main__': e = Engine(40) e.DEFAULT = LevelEditor e.run()