Diff
checker
텍스트
텍스트
이미지
문서
Excel
폴더
Legal
Enterprise
데스크톱
요금제
로그인
데스크톱 앱 다운로드
텍스트 비교
두 텍스트 파일의 차이점을 찾아보세요
도구
기록
실시간 편집
변경 없는 행 숨기기
줄바꿈 비활성화
레이아웃
나란히 보기
합쳐 보기
비교 단위
스마트
단어
글자
구문 강조
언어 선택
제외
텍스트 변환
첫 변경으로
수정
Diffchecker Desktop
가장 안전하게 Diffchecker를 사용하는 방법. 데스크톱 앱을 사용하면 비교 데이터가 외부로 전송되지 않습니다!
데스크톱 앱 받기
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()
비교하기