class Item: def __init__(self, img, cena): self.cena = cena self.item = Elemento(img=img) self.item_inv = Elemento(img=img) # self.corda_inv.vai=self.mostra_corda inv.bota(self.item_inv) self.item_inv.vai = self.mostra_item self.item.vai = self.some_item def mostra_item(self, _=0): self.item.entra(self.cena) def some_item(self, _=0): self.item.x = -10000
def familia(): arvore = Cena(img=ARVORE) arvore.vai() mae = Elemento(img=MAE, tit="Mother", style=dict(left=120, top="270px", width=80, height="100px")) eu = Elemento(img=EU, tit="I", style=dict(left=40, top="450px", width=100, height="100px")) mae_text = Texto(arvore, "Mother") eu_text = Texto(arvore, "I") mae.vai = mae_text.vai eu.vai = eu_text.vai eu.entra(arvore) mae.entra(arvore)
def game(): pantano = Cena(img=PANTANO) cidade = Cena(img=CIDADE) casa = Cena(img=CASA) castelo = Cena(img=CASTELO) pantano.direita = cidade cidade.direita = casa casa.direita = castelo #volta ao inicio castelo.direita = pantano castelo.esquerda = casa casa.esquerda = cidade cidade.esquerda = pantano yoda = Elemento(img=YODA, tit="DJ Yoda", style=dict(left=300, top=100, width=150, height="100px")) yoda.entra(pantano) NOME = input("Qual é o seu nome?") falayoda = Texto( pantano, "Olá, " + NOME + " quer ir ao baile?" ) #"Sexta-feira... Vou chamar o Homem Aranha pra dar um rolé!") yoda.vai = falayoda.vai homemaranha = Elemento(img=HOMEMARANHA, tit="Homem Aranha Boyzão", style=dict(left=200, top=100, width=150, height="100px")) homemaranha.entra(cidade) falaaranha = Texto( cidade, "Ih, caraca, " + NOME + "! É nóis! Vou levar a Barbie também!") homemaranha.vai = falaaranha.vai barbie = Elemento(img=BARBIE, tit="Barbie Boladona", style=dict(left=400, bottom=100, width=100, height="100px")) barbie.entra(casa) falabarbie = Texto(casa, "Mozão me ligou, aonde será que ele vai me levar?") barbie.vai = falabarbie.vai galera = Elemento(img=GALERA, tit="Galera do baile", style=dict(left=250, top=50, width=300, height="100px")) galera.entra(castelo) falagalera = Texto(castelo, "Esse é o baile dos PIEs") galera.vai = falagalera.vai pantano.vai()
class inicialesquerda(): def __init__(self): self.fundo = Cena(FUNDO) self.zero = Elemento (INICIOMONTANHA, x=230 , y=620, cena=self.fundo, vai=self.comeca) self.bonequinha = bonequinha(self.fundo, 1) self.cf = dict(A=-1.350, B=-4) #self.planocartesiano = buscar uma imagem self.bonequinha = bonequinha(self.fundo) self.comeca() def comeca(self, *_): self.bonequinha.x = 200 self.mais = Texto(self.fundo, txt = "Clique aqui", foi=self.foi, A="-1,3655", B="-4") self.mais.vai() def foi(self,opcao): self.bonequinha.a = self.cf [opcao] self.bonequinha.x = 200 self.bonequinha.y = 620 self.bonequinha.aparece() self.cf = dict(A = "(2,3)" def vai(self): self.fundo.vai() class bonequinha(): def __init__(self,fundo, opcao): self.x = 50 self.c = 500 self.a = opcao y = self.a*self.x+self.c self.boneca = Elemento(BONEQUINHA, h=250 , w=250, x=self.x, y=y) self.boneca.o = 0 self.boneca.y = self.a*self.x+self.c self.boneca.x = self.x self.boneca.vai = self.equacao1 self.boneca.entra(fundo) def aparece(self): self.boneca.o = 1 def equacao1(self,*_): self.boneca.x = self.x = self.x +5.457 self.boneca.y = self.a*self.x - self.c if __name__ == "__main__": inicialesquerda().vai()
class Foguete: def __init__(self, universo, left="300px", top="300px"): self.universo = universo self.foguete = Elemento(FOGUETE, style=dict(left=left, top=top, width="100px", height="280px"), 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 Historia(): cenaTowertitan = Cena( img= "https://www.google.com.br/url?sa=i&source=images&cd=&cad=rja&uact=8&ved=2ahUKEwiuo7fonJ7hAhWFD7kGHfJ_ChYQjRx6BAgBEAU&url=http%3A%2F%2Fforums.daybreakgames.com%2Fdcuo%2Findex.php%3Fthreads%2Fnew-teen-titans-tower-look.296433%2F&psig=AOvVaw0VUZ1umKrPFlebIBx6AdDT&ust=1553635326971397" ) night_wing = Elemento(img=elemento_night_wing, tit="Night Wing one", style=dict(left=100, top=60, width=60, heigt=150)) night_wing.entra(cenaTowertitan) txtNight_Wing = Texto( cenaTowertitan, "Tom decided to roam the world. It combined with Joe and Huck to make a pirate adventure. The three friends decided to go to an island. The fish slept and ate the fish, back to town their relatives were very worried thinking they were dead." ) night_wing.vai = txtNight_Wing.vai cenaTowertitan.vai()
def criarcenas(): casa = Cena(img=CASA) casapordentro = Cena(img=CASAPORDENTRO) casa.direita = casapordentro tarzan = Elemento(img=TARZAN, tit="Tarzan", style=dict(left="100px", top="100px", width="130px", height="220px")) tarzan.entra(casapordentro) etarzan = Texto(casapordentro, "Onde estou? Essa não é minha casa!") tarzan.vai = etarzan.vai casa.vai()
class Criarcenas(): def __init__(self): self.ilha = Cena(img=ilha) self.habbo = Elemento(img=habbo, style=dict(left=100, right=100, top=100, bottom=100)) self.habbo.entra(self.ilha) def escreve(x): self.escreve = input("usando string") self.habbo.escreve() self.ilha.vai()
class Doca: def __init__(self, universo, left="300px", top="300px"): self.universo = universo self.doca = Elemento(DOCA, style=dict(left=left, top=top, width="100px", height="250px"), vai=self.pega) self.longe = Cena() self.na_mao = False self.doca.entra(self.universo) def pega(self, _): self.doca.vai() self.doca.vai = self.guarda
def Historia(): cenaFloresta = Cena( img= "https://upload.wikimedia.org/wikipedia/commons/f/f5/Floresta_de_Chantilly.JPG" ) gokudeussupersayjin = Elemento(img=GOKU, tit=" goku deus super sayjin", style=dict(left=150, top=100, width=60, height=200)) gokudeussupersayjin.entra(cenaFloresta) txtGoKu = Texto(cenaFloresta, "Hello") gokudeussupersayjin.vai = txtGoKu.vai cenaFloresta.vai()
class Estacao: def __init__(self, universo, left="300px", top="300px", icone=PESSOA, itens=[]): def add(valor, num): return "{}px".format(int(valor[:-2]) + num) 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.estacao = Elemento(ESTACAO, style=dict(left=left, top=top, width="200px"), vai=self.pega) self.icone = Elemento(icone, style=dict(left=add(left, 50), top=add(top, 50), width="50px", height="50px"), vai=self.pega) self.longe = Cena() self.na_mao = False self.estacao.entra(self.universo) self.icone.entra(self.universo) def pega(self, _): 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()
def Historia(): cenaPraia = Cena(PRAIA) elementoEstrela = Elemento(img=ESTRELA, tit="Estrela do mar", style=dict(left=12, width=60, height=48)) elementoConcha = Elemento(img=CONCHA, tit="Concha", style=dict(left=65, top=210, bottom=50, width=35, height=10)) elementoEstrela.entra(cenaPraia) elementoConcha.entra(cenaPraia) cenaMar = Cena(MAR, direita=cenaPraia) cenaPraia.esquerda = cenaMar cenaPraia.vai()
def game(): mesa_de_cha = Cena(img=MESA_DE_CHA) floresta = Cena(img=FLORESTA) cidade = Cena(img=CIDADE) casinha = Cena(img=CASINHA) mesa_de_cha.direita = floresta floresta.direita = cidade cidade.direita = casinha casinha.esquerda = cidade cidade.esquerda = floresta floresta.esquerda = mesa_de_cha tarzan = Elemento(img=TARZAN, tit="Tarzan", style=dict(left=15, top=180, width=100, height="200px")) tarzan.entra(mesa_de_cha) mesa_de_cha.vai()
class Altar: def __init__(self, oracao, x, y, ix, iy, cena): self.icone = icon self.oracao_, self.local, self.ix, self.iy = oracao, cena, ix, iy self.altar = Elemento(MARCA, x=x, y=y, w=250, h=150, o=0.2, cena=cena, drop=dict(icone=self.orar)) self.limbo = Cena() def orar(self, *_): def fim(*_): inv.bota(self.icone) self.altar.entra(self.limbo) def bencao(*_): #inv.tira("icone") self.altar.entra(self.limbo) self.icone.entra(self.limbo) Texto( inv.cena, "Que a graça de Nosso Senhor Jesus Cristo esteja com você!" ).vai() "Depois de trinta anos de estudos, consegui terminar a minha tradução da Bíblia" def ora(): oracao = self.oracao_.pop(0) Texto(inv.cena, oracao).vai() return dict(tit=oracao, ) oracao = self.oracao_.pop(0) local = self.local inv.tira("icone") self.icone.entra(local) self.icone.x = self.ix self.icone.y = self.iy self.icone.w = 60 self.icone.h = 80 Texto(local, oracao, foi=lambda *_: fim() if self.oracao_ else bencao()).vai()
class Jesus: def __init__(self): self.lugar1=Cena(img=LUGAR1) self.lugar2=Cena(img=LUGAR2) self.lugar3=Cena(img=LUGAR3) self.lugar4=Cena(img=LUGAR4) self.lugar5=Cena(img=LUGAR5) self.lugar6=Cena(img=LUGAR6) self.lugar7=Cena(img=LUGAR7) self.jesus=Elemento(img=JESUS) self.personagem=Elemento(img=PERSONAGEM) self.personagem.entra(self.lugar1) self.lugar1.vai() self.Primeira_pergunta.vai() def Primeira_pergunta()
def criarEstoria(): fogo = Cena(img=FOGO) agua = Cena(img=AGUA) fogo.direita = agua humano = Elemento(img=HUMANO, tit="humano", style=dict(left=400, width=400, hight=400, bottom=400, top=50)) humano.entra(fogo) ehumano = Texto(fogo, "quero agua") humano.vai = ehumano.vai areia = Cena(img=AREIA) agua.direita = areia fogo.vai()
def teorias(): inicio = Cena(img=NEWTON) inicio_t = Texto(inicio, "A gravidade da situação está em tornar tudo um material de consumo") iluminatti = Texto (inicio, "Ahhh mas disso você já sabia!") inicio_e = Elemento (img = MACA, tit="Gravidade", style = dict(left= 70,top=170, width=50, height=200,bottom=100)) #personagem = Elemento (img = linkpersonagem, tit="garotinho", style = dict(left= 150, top=100, width=60, height=200)) lado1 = Cena(img=GALILEU, direita =inicio) lado1_e = Elemento(img=ILUMINATTI, tit='O universo não gira em torno de você não,bb', style = dict(left= 150, top=240, width=40, height=200, bottom=100)) iluminatti = Texto (inicio, "Ahhh mas disso você já sabia!") inicio_e.entra(inicio) inicio_e.vai = inicio_t.vai #inicio.vai = inicio_tt.vai inicio.esquerda = lado1 lado1_e.vai = iluminatti.vai lado1_e.entra(lado1) inicio.vai()
def historia(): cena1 = Cena(img=Canil) rato1 = Elemento(img=rato, txt="GATO", style=dict(top=100, left=100, width=200)) gato1 = Elemento(img=gato, txt="RATO", style=dict(top=100, left=300, width=200)) rato1.entra(cena1) gato1.entra(cena1) gato_fala = Texto(cena1, "vou comer você!") rato_fala = Texto(cena1, "SOCORRO NAO ME COME") rato1.vai = rato_fala.vai gato1.vai = gato_fala.vai #resposta=input("Voce fez fogo usando pedras! Como vc fez?") cena1.vai()
def __init__ (self): congresso = doidera().congresso estagiario = Elemento(img=ESTAGIARIO,tit="Elton" style=dict(left=100, top=10, width=60, height="60px")) estagiario.entra(congresso.norte) garca1 = Elemento(img=GARCA1, tit="modificada", style=dict(left=102, top=11, width=60, height="60px")) garca2 = Elemento(img=GARCA2, tit="modificada", style=dict(left=90, top=12, width=60, height="60px")) garca3 = Elemento(img=GARCA3, tit="modificada", style=dict(left=109, top=15, width=60, height="60px")) garca1.entra(congresso.norte) garca2.entra(congresso.norte) garca3.entra(congresso.norte) congresso.norte.vai()
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): #primeira cena (onde está localizado as duas opções self.cena = cena = Cena(img="https://i.imgur.com/S5tAUe8.png") #opção 2 certo op2 = Elemento(img="https://i.imgur.com/dVn8Gfo.png", x=700, y=350, w=450, h=150, tit="Clique") #cena que direciona a opção 2 cena2 = Cena(img="https://i.imgur.com/IYekltO.png") #emoji de ok ok = Elemento(img="https://i.imgur.com/jR7lluz.png") ok.entra(cena2) ok.vai = cena.vai #opção 1 errado op1 = Elemento(img="https://i.imgur.com/lN2umME.png", x=150, y=350, w=450, h=150, tit="Clique") #cena que direciona a opção1 cena3 = Cena(img="https://i.imgur.com/aN24UEx.png") errado = Elemento(img="https://i.imgur.com/elvddXi.png") errado.entra(cena3) errado.vai = cena.vai personagem_mulher_maravilha = Elemento( img="https://i.imgur.com/fK906ve.png", style=dict(left=40, top=300, width=400, height="200px")) personagem_mulher_maravilha.entra(cena2) ok = Elemento(img="https://i.imgur.com/jR7lluz.png") op2.entra(cena) op1.entra(cena) #certo.entra(cena3) #certo.vai=cena2.vai op2.vai = cena2.vai op1.vai = cena3.vai
def juntarimagem(): verde = Cena(img=FLORESTA) agua = Cena(img=RIO) verde.direita = agua agua.esquerda = verde morcego = Elemento(img=BATMAN, tit="BATMAN", style=dict(left=150, top=160, width=60, height=200)) morcego.entra(verde) falamorcego = Texto(verde, "eu vou te pegar pinguim") falamorcego.vai() feio = Elemento(img=PINGUIM, tit="PINGUIM", style=dict(left=150, top=160, width=60, height=200)) feio.entra(agua) falafeio = Texto(agua, "impossivel") falafeio.vai() verde.vai() agua.vai()
class FlorestaMacaco: def __init__(self, floresta_inicio=0, vida=3): floresta_faca = CenaProxy() floresta_inicio = Cena(FLORESTA, direita=floresta_faca) self.floresta_inicio = floresta_inicio self.fala = Texto(self.floresta_inicio, TEXTO_MACACO) self.macaco = Elemento(MACACO, style=dict(left="700px", top="400px", width="100px")) self.macaco.entra(floresta_inicio) self.macaco.vai = self.falamacaco #floresta_inicio.vai() def vai(self): self.floresta_inicio.vai() def falamacaco(self, _): self.fala.vai()
def criarcenas(): pantano = Cena(img=PANTANO) castelo = Cena(img=CASTELO) cidade = Cena(img=CIDADE) pantano.vai() alice.direita = vai() alice = Elemento(img=ALICE, tit="Alice", style=dict(left=150, top=150, width=60, height=200)) alice.entra(pantano) alice.vai = ealice.vai tarzan.vai() tarzan = Elemento(img=TARZAN, tit="Tarzan", style=dict(left=50, top=150, width=60, height=200)) tarzan.entra(pantano) tarzan.vai = etarzan.vai
class bonequinha(): def __init__(self, fundo, opcao): self.x = 50 self.c = 500 self.a = opcao y = self.a * self.x + self.c self.boneca = Elemento(BONEQUINHA, h=250, w=250, x=self.x, y=y) self.boneca.o = 0 self.boneca.y = self.a * self.x + self.c self.boneca.x = self.x self.boneca.vai = self.equacao1 self.boneca.entra(fundo) def aparece(self): self.boneca.o = 1 def equacao1(self, *_): self.boneca.x = self.x = self.x + 5.457 self.boneca.y = self.a * self.x - self.c
def criarcenas(): floresta = Cena(img=FLORESTA) mesa = Cena(img=MESA) pantano = Cena(img=PANTANO) castelo = Cena(img=CASTELO) floresta.direita = mesa mesa.direita = pantano pantano.direita = castelo castelo.esquerda = pantano pantano.esquerda = mesa mesa.esquerda = floresta tarzan = Elemento(img=TARZAN1, tit="Tarzan", style=dict(left=150, top=150)) tarzan.entra(floresta) tarzan.vai homem_aranha = Elemento(img=HOMEM_ARANHA, tit="Homem_Aranha", style=dict(left=150, top=150, width=60, heigth=200)) homem_aranha.entra(mesa) barbie = Elemento(img=BARBIE1, tit="Barbie", style=dict(left=150, top=150, width=60, heigth=200)) barbie.entra(pantano) falabarbie = Texto(pantano, "Socorro!Socorro!Estou na areia movediça!!") barbie.vai = falabarbie.vai tarzan = Elemento(img=TARZAN2, tit="Tarzan", style=dict(left=100, top=100, width=190, height=100)) tarzan.entra(castelo) tarzan.vai barbie = Elemento(img=BARBIE2, tit="Barbie", style=dict(left=150, top=150, width=60, heigth=200)) barbie.entra(castelo) falabarbie = Texto(castelo, "Vamos para uma refeição!!") barbie.vai = falabarbie.vai def andatarzan(evento): tarzan.elt.style.left = 50 floresta.vai()
def game(): castelo = Cena(img=CASTELO) floresta = Cena(img=FLORESTA) cidade = Cena(img=CIDADE) castelo.direita = floresta floresta.direita = cidade cidade.esquerda = floresta floresta.esquerda = castelo barbie = Elemento(img=BARBIE, tit="Barbie", style=dict(left=150, top=250, width=50, height="200px")) barbie.entra(castelo) falabarbie = Texto(castelo, "meu castelo é lindo") barbie.vai = falabarbie.vai Musica("http://audiosoundclips.com/wp-content/uploads/2012/01/Bird.mp3") castelo.vai()
class boneco(): def __init__(self, fundo, opcao): self.x = opcao ## self.b = 400 self.c = 500 self.a = 200 y = self.a * self.x + self.c self.bonequinha = Elemento(BONECO, h=250, w=250, x=self.x, y=y) self.bonequinha.o = 0 self.bonequinha.y = self.a * self.x + self.c self.bonequinha.x = self.x self.bonequinha.vai = self.equacao1 self.bonequinha.entra(fundo) def aparece(self): self.bonequinha.o = 1 def equacao1(self, *_): self.bonequinha.x = self.x = self.x + 10 self.bonequinha.y = self.a * self.x + self.c
def geometria(): fundogeo = Cena(img=fundo) square = Elemento(img=quadrado, tit="Adivinhe quem eu sou?", style=dict(top=300, left=300, hight=300, width=300)) square.entra(fundogeo) textosquare = Texto(fundogeo, "RETÂNGULO") square.vai = textosquare.vai fundogeo.vai() log = Elemento(img=losango3d, tit="Adivinhe quem eu sou?", style=dict(top=100, left=500, hight=300, width=300)) log.entra(fundogeo) textolog = Texto(fundogeo, "LOSANGO") log.vai = textolog.vai fundogeo.vai()
class Cubo: def __init__(self, faces=PERSONAGENS, onde=LUGARES): self.perf = list(faces.values()) self.per = Elemento(ACTIVE + self.perf[0] + POS, style=dict(left=100, top=100, width=300, height="300px")) self.lugf = list(onde.values()) self.lug = Elemento(ACTIVE + self.lugf[0] + POS, style=dict(left=600, top=100, width=300, height="300px")) self.cena = Cena(TEMPLOTRAS1) self.lug.entra(self.cena) self.per.entra(self.cena) self.lug.vai = self.shuffle_place self.per.vai = self.shuffle_face self.lug_time = self.per_time = 10 self.cena.vai() def shuffle_face(self, *_): faces = self.perf shuffle(faces) self.per.img.src = ACTIVE + faces[0] + POS if self.per_time < 500: self.per_time *= 1.2 timer.set_timeout(self.shuffle_face, self.per_time) else: self.per_time = 10 def shuffle_place(self, *_): places = self.lugf shuffle(places) self.lug.img.src = ACTIVE + places[0] + POS if self.lug_time < 500: self.lug_time *= 1.2 timer.set_timeout(self.shuffle_place, self.lug_time) else: self.lug_time = 10