class MainState(GameState): def next(self): self.updateState = True self.NextCurrentState = "Fase1" self.effect =2 def out (self): self.updateState = True self.NextCurrentState = "Quit" def escolaParticular(self): self.MainObjects[3].idle = self.MainObjects[3].click self.MainObjects[2].idle = self.MainObjects[2].oldIdle pass def escolaPublica (self): self.MainObjects[2].idle = self.MainObjects[2].click self.MainObjects[3].idle = self.MainObjects[3].oldIdle pass def __init__(self): self.forms = Form((490,233),195,fontsize=15,bg=(255,255,255),hlcolor=((90,40,40)),maxlines=1) self.forms.CURSOR = False #Carregando o vetor da fase pelo construtor self.backGround = Object("src/Fases/Main/fundo.png") self.MainObjects = [ObjectEvent((21,500), "src/Fases/Main/btnSair.png", "src/Fases/Main/btnSair_move.png", "src/Fases/Main/btnSair_click.png",self.out), ObjectEvent((875,470),"src/Fases/Main/btnJogar.png", "src/Fases/Main/btnJogar_move.png", "src/Fases/Main/btnJogar_click.png",self.next), ObjectEvent((320,376),"src/Fases/Main/btnEscolaPublica.png", "src/Fases/Main/btnEscolaPublica_click.png", "src/Fases/Main/btnEscolaPublica_click.png",self.escolaPublica), ObjectEvent((520,376),"src/Fases/Main/btnEscolaParticular.png", "src/Fases/Main/btnEscolaParticular_click.png", "src/Fases/Main/btnEscolaParticular_click.png",self.escolaParticular)] self.NextCurrentState = "Fase1" self.updateState = False self.effect = 0 pass def draw(self,tela): #Pintando o vetor da fase self.backGround.draw(tela) DrawVector(self.MainObjects,tela) self.forms.show() pass def event (self,event): #self.forms.wakeup(event) if event.type == pygame.MOUSEMOTION: for q in self.MainObjects: q.update(pygame.mouse.get_pos()) if event.type == pygame.MOUSEBUTTONDOWN: for q in self.MainObjects: q.clickStart(pygame.mouse.get_pos()) if event.type == pygame.MOUSEBUTTONUP: for q in self.MainObjects: if q.clickEnd(pygame.mouse.get_pos()): return def update(self,dt): pass pass