import FSM import utils as u import menus as m import pygame import sys #==================================== State = type("State", (object,), {}) #==================================== class State(object): def __init__(self, FSM): self.FSM = FSM def Enter(self): pass def Execute(self): pass def Exit(self): pass class Exit(State): def __init__(self,FSM): super(Exit, self).__init__(FSM) def Enter(self): o = self.FSM.owner o.draw.rectangle((0, 0, o.width, o.height), outline=0, fill=o.blue) o.center_block("goodbye", o.h2, [0, 0, o.width,o.height], o.light_grey) o.update_display(0) pygame.quit() sys.exit() super(Exit, self).Enter() def Execute(self): self.FSM.stateLife += 1 def Exit(self): pass