def __init__(self,parque, tit="tenis", imagem=TENIS, x=300, y=350): #tenis = Elemento(TENIS, x=150, y=210, w=50, h=80) #tenis.entra(parque) self.parque, self.tit = parque, tit galocha = Elemento(imagem, tit=tit, x=x, y=y, w=60, h=50, drag=True, vai=self.click) galocha.entra(parque) parque.cadastra(tit, galocha)
class Banana: def __init__(self, floresta_inicio): self.floresta_inicio = floresta_inicio self.fala = Texto(self.floresta_inicio, TEXTO_BANANA) self.falou = Texto(self.floresta_inicio, BANANA_FOI) self.banana = Elemento(BANANA, x=230, y=500, style=dict(width="50px"), vai=self.pega) self.longe = Cena() self.na_mao = False self.banana.entra(self.floresta_inicio) def pega(self, _): self.fala.vai() self.banana.vai = self.guarda def guarda(self, _): INVENTARIO.bota(self.banana) self.falou.vai() self.banana.vai = self.usa def come(self, _): self.banana.entra(self.longe) self.falou.vai() def usa(self, _): self.na_mao = True self.usar.vai()
class Cobra: def __init__(self, floresta_inicio): self.floresta_inicio = floresta_inicio self.fala = Texto(self.floresta_inicio, TEXTO_COBRA) self.cobra = Elemento(COBRA, style=dict(left="800px", top="400px", width="150px")) if "antidoto" in INVENTARIO.item: INVENTARIO.item["antidoto"].vai = self.antidoto self.cobra.entra(floresta_inicio) self.cobra.vai = self.falacobra self.mordida = Elem(MORDIDA, x=0, y=0, w=1400, h=650, style={"opacity": 0.5}, tipo="100% 100%") #, vai=self.antidoto) def vai(self): self.floresta_inicio.vai() def falacobra(self, _): self.mordida.entra(self.floresta_inicio) self.fala.vai() def antidoto(self, _): self.mordida.entra(Cena()) Texto(self.floresta_inicio, "Você toma o antídoto e fica curado").vai()
def __init__(self, parque, tit="coelho", imagem=COELHO, x=40, y=40): #coelho = Elemento(COELHO, x=100, y=100, w=60, h=40) #coelho.entra(parque) self.parque, self.tit = parque, tit passarinho = Elemento(imagem, tit=tit, x=x, y=y, w=70, h=50, drag=True, vai=self.click) passarinho.entra(parque) parque.cadastra(tit, passarinho)
def __init__(self, pescaria, nome="balde", tipo_peixe="grande", x=350, y=200): #tit quando arrastar o mouse em cima, surge o nome self.peixes = pescaria.peixes(tipo_peixe).keys() todos = [peixe for tam in "pequno médio grande".split() for peixe in pescaria.peixes(tam).keys()] balde = Elemento(BALDE, x=x, y=y, tit=nome, w=100, h=100, style={"opacity": 0}, drop = {peixe: self.pesca for peixe in todos}, vai=self.olha) self.tipo = tipo_peixe balde.entra(pescaria) self.pescaria = pescaria self.texto = Texto(pescaria, f"Eu sou um {nome}")
def __init__(self, personagem): # -XXX- tem que passar o personagem aqui self.personagem = personagem dragger = dict(Aninha=self.entra_porta) self.porta = Elemento(img=PORTA, tit="portela", drop=dragger, style=dict(left=170, top=260, width=55, height="150px"))
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
def __init__(self, universo): self.universo = universo """ self.fala = Texto(self.universo, TEXTO_FACA) self.falou = Texto(self.universo, FACA_FOI) self.usar = Texto(self.universo, FACA_USA) """ self.terra = Elemento(TERRA, x=800, y=180, w=450, h=400, vai=self.pega) self.longe = Cena() self.na_mao = False self.terra.entra(self.universo)
class Macaca: def __init__(self, aqui): self.aqui = aqui self.macaca = Elemento(MACACA_MAE, x=600, y=480, w=200, h=200) def vai(self): self.macaca.entra(self.aqui) Texto( self.aqui, "Você encontra a mãe do macaquinho e finaliza sua aventura! Parabéns!" ).vai()
def __init__(self, parque, tit="maria", x=0, y=420): self.parque, self.tit = parque, tit escolhas = {"geleia de uva": self.uva, "jarra de mel": self.mel} crianca = Elemento(CRIANCA, tit=tit, x=x, y=y, w=140, h=280, drop=escolhas, style={"opacity": 0.3}) crianca.entra(parque)
def __init__(self, esquerda=None): # floresta_leao = FlorestaLeao() -XX- ERRO! self.floresta_inicio = None floresta_leao = CenaProxy(self.floresta_inicio) esquerda = esquerda or floresta_leao self.floresta_inicio = Cena(FLORESTA, esquerda=esquerda, direita=floresta_leao) floresta_leao.aqui = self.floresta_inicio faca = Faca(self.floresta_inicio) self.lanterna = Elemento (LANTERNA,tit="lanterna", drag=True, cena = self.floresta_inicio, x=300, y=500, vai=self.guarda) self.capa_de_chuva = Elemento (CAPA_DE_CHUVA, tit="capa de chuva", drag=True, cena = self.floresta_inicio, x=200, y=300, vai=self.guardacapa) self.corda = Elemento (CORDA, tit="corda", drag=True, cena = self.floresta_inicio, x=850, y=350, vai=self.guardacorda) self.antidoto = Elemento(ANTIDOTE, tit="antidoto", drag=True, cena = self.floresta_inicio, x=700, y=480, w=80, vai=self.pegaant)
def __init__(self, floresta_inicio): self.floresta_inicio = floresta_inicio self.fala = Texto(self.floresta_inicio, TEXTO_BANANA) self.falou = Texto(self.floresta_inicio, BANANA_FOI) self.banana = Elemento(BANANA, x=230, y=500, style=dict(width="50px"), vai=self.pega) self.longe = Cena() self.na_mao = False self.banana.entra(self.floresta_inicio)
def __init__(self, floresta_inicio): self.floresta_inicio = floresta_inicio self.fala = Texto(self.floresta_inicio, TEXTO_FACA) self.falou = Texto(self.floresta_inicio, FACA_FOI) self.usar = Texto(self.floresta_inicio, FACA_USA) # self.faca = Elemento(FACA, style=dict(left="200px", width="80px"), vai=self.pega) drag = dict(faca=lambda *_: self.fala.vai()) self.faca = Elemento(FACA, tit="faca", x=600, y=500, w=80, vai=self.pega) # self.leao = Elemento(LEAO, tit="leao", x=800, y=500, w=180, drop=drag, cena=floresta_inicio) self.longe = Cena() self.na_mao = False self.faca.entra(self.floresta_inicio)
def __init__( self, imagem=ANA_MARIA, nome="Ola, eu sou a Ana Paula é um prazer estar com vocês, sou mestra e professorA DE BIOLOGIA e estou aqui para ajudar vocês nos conceitos de genéticas e nas provas que terão, aprendendo de uma maneira divertida" ): nome = "Aninha" # -XXX- O nome, isto é o tit do elemento tem que ser Aninha porque foi o que usou no dropper self.ana_maria = Elemento(img=imagem, tit=nome, drag=True, style=dict(left=250, top=330, width=200, heigth="1000px"))
def __init__(self, vit): self.vit = vit self.porta = vit.sala.C.sul self.amilase = Elemento(AMILASE, tit="Amilase Sintética", drag=True) self.cola = Elemento(COLA, tit="Cola Glicosada", drop={"Amilase Sintética": self.abre}, cena=self.porta, x=375, y=300, w=75, h=100, style={"opacity": 0.5}) inv.bota(self.amilase)
def __init__(self): self.ilhamar =ilhamar = Cena(ILHAMAR) # praia = Elemento(PRAIA, cena=ilhamar, x=700, y=398, h=900, style=dict(width= 500, height="650px")) # ilhamar.vai() boia = Elemento(BOIA, cena=ilhamar, x=30, y=100, w=100) boia2 = Elemento(BOIA, cena=ilhamar, x=100, y=250, w=100) boia3 = Elemento(BOIA, cena=ilhamar, x=200, y=400, w=100) boia4 = Elemento(BOIA, cena=ilhamar, x=320, y=550, w=100) boia6 = Elemento(BOIA, cena=ilhamar, x=500, y=80, w=100) boia7 = Elemento(BOIA, cena=ilhamar, x=700, y=200, w=100) boia8 = Elemento(BOIA, cena=ilhamar, x=900, y=300, w=100) boia9 = Elemento(BOIA, cena=ilhamar, x=1100, y=400, w=100) redemoinho = Elemento(REDEMOINHO, cena=ilhamar, x=400, y=300, w=120, tipo="100% 30%", vai=self.vai_fundo) self.tubarao = Elemento(TUBARAO, cena=ilhamar, x=700, y= 500, w=150, style={"opacity":0.2}, vai=self.tub)
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
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 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
def __init__(self, cena): """ Cria a cena de um acampamento com tesouros """ self.tesouro = 4 super().__init__(cena) #self.pedra = Elemento(TURQUESA, x=50, y=250, w=40, h=40, cena=self) self.pedras = [Elemento( TURQUESA, x=50+50*pedra, y=250, w=40, h=40, cena=self) for pedra in range(self.tesouro)]
class Porta(): def __init__(self, personagem): # -XXX- tem que passar o personagem aqui self.personagem = personagem dragger = dict(Aninha=self.entra_porta) self.porta = Elemento(img=PORTA, tit="portela", drop=dragger, style=dict(left=170, top=260, width=55, height="150px")) def entra(self, lugar): self.porta.entra(lugar) def entra_porta(self, evento, nome): self.personagem.some()
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()
def __init__(self, floresta_inicio): self.floresta_inicio = floresta_inicio self.biscoito = Elemento(BISCOITO, x=850, y=500, style=dict(width="50px"), vai=self.pega) self.rede = Elemento(REDE, x=750, y=450, w=200, h=200, drop={"faca": self.corta}) self.fala = Texto(self.floresta_inicio, TEXTO_REDE) self.longe = Cena() self.na_mao = False self.biscoito.entra(self.floresta_inicio)
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, quantas_pedras=4): """ Inicia aa coleção de padras com uma quantidade :param int quantas_pedras: numero de pedras neste tesouro """ # = MODELO Conceitual = self.tesouro_contabil = quantas_pedras # = VISTA = Modelo visual de como apresentar o tesouro self.limbo_onde_as_pedras_desaparecem = Cena() self.pedras_especificas = [Elemento( TURQUESA, x=50+50*pedra, y=250, w=40, h=40) for pedra in range(self.tesouro_contabil)]
def __init__(self, congresso): # -XXX- tem que passar o congresso aqui # self.foi,congresso.oeste.vai=congresso.SALA3.vai,self.vai self.aqui = aqui = congresso.oeste self.foi, self.aqui.vai = self.aqui.vai, self.vai self.c = Elemento( img=GABI, tit= "Oiiii, meu nome é Gabi e estou estudando sobre cruzamento de genes e vi que se uma pessoa te AA e outra Aa então seus futuros filhos serão 50% AA e 50% Aa", style=dict(left=50, top=350, width=400, height="200px"), vai=self.acertou) self.b = Elemento( img="https://i.imgur.com/Q5PcxvC.png", tit= "Aqui é a Tássia e vamos agilizando porque eu não tenho tempo,pois o tempo é evolução e eu preciso me modificar para me adaptar", style=dict( left=400, top=350, width=300, height="200px", ), vai=self.errou) self.a = Elemento( img="https://i.imgur.com/bO9jojz.png", tit= "Coé lek. Meu nome é Alan e eu sei que se eu tenho várias tatuagens meus futuros filhos nasceram tatuados", style=dict(left=700, top=350, width=400, height="200px"), vai=self.errou) self.a.entra(congresso.oeste) self.b.entra(congresso.oeste) self.c.entra(congresso.oeste)
def __init__(self, congresso): # tem que passar o congresso aqui #self.foi,congresso.sul.vai=congresso.SALA2.vai,self.vai self.aqui = aqui = congresso.leste self.foi, self.aqui.vai = self.aqui.vai, self.vai self.c = Elemento( img="https://i.imgur.com/MUrxyGb.png", tit= "Tassia sou eu e digo que as borboletas são adaptadas ao ambiente, quanto mais poluído o ambiente mais cinza", style=dict(left=50, top=350, width=400, height="200px"), vai=self.errou) self.b = Elemento( img="https://i.imgur.com/Oo1sn9s.png", tit= "As borboletas dos países frios são menos coloridas do que o Brasil pois não pegam sol.", style=dict( left=400, top=350, width=300, height="200px", ), vai=self.errou) self.a = Elemento( img="https://i.imgur.com/bO9jojz.png", tit= "descobri que as borboletas podem sofrer mutações sobre alguma dessas fases e não chegar até o ultimo estágio ou morrer antes mesmo de completar a vida adulta", style=dict(left=700, top=350, width=400, height="200px"), vai=self.acertou) self.a.entra(congresso.leste) self.b.entra(congresso.leste) self.c.entra(congresso.leste)
def __init__(self, congresso): # tem que passar o congresso aqui #self.foi,congresso.sul.vai=congresso.SALA4.vai,self.vai -XXX- o certo seria congresso.sul.vai, optei por algo uniforme self.aqui = aqui = congresso.sul self.foi, self.aqui.vai = self.aqui.vai, self.vai self.c = Elemento( img="https://i.imgur.com/bO9jojz.png", tit= "Como vocês já me conhecem e percebi que quando duas pessoas se conhecem elas começam a se adaptar umas as outras fazendo com que seu DNA mude por transmissão de pensamento", style=dict(left=50, top=350, width=400, height="200px"), vai=self.errou) self.b = Elemento( img="https://i.imgur.com/94lhgKo.png", tit= "OIe eu sou o Carlo e sei que quando um ser vivo(seres humanos, plantas etc) fica exposto a radiação ou algum produto químico por muito tempo pode ocorre mutação no DNA da pessoa fazendo com que a pessoa tenha alguma doença ou passe para os seus filho", style=dict( left=400, top=350, width=300, height="200px", ), vai=self.acertou) self.a = Elemento( img="https://i.imgur.com/Oo1sn9s.png", tit= "OIii sou a Letícia e descobri que quando se come maçã estragada isso pode modificar seu DNA pelas proteínas e enzimas que soltam no seu estômago passam para o sangue e vão até o núcleo das células alterando a sintese de proteínas do corpo", style=dict(left=700, top=350, width=400, height="200px"), vai=self.errou) self.a.entra(congresso.sul) self.b.entra(congresso.sul) self.c.entra(congresso.sul)
class Faca: def __init__(self, floresta_inicio): self.floresta_inicio = floresta_inicio self.fala = Texto(self.floresta_inicio, TEXTO_FACA) self.falou = Texto(self.floresta_inicio, FACA_FOI) self.usar = Texto(self.floresta_inicio, FACA_USA) # self.faca = Elemento(FACA, style=dict(left="200px", width="80px"), vai=self.pega) drag = dict(faca=lambda *_: self.fala.vai()) self.faca = Elemento(FACA, tit="faca", x=600, y=500, w=80, vai=self.pega) # self.leao = Elemento(LEAO, tit="leao", x=800, y=500, w=180, drop=drag, cena=floresta_inicio) self.longe = Cena() self.na_mao = False self.faca.entra(self.floresta_inicio) def pega(self, _): INVENTARIO.bota(self.faca) self.faca.do_drag(True) #self.fala.vai() self.faca.vai = self.guarda def guarda(self, _): INVENTARIO.bota(self.faca) self.falou.vai() self.faca.vai = self.usa def chuta(self, _): self.faca.entra(self.longe) self.falou.vai() def usa(self, _): self.na_mao = True self.usar.vai()