Diff
checker
Text
Text
Images
Documents
Excel
Folders
Legal
Enterprise
Desktop
Pricing
Sign in
Download Diffchecker Desktop
Compare text
Find the difference between two text files
Tools
History
Display
Layout
Split
Unified
Real-time editor
Hide whitespace changes
Hide unchanged lines
Disable line wrap
Diff precision
Smart
Syntax
None
Change appearance
Process
Ignore
Transform text
Go to first change
Edit input
Diffchecker Desktop
The most secure way to run Diffchecker. Get the Diffchecker Desktop app: your diffs never leave your computer!
Get Desktop
Untitled diff
Created
8 years ago
Diff never expires
Clear
Export
Share
Explain
37 removals
Lines
Total
Removed
Characters
Total
Removed
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
154 lines
Copy
75 additions
Lines
Total
Added
Characters
Total
Added
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
187 lines
Copy
# coding: utf-8
# coding: utf-8
Copy
Copied
Copy
Copied
import pilasengine
import pilasengine
Copy
Copied
Copy
Copied
pilas
=
pilasengine.iniciar()
pilas
=
pilasengine.iniciar()
######################Escenas##################
######################Escenas##################
def iniciar_juego():
def iniciar_juego():
pilas.escenas.PantallaJuego()
pilas.escenas.PantallaJuego()
Copy
Copied
Copy
Copied
def salir_del_juego():
def salir_del_juego():
pilas.terminar()
pilas.terminar()
#def como_jugar():
#def como_jugar():
# pilas.engine.PantallaInstrucciones()
# pilas.engine.PantallaInstrucciones()
########################Pantalla menu##############
########################Pantalla menu##############
class PantallaMenu(pilasengine.escenas.Escena):
class PantallaMenu(pilasengine.escenas.Escena):
def iniciar(self):
def iniciar(self):
self.f= pilas.fondos.Fondo()
self.f= pilas.fondos.Fondo()
Copy
Copied
Copy
Copied
self.f.imagen = pilas.imagenes.cargar("C:\pilastrabajos\KhousnoulinePilas\imagenes\menu.png")
#
self.f.imagen = pilas.imagenes.cargar("C:\pilastrabajos\KhousnoulinePilas\imagenes\menu.png")
self.f.escala=0.650
self.f.escala=0.650
self.lista_de_opciones = pilas.actores.Menu([
self.lista_de_opciones = pilas.actores.Menu([
("Comenzar", iniciar_juego),
("Comenzar", iniciar_juego),
# ("Instrucciones", como_jugar),
# ("Instrucciones", como_jugar),
("Salir", salir_del_juego)
("Salir", salir_del_juego)
])
])
pilas.escenas.vincular(PantallaMenu)
pilas.escenas.vincular(PantallaMenu)
Copy
Copied
Copy
Copied
pilas.escenas.PantallaMenu()
# Temporal, hago que inicie en el juego directamente
#
pilas.escenas.PantallaMenu()
#########################Escena Juego###################
#########################Escena Juego###################
Copy
Copied
Copy
Copied
class PantallaJuego(pilasengine.escenas.Escena):
class PantallaJuego(pilasengine.escenas.Escena):
def crear_ladrillos(self,ladrillo,valores_x,y):
def crear_ladrillos(self,ladrillo,valores_x,y):
for x in valores_x:
for x in valores_x:
crear_ladrillo(ladrillo,x,y)
crear_ladrillo(ladrillo,x,y)
Copy
Copied
Copy
Copied
def iniciar(self):
def iniciar(self):
self.fondis=pilas.fondos.Fondo()
self.fondis=pilas.fondos.Fondo()
Copy
Copied
Copy
Copied
self.fondis.imagen= pilas.imagenes.cargar("C:\pilastrabajos\KhousnoulinePilas\imagenes\wnegro.jpg")
#
self.fondis.imagen= pilas.imagenes.cargar("C:\pilastrabajos\KhousnoulinePilas\imagenes\wnegro.jpg")
primero=pilas.actores.Heroe()
primero=pilas.actores.Heroe()
segundo= pilas.actores.Enemy()
segundo= pilas.actores.Enemy()
pelota= pilas.actores.Wea()
pelota= pilas.actores.Wea()
pelotados=pilas.actores.WeaDos()
pelotados=pilas.actores.WeaDos()
ladrillo=pilas.actores.Ladrillo()
ladrillo=pilas.actores.Ladrillo()
ladrillos = pilas.actores.Grupo()
ladrillos = pilas.actores.Grupo()
valores_x=[-290,-235,-180,-125,-70,-15,40,95,150,205,260]
valores_x=[-290,-235,-180,-125,-70,-15,40,95,150,205,260]
self.crear_ladrillos(ladrillos,valores_x, 100)
self.crear_ladrillos(ladrillos,valores_x, 100)
self.crear_ladrillos(ladrillos,valores_x, 80)
self.crear_ladrillos(ladrillos,valores_x, 80)
self.crear_ladrillos(ladrillos,valores_x, 60)
self.crear_ladrillos(ladrillos,valores_x, 60)
self.crear_ladrillos(ladrillos,valores_x, 40)
self.crear_ladrillos(ladrillos,valores_x, 40)
self.crear_ladrillos(ladrillos,valores_x, 20)
self.crear_ladrillos(ladrillos,valores_x, 20)
self.crear_ladrillos(ladrillos,valores_x, 0)
self.crear_ladrillos(ladrillos,valores_x, 0)
self.crear_ladrillos(ladrillos,valores_x, -20)
self.crear_ladrillos(ladrillos,valores_x, -20)
self.crear_ladrillos(ladrillos,valores_x, -40)
self.crear_ladrillos(ladrillos,valores_x, -40)
Copy
Copied
Copy
Copied
self.pilas.colisiones.agregar('Wea', 'Ladrillo', self.eliminar_ladrillo)
self.pilas.colisiones.agregar('Heroe', 'Wea', self.empujar_pelota)
def eliminar_ladrillo(self, pelota, ladrillo):
# importante: faltaba () a derecha de eliminar.
ladrillo.eliminar()
def empujar_pelota(self, paleta, pelota):
pelota.velocidad_x = 0
pelota.velocidad_y = 0
pelota.figura.y = paleta.y + 30
pelota.empujar((pelota.x - paleta.x), -30)
#pelota.empujar((pelota.x - paleta.x) / 0.5, -30)
#pilas.colisiones.agregar(Heroe,Wea, empujar_pelota)
#le restas 55
#le restas 55
pilas.escenas.vincular(PantallaJuego)
pilas.escenas.vincular(PantallaJuego)
Copy
Copied
Copy
Copied
Copy
Copied
Copy
Copied
###########################Paleta Azul###########
###########################Paleta Azul###########
class MiActor(pilasengine.actores.Actor):
class MiActor(pilasengine.actores.Actor):
def constructor(self, x, y, esc, img):
def constructor(self, x, y, esc, img):
Copy
Copied
Copy
Copied
self.imagen=pilas.imagenes.cargar('C:\pilastrabajos\KhousnoulinePilas\imagenes' +img)
#
self.imagen=pilas.imagenes.cargar('C:\pilastrabajos\KhousnoulinePilas\imagenes' +img)
self.escala=esc
self.escala=esc
self.y=y
self.y=y
self.x=x
self.x=x
Copy
Copied
Copy
Copied
class Heroe(MiActor):
class Heroe(MiActor):
def iniciar(self):
def iniciar(self):
Copy
Copied
Copy
Copied
self.constructor(0, -2
0
0, 0.120, "\primero.png")
self.constructor(0, -2
3
0, 0.120, "\primero.png")
self.aprender(pilas.habilidades.MoverseConElTeclado)
self.aprender(pilas.habilidades.MoverseConElTeclado)
Copy
Copied
Copy
Copied
self.figura_de_colision = pilas.fisica.Rectangulo(0, 0, 116,
10
, False)
self.figura_de_colision = pilas.fisica.Rectangulo(0, 0, 116,
60
, False)
def empujar_pelota(Heroe, pelota):
def empujar_pelota(Heroe, pelota):
Copy
Copied
Copy
Copied
pelota.empujar((pelota.x - Heroe.x)
/ 0
, -10)
pelota.empujar((pelota.x - Heroe.x)
, -10)
pilas.actores.vincular(Heroe)
pilas.actores.vincular(Heroe)
Copy
Copied
Copy
Copied
#####################Paleta Verde#################
#####################Paleta Verde#################
class Enemy(MiActor):
class Enemy(MiActor):
def iniciar(self):
def iniciar(self):
self.constructor(0,200,0.200,"\segundo.jpg")
self.constructor(0,200,0.200,"\segundo.jpg")
self.figura_de_colision = pilas.fisica.Rectangulo(0, 0, 116, 10, False)
self.figura_de_colision = pilas.fisica.Rectangulo(0, 0, 116, 10, False)
####################Teclado para segundo###########
####################Teclado para segundo###########
Copy
Copied
Copy
Copied
nuevasteclas={pilas.simbolos.a:'izquierda',
nuevasteclas={pilas.simbolos.a:'izquierda',
pilas.simbolos.d:'derecha',}
pilas.simbolos.d:'derecha',}
mando=pilas.control.Control(nuevasteclas)
mando=pilas.control.Control(nuevasteclas)
self.aprender(pilas.habilidades.MoverseConElTeclado,control=mando)
self.aprender(pilas.habilidades.MoverseConElTeclado,control=mando)
Copy
Copied
Copy
Copied
pilas.actores.vincular(Enemy)
pilas.actores.vincular(Enemy)
Copy
Copied
Copy
Copied
##########################Pelotas#################
##########################Pelotas#################
class Wea(pilasengine.actores.Actor):
class Wea(pilasengine.actores.Actor):
Copy
Copied
Copy
Copied
def iniciar(self):
def iniciar(self):
Copy
Copied
Copy
Copied
self.imagen=pilas.imagenes.cargar("C:\pilastrabajos\KhousnoulinePilas\imagenes\pelota.png")
#
self.imagen=pilas.imagenes.cargar("C:\pilastrabajos\KhousnoulinePilas\imagenes\pelota.png")
self.imagen = "pelota.png"
self.escala=0.150
self.escala=0.150
self.y=-150
self.y=-150
Copy
Copied
Copy
Copied
self.aprender(pilas.habilidades.RebotarComoPelota)
self.aprender(pilas.habilidades.RebotarComoPelota)
# self.figura_de_colision= pilas.fisica.Circulo(0, 0, 15, dinamica=True)
# self.figura_de_colision= pilas.fisica.Circulo(0, 0, 15, dinamica=True)
self.pilas.fisica.gravedad_x = 0
self.pilas.fisica.gravedad_x = 0
self.pilas.fisica.gravedad_y = -9
self.pilas.fisica.gravedad_y = -9
self.aprender(pilas.habilidades.Arrastrable)
self.aprender(pilas.habilidades.Arrastrable)
Copy
Copied
Copy
Copied
Copy
Copied
Copy
Copied
Saved diffs
Original text
Open file
# coding: utf-8 import pilasengine pilas=pilasengine.iniciar() ######################Escenas################## def iniciar_juego(): pilas.escenas.PantallaJuego() def salir_del_juego(): pilas.terminar() #def como_jugar(): # pilas.engine.PantallaInstrucciones() ########################Pantalla menu############## class PantallaMenu(pilasengine.escenas.Escena): def iniciar(self): self.f= pilas.fondos.Fondo() self.f.imagen = pilas.imagenes.cargar("C:\pilastrabajos\KhousnoulinePilas\imagenes\menu.png") self.f.escala=0.650 self.lista_de_opciones = pilas.actores.Menu([ ("Comenzar", iniciar_juego), # ("Instrucciones", como_jugar), ("Salir", salir_del_juego) ]) pilas.escenas.vincular(PantallaMenu) pilas.escenas.PantallaMenu() #########################Escena Juego################### class PantallaJuego(pilasengine.escenas.Escena): def crear_ladrillos(self,ladrillo,valores_x,y): for x in valores_x: crear_ladrillo(ladrillo,x,y) def iniciar(self): self.fondis=pilas.fondos.Fondo() self.fondis.imagen= pilas.imagenes.cargar("C:\pilastrabajos\KhousnoulinePilas\imagenes\wnegro.jpg") primero=pilas.actores.Heroe() segundo= pilas.actores.Enemy() pelota= pilas.actores.Wea() pelotados=pilas.actores.WeaDos() ladrillo=pilas.actores.Ladrillo() ladrillos = pilas.actores.Grupo() valores_x=[-290,-235,-180,-125,-70,-15,40,95,150,205,260] self.crear_ladrillos(ladrillos,valores_x, 100) self.crear_ladrillos(ladrillos,valores_x, 80) self.crear_ladrillos(ladrillos,valores_x, 60) self.crear_ladrillos(ladrillos,valores_x, 40) self.crear_ladrillos(ladrillos,valores_x, 20) self.crear_ladrillos(ladrillos,valores_x, 0) self.crear_ladrillos(ladrillos,valores_x, -20) self.crear_ladrillos(ladrillos,valores_x, -40) #le restas 55 pilas.escenas.vincular(PantallaJuego) ###########################Paleta Azul########### class MiActor(pilasengine.actores.Actor): def constructor(self, x, y, esc, img): self.imagen=pilas.imagenes.cargar('C:\pilastrabajos\KhousnoulinePilas\imagenes' +img) self.escala=esc self.y=y self.x=x class Heroe(MiActor): def iniciar(self): self.constructor(0, -200, 0.120, "\primero.png") self.aprender(pilas.habilidades.MoverseConElTeclado) self.figura_de_colision = pilas.fisica.Rectangulo(0, 0, 116, 10, False) def empujar_pelota(Heroe, pelota): pelota.empujar((pelota.x - Heroe.x) / 0, -10) pilas.actores.vincular(Heroe) #####################Paleta Verde################# class Enemy(MiActor): def iniciar(self): self.constructor(0,200,0.200,"\segundo.jpg") self.figura_de_colision = pilas.fisica.Rectangulo(0, 0, 116, 10, False) ####################Teclado para segundo########### nuevasteclas={pilas.simbolos.a:'izquierda', pilas.simbolos.d:'derecha',} mando=pilas.control.Control(nuevasteclas) self.aprender(pilas.habilidades.MoverseConElTeclado,control=mando) pilas.actores.vincular(Enemy) ##########################Pelotas################# class Wea(pilasengine.actores.Actor): def iniciar(self): self.imagen=pilas.imagenes.cargar("C:\pilastrabajos\KhousnoulinePilas\imagenes\pelota.png") self.escala=0.150 self.y=-150 self.aprender(pilas.habilidades.RebotarComoPelota) # self.figura_de_colision= pilas.fisica.Circulo(0, 0, 15, dinamica=True) self.pilas.fisica.gravedad_x = 0 self.pilas.fisica.gravedad_y = -9 self.aprender(pilas.habilidades.Arrastrable) #pelota.aprender(Colisionable) #class Colisionable(object): # def __init__(self, receptor): # self.receptor = receptor # self.pelota = pilas.fisica.Circulo(0, 0, 15, dinamica=False) # self.pilas.fisica.gravedad_x = 0 # self.pilas.fisica.gravedad_y = -9 # def actualizar(self): # self.pelota.x = self.receptor.x # self.pelota.y = self.receptor.y -9 #pelota = [] #return True pilas.actores.vincular(Wea) class WeaDos(pilasengine.actores.Actor): def iniciar(self): self.imagen=pilas.imagenes.cargar("C:\pilastrabajos\KhousnoulinePilas\imagenes\pelotados.png") self.escala=0.0450 self.y=150 self.x=0 self.aprender(pilas.habilidades.RebotarComoPelota) self.aprender(pilas.habilidades.Arrastrable) # self.figura_de_colision = pilas.fisica.Circulo(0, 0, 15, dinamica=True) pilas.actores.vincular(WeaDos) ###########################Ladrillos################### class Ladrillo(pilasengine.actores.Actor): def iniciar(self): self.imagen=pilas.imagenes.cargar("C:\pilastrabajos\KhousnoulinePilas\imagenes\ladrillo.png") self.escala=0.200 self.y=0 self.x=-290 self.figura_de_colision = pilas.fisica.Rectangulo(0, 0, 50, 10, False) def crear_ladrillo(grupo_ladrillos, x, y): ladrillo = Ladrillo(pilas) ladrillo.x = x ladrillo.y = y grupo_ladrillos.agregar(ladrillo) def eliminar_ladrillo(pelota, ladrillo): ladrillo.eliminar pilas.colisiones.agregar('Wea', 'Ladrillo', eliminar_ladrillo) def eliminar_ladrillo(pelotados, ladrillo): ladrillo.eliminar() def empujar_pelota(paleta, pelota): pelota.empujar((pelota.x - paleta.x) / 0.5, -10) pilas.colisiones.agregar(Heroe,Wea, empujar_pelota) #### pilas.colisiones.agregar(Wea, Ladrillo, eliminar_ladrillo)
Changed text
Open file
# coding: utf-8 import pilasengine pilas = pilasengine.iniciar() ######################Escenas################## def iniciar_juego(): pilas.escenas.PantallaJuego() def salir_del_juego(): pilas.terminar() #def como_jugar(): # pilas.engine.PantallaInstrucciones() ########################Pantalla menu############## class PantallaMenu(pilasengine.escenas.Escena): def iniciar(self): self.f= pilas.fondos.Fondo() #self.f.imagen = pilas.imagenes.cargar("C:\pilastrabajos\KhousnoulinePilas\imagenes\menu.png") self.f.escala=0.650 self.lista_de_opciones = pilas.actores.Menu([ ("Comenzar", iniciar_juego), # ("Instrucciones", como_jugar), ("Salir", salir_del_juego) ]) pilas.escenas.vincular(PantallaMenu) # Temporal, hago que inicie en el juego directamente #pilas.escenas.PantallaMenu() #########################Escena Juego################### class PantallaJuego(pilasengine.escenas.Escena): def crear_ladrillos(self,ladrillo,valores_x,y): for x in valores_x: crear_ladrillo(ladrillo,x,y) def iniciar(self): self.fondis=pilas.fondos.Fondo() #self.fondis.imagen= pilas.imagenes.cargar("C:\pilastrabajos\KhousnoulinePilas\imagenes\wnegro.jpg") primero=pilas.actores.Heroe() segundo= pilas.actores.Enemy() pelota= pilas.actores.Wea() pelotados=pilas.actores.WeaDos() ladrillo=pilas.actores.Ladrillo() ladrillos = pilas.actores.Grupo() valores_x=[-290,-235,-180,-125,-70,-15,40,95,150,205,260] self.crear_ladrillos(ladrillos,valores_x, 100) self.crear_ladrillos(ladrillos,valores_x, 80) self.crear_ladrillos(ladrillos,valores_x, 60) self.crear_ladrillos(ladrillos,valores_x, 40) self.crear_ladrillos(ladrillos,valores_x, 20) self.crear_ladrillos(ladrillos,valores_x, 0) self.crear_ladrillos(ladrillos,valores_x, -20) self.crear_ladrillos(ladrillos,valores_x, -40) self.pilas.colisiones.agregar('Wea', 'Ladrillo', self.eliminar_ladrillo) self.pilas.colisiones.agregar('Heroe', 'Wea', self.empujar_pelota) def eliminar_ladrillo(self, pelota, ladrillo): # importante: faltaba () a derecha de eliminar. ladrillo.eliminar() def empujar_pelota(self, paleta, pelota): pelota.velocidad_x = 0 pelota.velocidad_y = 0 pelota.figura.y = paleta.y + 30 pelota.empujar((pelota.x - paleta.x), -30) #pelota.empujar((pelota.x - paleta.x) / 0.5, -30) #pilas.colisiones.agregar(Heroe,Wea, empujar_pelota) #le restas 55 pilas.escenas.vincular(PantallaJuego) ###########################Paleta Azul########### class MiActor(pilasengine.actores.Actor): def constructor(self, x, y, esc, img): #self.imagen=pilas.imagenes.cargar('C:\pilastrabajos\KhousnoulinePilas\imagenes' +img) self.escala=esc self.y=y self.x=x class Heroe(MiActor): def iniciar(self): self.constructor(0, -230, 0.120, "\primero.png") self.aprender(pilas.habilidades.MoverseConElTeclado) self.figura_de_colision = pilas.fisica.Rectangulo(0, 0, 116, 60, False) def empujar_pelota(Heroe, pelota): pelota.empujar((pelota.x - Heroe.x), -10) pilas.actores.vincular(Heroe) #####################Paleta Verde################# class Enemy(MiActor): def iniciar(self): self.constructor(0,200,0.200,"\segundo.jpg") self.figura_de_colision = pilas.fisica.Rectangulo(0, 0, 116, 10, False) ####################Teclado para segundo########### nuevasteclas={pilas.simbolos.a:'izquierda', pilas.simbolos.d:'derecha',} mando=pilas.control.Control(nuevasteclas) self.aprender(pilas.habilidades.MoverseConElTeclado,control=mando) pilas.actores.vincular(Enemy) ##########################Pelotas################# class Wea(pilasengine.actores.Actor): def iniciar(self): #self.imagen=pilas.imagenes.cargar("C:\pilastrabajos\KhousnoulinePilas\imagenes\pelota.png") self.imagen = "pelota.png" self.escala=0.150 self.y=-150 self.aprender(pilas.habilidades.RebotarComoPelota) # self.figura_de_colision= pilas.fisica.Circulo(0, 0, 15, dinamica=True) self.pilas.fisica.gravedad_x = 0 self.pilas.fisica.gravedad_y = -9 self.aprender(pilas.habilidades.Arrastrable) #pelota.aprender(Colisionable) #class Colisionable(object): # def __init__(self, receptor): # self.receptor = receptor # self.pelota = pilas.fisica.Circulo(0, 0, 15, dinamica=False) # self.pilas.fisica.gravedad_x = 0 # self.pilas.fisica.gravedad_y = -9 # def actualizar(self): # self.pelota.x = self.receptor.x # self.pelota.y = self.receptor.y -9 #pelota = [] #return True pilas.actores.vincular(Wea) class WeaDos(pilasengine.actores.Actor): def iniciar(self): #self.imagen=pilas.imagenes.cargar("C:\pilastrabajos\KhousnoulinePilas\imagenes\pelotados.png") self.escala=0.0450 self.y=150 self.x=0 self.aprender(pilas.habilidades.RebotarComoPelota) self.aprender(pilas.habilidades.Arrastrable) # self.figura_de_colision = pilas.fisica.Circulo(0, 0, 15, dinamica=True) pilas.actores.vincular(WeaDos) ###########################Ladrillos################### class Ladrillo(pilasengine.actores.Actor): def iniciar(self): #self.imagen=pilas.imagenes.cargar("C:\pilastrabajos\KhousnoulinePilas\imagenes\ladrillo.png") self.escala=0.200 self.y=0 self.x=-290 self.figura_de_colision = pilas.fisica.Rectangulo(0, 0, 50, 10, False) def crear_ladrillo(grupo_ladrillos, x, y): ladrillo = Ladrillo(pilas) ladrillo.x = x ladrillo.y = y grupo_ladrillos.agregar(ladrillo) def eliminar_ladrillo(pelotados, ladrillo): ladrillo.eliminar() pilas.actores.vincular(Ladrillo) # Temporal, hago que inicie en el juego directamente pilas.escenas.PantallaJuego() pilas.ejecutar()
Find difference