def jogo(): """Esta função cria a cena inicial.""" INVENTARIO.inicia() invent = Elemento(img=inventario, tit="inventário", h=200, w=200) INVENTARIO.bota(invent) invent.elt.style.width = "60px" invent.elt.style.height = "60px" quest = Elemento(img=quest_img, tit="quest", h=200, w=200) INVENTARIO.bota(quest) option = Elemento(img=option_img, tit="options", h=200, w=200) INVENTARIO.bota(option) cenaIlha.meio = Cena() # criei uma cena falsa para usar o vai dela cenaIlha.meio.vai = gruta # o vai na verdade chama a função gruta okami1 = Elemento(img=linkOkami1, tit="Okami", y=400, x=170, h=200, w=200) okami1.entra(cenaIlha) waka1 = Elemento(img=linkWaka1, tit="Waka", y=340, x=305, h=250, w=200) waka1.entra(cenaIlha) txtwaka1 = Texto(cenaIlha, "Vamos para a ilha das deusas.") txtokami1 = Texto(cenaIlha, "Oi Waka.") txtokami2 = Texto(cenaIlha, "Então vamos.") textos_okami = [txtokami1, txtokami2] def fala_okami(_): global okami_fala textos_okami[okami_fala].vai() okami_fala -= 1 okami1.vai = fala_okami waka1.vai = txtwaka1.vai ark1 = Elemento(img=linkArk1, tit="Ark", y=450, x=40, h=150, w=500) ark1.entra(cenaIlha) cenaIlha.vai()
def __init__(self, cena=None): inv.inicia() self.mochila = cena or Cena(img=MOCHILA) self.mochila.vai() self.corda = Item(img=CORDA, cena=self.mochila) self.faca = Item(img=FACA, cena=self.mochila) self.fogo = Item(img=FOGO, cena=self.mochila) self.kit = Item(img=KIT, cena=self.mochila) self.mapa = Item(img=MAPA, cena=self.mochila) self.bussula = Item(img=BUSSULA, cena=self.mochila)
def Historia(): INVENTARIO.inicia() cenaMaracana = Cena(MARACANA) elementoFlamengo = Elemento(img=FLAMENGO, tit="Torcida do Flamengo", style=dict(left=150, width=60, heigth=70)) elementoBola = Elemento(img=BOLA, tit="Bola" style=dict(left=100, widht=40, height=50)) elementoFlamengo.entra(cenaMaracana) elementoBola.entra(cenaMaracana) def botainventario(): INVENTARIO.bota(elementoBola) txtflamengo = Texto(cenaMaracana, "Vamos Flamengo", foi=botainventario) elementoFlamengo.vai =txtflamengo.vai cenaBAR = Cena(BAR, direita=cenaMaracana) cenaMaracana.esquerda = cenaBAR cenaMaracana.vai()
def __init__(self): super().__init__(CENA_PARQUE) self.coisas = {} parque = self # Cena(CENA_PARQUE) INVENTARIO.inicia() participante = input("diga seu nome") score(carta=participante, _level=0) #INVENTARIO.elt.html = "PARQUE" nome = Codigo(codigo="", topo="PARQUE", style=dict(left=250, top=220, width=100, height="60px")) nome.entra(parque) Crianca(parque, tit="gosto de bicho", x=60, y=300, gosta="coelho passarinho") Crianca(parque, tit="gosto de esportes", x=150, y=300, gosta="bola peteca") Crianca(parque, tit="gosto de passear", x=270, y=300, gosta="") Crianca(parque, tit="gosto de frutas", x=400, y=300, gosta="maçã laranja") Crianca(parque, tit="gosto de calçado", x=480, y=300, gosta="tenis galocha") Fruta(parque, x=30, y=90) Fruta(parque, tit="laranja", imagem=LARANJA, x=330, y=60) Esportes(parque, x=100, y=150) Esportes(parque, tit="peteca", imagem=PETECA, x=500, y=35) Bicho(parque, x=150, y=80) Bicho(parque, tit="passarinho", imagem=PASSARINHO, x=400, y=60) Calcado(parque, x=450, y=100) Calcado(parque, tit="galocha", imagem=GALOCHA, x=200, y=50) parque.vai()
def __init__(self): super().__init__() INVENTARIO.inicia() #Corredor() Corredor.singleton_templo() _salas = { "salatemplo{}".format(n + 1): SalaTemplo(tema, x, y) for n, (tema, x, y) in enumerate([[OCEANO, 2, 2], [MUSICA, 3, 3], [MUSEU, 4, 4], [FLORESTA, 5, 5], [ESPORTE, 5, 5], [COZINHA, 6, 6]]) } _salas.update(corredor=Corredor._corredor) # [print(s, v) for s, v in _salas.items()] # return _design = [ ( 'corredor', dict(vai=_salas['salatemplo6'].abre, img=COZINHA, tit="cozinha", style=dict(left=680, top=160, width=60, height="80px")), ), ( 'corredor', dict(vai=_salas['salatemplo5'].abre, img=ESPORTE, tit="esporte", style=dict(left=760, top=160, width=60, height="80px")), ), ( 'corredor', dict(vai=_salas['salatemplo4'].abre, img=FLORESTA, tit="floresta", style=dict(left=180, top=160, width=60, height="80px")), ), ( 'corredor', dict(vai=_salas['salatemplo3'].abre, img=MUSEU, tit="museu", style=dict(left=600, top=160, width=60, height="80px")), ), ( 'corredor', dict(vai=_salas['salatemplo2'].abre, img=MUSICA, tit="musica", style=dict(left=260, top=160, width=60, height="80px")), ), ( 'corredor', dict(vai=_salas['salatemplo1'].abre, img=OCEANO, tit="oceano", style=dict(left=100, top=160, width=60, height="80px")), ), ( 'salatemplo1', dict(vai=_salas['salatemplo1'].vai, img=ALGA, tit="alga", style=dict(left=200, top=160, width=60, height="80px")), ), ( 'salatemplo1', dict(vai=_salas['salatemplo1'].vai, img=AQUARIO, tit="peixe", style=dict(left=100, top=160, width=60, height="80px")), ), ( 'salatemplo1', dict(vai=_salas['salatemplo1'].vai, img=CONCHA, tit="concha", style=dict(left=300, top=160, width=60, height="80px")), ), ( 'salatemplo2', dict(vai=_salas['salatemplo2'].vai, img=CORUJA, tit="coruja", style=dict(left=200, top=160, width=60, height="80px")), ), ( 'salatemplo2', dict(vai=_salas['salatemplo2'].vai, img=FLORES, tit="pato", style=dict(left=300, top=160, width=60, height="80px")), ), ( 'salatemplo2', dict(vai=_salas['salatemplo2'].vai, img=MACACO, tit="macaco", style=dict(left=100, top=160, width=60, height="80px")), ), ( 'salatemplo2', dict(vai=_salas['salatemplo2'].vai, img=PASSAROS, tit="passaros", style=dict(left=300, top=160, width=60, height="80px")), ), ( 'salatemplo2', dict(vai=_salas['salatemplo2'].vai, img=PATOS, tit="pato", style=dict(left=300, top=160, width=60, height="80px")), ), ( 'salatemplo3', dict(vai=_salas['salatemplo3'].vai, img=CHOCALHO, tit="chocalho", style=dict(left=100, top=160, width=60, height="80px")), ), ( 'salatemplo3', dict(vai=_salas['salatemplo3'].vai, img=HEADPHONES, tit="Headphones", style=dict(left=50, top=160, width=60, height="80px")), ), ( 'salatemplo3', dict(vai=_salas['salatemplo3'].vai, img=TAMBOR, tit="tambor", style=dict(left=300, top=130, width=30, height="80px")), ), ( 'salatemplo3', dict(vai=_salas['salatemplo3'].vai, img=VIOLAO, tit="violao", style=dict(left=200, top=160, width=60, height="80px")), ), ( 'salatemplo4', dict(vai=_salas['salatemplo4'].vai, img=COROA, tit="coroa", style=dict(left=50, top=160, width=60, height="80px")), ), ( 'salatemplo4', dict(vai=_salas['salatemplo4'].vai, img=LUNETA, tit="luneta", style=dict(left=300, top=130, width=60, height="80px")), ), ( 'salatemplo4', dict(vai=_salas['salatemplo4'].vai, img=RELOGIO, tit="relogio", style=dict(left=100, top=160, width=60, height="80px")), ), ( 'salatemplo4', dict(vai=_salas['salatemplo4'].vai, img=VASO, tit="vaso", style=dict(left=200, top=160, width=60, height="80px")), ), ( 'salatemplo5', dict(vai=_salas['salatemplo5'].vai, img=CADEIRA, tit="cadeira", style=dict(left=200, top=160, width=60, height="80px")), ), ( 'salatemplo5', dict(vai=_salas['salatemplo5'].vai, img=COZINHEIRA, tit="cozinheira", style=dict(left=50, top=160, width=60, height="80px")), ), ( 'salatemplo5', dict(vai=_salas['salatemplo5'].vai, img=FOGAO, tit="fogao", style=dict(left=300, top=130, width=60, height="80px")), ), ( 'salatemplo5', dict(vai=_salas['salatemplo5'].vai, img=PANELA, tit="panela", style=dict(left=100, top=160, width=60, height="80px")), ), ( 'salatemplo6', dict(vai=_salas['salatemplo6'].vai, img=BOLA, tit="bola", style=dict(left=50, top=160, width=60, height="80px")), ), ( 'salatemplo6', dict(vai=_salas['salatemplo6'].vai, img=LUVAS, tit="luvas", style=dict(left=200, top=160, width=60, height="80px")), ), ( 'salatemplo6', dict(vai=_salas['salatemplo6'].vai, img=RAQUETE, tit="raquete", style=dict(left=300, top=130, width=60, height="80px")), ), ] for sala, design in _design: _salas[sala].elemento(**design) Corredor._templo.vai()