Diff
checker
テキスト
テキスト
画像
ドキュメント
Excel
フォルダ
Legal
Enterprise
デスクトップ
料金
ログイン
Diffchecker デスクトップのダウンロード
テキスト比較
2 つのテキスト ファイルの違いを見つける
ツール
履歴
ライブエディター
未変更行を折りたたむ
折り返しなし
レイアウト
分割
統合
比較精度
スマート
単語
文字
シンタックスハイライト
構文を選択
無視
テキスト変換
最初の差分へ移動
入力を編集
Diffchecker Desktop
Diffcheckerを実行する最も安全な方法。Diffchecker Desktopアプリを入手:あなたの差分はコンピューターから出ることはありません!
Desktopを入手
Untitled diff
作成日
7 年前
差分は期限切れになりません
クリア
エクスポート
共有
説明
34 削除
行
合計
削除
文字
合計
削除
この機能を引き続き使用するには、アップグレードしてください
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)
コピー
コピー済み
コピー
コピー済み
#pelota.aprender(Colisionable)
#pelota.aprender(Colisionable)
#class Colisionable(object):
#class Colisionable(object):
# def __init__(self, receptor):
# def __init__(self, receptor):
# self.receptor = receptor
# self.receptor = receptor
# self.pelota = pilas.fisica.Circulo(0, 0, 15, dinamica=False)
# self.pelota = pilas.fisica.Circulo(0, 0, 15, dinamica=False)
# self.pilas.fisica.gravedad_x = 0
# self.pilas.fisica.gravedad_x = 0
# self.pilas.fisica.gravedad_y = -9
# self.pilas.fisica.gravedad_y = -9
# def actualizar(self):
# def actualizar(self):
コピー
コピー済み
コピー
コピー済み
# self.pelota.x = self.receptor.x
# self.pelota.x = self.receptor.x
# self.pelota.y = self.receptor.y -9
# self.pelota.y = self.receptor.y -9
#pelota = []
#pelota = []
コピー
コピー済み
コピー
コピー済み
#return True
#return True
コピー
コピー済み
コピー
コピー済み
pilas.actores.vincular(Wea)
pilas.actores.vincular(Wea)
コピー
コピー済み
コピー
コピー済み
class WeaDos(pilasengine.actores.Actor):
class WeaDos(pilasengine.actores.Actor):
def iniciar(self):
def iniciar(self):
コピー
コピー済み
コピー
コピー済み
self.imagen=pilas.imagenes.cargar("C:\pilastrabajos\KhousnoulinePilas\imagenes\pelotados.png")
#
self.imagen=pilas.imagenes.cargar("C:\pilastrabajos\KhousnoulinePilas\imagenes\pelotados.png")
self.escala=0.0450
self.escala=0.0450
self.y=150
self.y=150
self.x=0
self.x=0
self.aprender(pilas.habilidades.RebotarComoPelota)
self.aprender(pilas.habilidades.RebotarComoPelota)
コピー
コピー済み
コピー
コピー済み
self.aprender(pilas.habilidades.Arrastrable)
self.aprender(pilas.habilidades.Arrastrable)
コピー
コピー済み
コピー
コピー済み
# self.figura_de_colision = pilas.fisica.Circulo(0, 0, 15, dinamica=True)
# self.figura_de_colision = pilas.fisica.Circulo(0, 0, 15, dinamica=True)
pilas.actores.vincular(WeaDos)
pilas.actores.vincular(WeaDos)
###########################Ladrillos###################
###########################Ladrillos###################
class Ladrillo(pilasengine.actores.Actor):
class Ladrillo(pilasengine.actores.Actor):
def iniciar(self):
def iniciar(self):
コピー
コピー済み
コピー
コピー済み
self.imagen=pilas.imagenes.cargar("C:\pilastrabajos\KhousnoulinePilas\imagenes\ladrillo.png")
#
self.imagen=pilas.imagenes.cargar("C:\pilastrabajos\KhousnoulinePilas\imagenes\ladrillo.png")
self.escala=0.200
self.escala=0.200
self.y=0
self.y=0
self.x=-290
self.x=-290
self.figura_de_colision = pilas.fisica.Rectangulo(0, 0, 50, 10, False)
self.figura_de_colision = pilas.fisica.Rectangulo(0, 0, 50, 10, False)
コピー
コピー済み
コピー
コピー済み
def crear_ladrillo(grupo_ladrillos, x, y):
def crear_ladrillo(grupo_ladrillos, x, y):
ladrillo = Ladrillo(pilas)
ladrillo = Ladrillo(pilas)
ladrillo.x = x
ladrillo.x = x
ladrillo.y = y
ladrillo.y = y
grupo_ladrillos.agregar(ladrillo)
grupo_ladrillos.agregar(ladrillo)
コピー
コピー済み
コピー
コピー済み
def eliminar_ladrillo(pelota, ladrillo):
ladrillo.eliminar
pilas.colisiones.agregar('Wea', 'Ladrillo', eliminar_ladrillo)
def eliminar_ladrillo(pelotados, ladrillo):
def eliminar_ladrillo(pelotados, ladrillo):
ladrillo.eliminar()
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)
pilas.actores.vincular(Ladrillo)
# Temporal, hago que inicie en el juego directamente
pilas.escenas.PantallaJuego()
pilas.ejecutar()
保存された差分
原文
ファイルを開く
# 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()
違いを見つける