def main(): Controller = Con.Control(c.CAPTION) '''add states to control''' state_dict = { c.MAIN_MENU: menu.Menu(), c.LOAD_SCREEN: load_screen.LoadScreen(), c.LEVEL1: level1.Level1(), c.GAME_OVER: load_screen.GameOver() } Controller.setup_state(state_dict, c.MAIN_MENU) Controller.loop()
def __init__(self, player=None, enemy1=None, enemy2=None, enemy3=None): Globals.battle = self self.b1 = UI.Button(3, 33, None, True) self.b2 = UI.Button(3, 41, None, False) self.b3 = UI.Button(44, 33, None, False) self.b4 = UI.Button(44, 41, None, False) self.currentbutton = self.b1 self.downbox = UI.Static(0, 31, 'bottombox') self.upbox = UI.Static(0, 0, 'upperbox') self.bars = UI.Static(0, 26, 'statusbars') self.uptext = DrawableObject.Text(2, 2, '') self.downtext1 = DrawableObject.Text(3, 33, '') self.downtext2 = DrawableObject.Text(3, 41, '') self.o1 = DrawableObject.Text(13, 33, 'attack') self.o2 = DrawableObject.Text(13, 41, 'skills') self.o3 = DrawableObject.Text(54, 33, 'items') self.o4 = DrawableObject.Text(54, 41, 'status') self.enemyarrow = UI.Static(40, 10, 'enemyarrow', False) self.hpbar = UI.PixelBar(2, 30, 20) self.mpbar = UI.PixelBar(62, 30, 20) self.player = player self.enemy1 = enemy1 self.enemy2 = enemy2 self.enemy3 = enemy3 self._currenttarget = enemy1 if self.enemy1 is not None: self.enemy1.x = 34 self.enemy1.y = 13 if self.enemy2 is not None: self.enemy2.x = 9 self.enemy2.y = 13 if self.enemy3 is not None: self.enemy3.x = 59 self.enemy3.y = 13 self.turnorder = [] self.battleover = False self.c = Controller.Control() self.action = None self.orderqueue = [player, enemy1, enemy2, enemy3] self.orderqueue.sort(key=lambda x: x.current_dex(), reverse=True)
def __init__(self): self.controller = Controller.Control() self.indexOfGraph = 0