Diff
checker
文本
文本
圖像
文檔
Excel
文件夾
Legal
Enterprise
桌面版
定價
登入
下載 Diffchecker 桌面版
比較文本
尋找兩個文字檔案之間的差異
工具
歷史
顯示
檢視
拆分
統一
即時編輯器
隱藏空白變更
摺疊未變更行
關閉換行
比對精度
智能
語法
無
變更外觀
處理
忽略
文字轉換
前往第一個差異
編輯輸入
Diffchecker Desktop
執行Diffchecker最安全的方式。取得Diffchecker桌面應用程式:您的差異永遠不會離開您的電腦!
取得桌面版
Untitled diff
建立於
8 年前
差異永不過期
清除
匯出
分享
解釋
37 刪除
行
總計
刪除
字符
總計
刪除
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
154 行
全部複製
75 新增
行
總計
新增
字符
總計
新增
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
187 行
全部複製
# coding: utf-8
# coding: utf-8
複製
已複製
複製
已複製
import pilasengine
import pilasengine
複製
已複製
複製
已複製
pilas
=
pilasengine.iniciar()
pilas
=
pilasengine.iniciar()
######################Escenas##################
######################Escenas##################
def iniciar_juego():
def iniciar_juego():
pilas.escenas.PantallaJuego()
pilas.escenas.PantallaJuego()
複製
已複製
複製
已複製
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()
複製
已複製
複製
已複製
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)
複製
已複製
複製
已複製
pilas.escenas.PantallaMenu()
# Temporal, hago que inicie en el juego directamente
#
pilas.escenas.PantallaMenu()
#########################Escena Juego###################
#########################Escena Juego###################
複製
已複製
複製
已複製
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)
複製
已複製
複製
已複製
def iniciar(self):
def iniciar(self):
self.fondis=pilas.fondos.Fondo()
self.fondis=pilas.fondos.Fondo()
複製
已複製
複製
已複製
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)
複製
已複製
複製
已複製
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)
複製
已複製
複製
已複製
複製
已複製
複製
已複製
###########################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):
複製
已複製
複製
已複製
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
複製
已複製
複製
已複製
class Heroe(MiActor):
class Heroe(MiActor):
def iniciar(self):
def iniciar(self):
複製
已複製
複製
已複製
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)
複製
已複製
複製
已複製
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):
複製
已複製
複製
已複製
pelota.empujar((pelota.x - Heroe.x)
/ 0
, -10)
pelota.empujar((pelota.x - Heroe.x)
, -10)
pilas.actores.vincular(Heroe)
pilas.actores.vincular(Heroe)
複製
已複製
複製
已複製
#####################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###########
複製
已複製
複製
已複製
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)
複製
已複製
複製
已複製
pilas.actores.vincular(Enemy)
pilas.actores.vincular(Enemy)
複製
已複製
複製
已複製
##########################Pelotas#################
##########################Pelotas#################
class Wea(pilasengine.actores.Actor):
class Wea(pilasengine.actores.Actor):
複製
已複製
複製
已複製
def iniciar(self):
def iniciar(self):
複製
已複製
複製
已複製
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
複製
已複製
複製
已複製
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)
複製
已複製
複製
已複製
複製
已複製
複製
已複製
已保存差異
原始文本
開啟檔案
# 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)
更改後文本
開啟檔案
# 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()
尋找差異