def __init__(self): self.trilha = trilhacaverna = Cena(TRILHACAVERNA) INVENTARIO.inicia() #trilhacaverna.vai() aranha = Elemento(ARANHA, cena=trilhacaverna, x=400, y=150, w=200, h=200) cobra = Elemento(COBRA, cena=trilhacaverna, x=800, y=450, w=400, h=200) setadireita = Elemento(SETADIREITA, cena=trilhacaverna, x=1100, y=450, w=200, h=100) setaesquerda = Elemento(SETAESQUERDA, cena=trilhacaverna, x=30, y=480, w=100, h=100) setadireita.vai = self.dir_vai setaesquerda.vai = cavernaamigo.vai chave = Elemento(CHAVE, cena=trilhacaverna, tit="chave", drag=True, x=500, y=450, w=100, h=50) chave.vai = lambda *_: INVENTARIO.bota(chave)
class Doca: def __init__(self, universo, left="300px", top="300px"): self.universo = universo self.doca = Elemento(DOCA, x=left, y=top, w=200, h=300, vai=self.pega, style={"transform": "rotate(300deg)"}) self.longe = Cena() self.na_mao = False self.doca.entra(self.universo) def pega(self, _): self.doca.vai() self.doca.vai = self.guarda
class Foguete: def __init__(self, universo, left=200, top=50): self.universo = universo self.foguete = Elemento(FOGUETE, x=left, y=top, w=150, h=150, vai=self.pega) self.longe = Cena() self.na_mao = False self.foguete.entra(self.universo) def pega(self, _): self.foguete.vai() self.foguete.vai = self.guarda
class Menudeanimais: def __init__(self, universo, left=200, top=50): self.universo = u = universo self.longe = Cena() self.na_mao = False self.left, self.top = left, top def abre(self): left, top, u = self.left, self.top, self.universo self.menudeanimais = Elemento(MENUDEANIMAIS[0], x=left -170, y=top, w=60, h=60, vai=self.pega, cena=u) self.menudeanimais = Elemento(MENUDEANIMAIS[1], x=left +40, y=top +1, w=60, h=60, vai=self.pega, cena=u) self.menudeanimais = Elemento(MENUDEANIMAIS[2], x=left-30, y=top +1, w=60, h=60, vai=self.pega, cena=u) self.menudeanimais = Elemento(MENUDEANIMAIS[3], x=left -100, y=top, w=60, h=60, vai=self.pega, cena=u) #self.menudeanimais.entra(self.universo) def pega(self, _): self.menudeanimais.vai()
class Menudepessoas: def __init__(self, universo, left=200, top=50): self.universo = universo self.left, self.top = left, top def abre(self): left, top, u = self.left, self.top, self.universo self.menudepessoas = Elemento(MENUDEPESSOAS[0], x=left -170, y=top +50, w=60, h=60, vai=self.pega,cena=self.universo) self.menudepessoas = Elemento(MENUDEPESSOAS[1], x=left +30, y=top +50, w=60, h=60, vai=self.pega,cena=self.universo) self.menudepessoas = Elemento(MENUDEPESSOAS[2], x=left -40, y=top +50, w=60, h=60, vai=self.pega,cena=self.universo) self.menudepessoas = Elemento(MENUDEPESSOAS[3], x=left -260, y=top +50, w=80, h=80, vai=self.pega,cena=self.universo) self.menudepessoas = Elemento(MENUDEPESSOAS[4], x=left -110, y=top +50, w=60, h=60, vai=self.pega,cena=self.universo) self.longe = Cena() self.na_mao = False # self.menudeobjetos.entra(self.universo) def pega(self, _): self.menudepessoas.vai()
def __init__(self, parque, jogo, tit="joana", x=400, y=470): tit = input("escreva seu nome") self.jogo = jogo Texto(parque, UMTEXTO).vai() self.parque, self.tit = parque, tit escolhas = {"letra_a": self.a, "letra a": self.a} crianca = Elemento(CENA_CRIANCA, tit=tit, x=x, y=y, w=100, h=100, drop=escolhas, style={"opacity": 0.2}) crianca.entra(parque) crianca.vai = self.a
def __init__(self): self.cavernatesouro = cavernatesouro = Cena(CAVERNATESOURO) codigo = Codigo("", "", cena=cavernatesouro, style=dict(x=400, y=300)) tesouro = Elemento(TESOURO, x=245, y=200, w=700, h=400) tesouro.vai = lambda *_: tesouro.entra(cavernatesouro) def troca(*_): cavernatesouro.meio = tesouro codigo = Texto( cavernatesouro, "Opa!! Você achou o tesouro!!", "Mas, cuidado: ao decidir pegar o tesouro, seu amigo não poderá ser salvo", style=dict(x=400, y=300), foi=troca) cavernatesouro.meio = codigo
#from _spy.vitollino.main import Cena, STYLE, Codigo #STYLE["width"], STYLE["height"] = 1200, "650px" #from elemento.main import Elemento FUNDODOMAR = "https://imgur.com/Mc6ktz2.png" ESMERALDA = "https://imgur.com/SuPb9Wa.png" MAPA = "https://imgur.com/SuPb9Wa.png" PERGAMINHO = "https://i.imgur.com/6pz0aHn.png" AGUAVIVA = "https://i.imgur.com/7aIQZcW.png" PEIXE = "https://i.imgur.com/toGygPm.gif" fundodomar = Cena(FUNDODOMAR) fundodomar.vai() mapa = Elemento(MAPA, x=700, y=100, w=150, h=150) esmeralda = Elemento(ESMERALDA, cena=fundodomar, x=600, y=500, w=50, h=50) pergaminho = Elemento(PERGAMINHO, cena=fundodomar, x=1000, y=100, w=100, h=100) aguaviva = Elemento(AGUAVIVA, cena=fundodomar, x=200, y=250, w=300, h=200) peixe = Elemento(PEIXE, cena=fundodomar, x=700, y=250, w=200, h=100) def mostra_mapa(*_): mapa.entra(fundodomar) def vai_perigo(*_): from perigo1.main import Perigo Perigo().vai() mapa.vai = vai_perigo pergaminho.vai = mostra_mapa