-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into gramatica-end
- Loading branch information
Showing
13 changed files
with
427 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/// <reference path="../../ActorAnimado.ts"/> | ||
|
||
class Yacare extends ActorAnimado { | ||
static _grilla = 'actor.yacare.png' | ||
|
||
constructor() { | ||
super(0, 0, {cantColumnas: 1}); | ||
this.definirAnimacion("parado", [0], 1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// <reference path = "ComportamientoConVelocidad.ts" /> | ||
/// <reference path = "GirarMarquesina.ts" /> | ||
|
||
class CorrerHeroicamente extends ComportamientoConVelocidad { | ||
nombreAnimacion(){ | ||
return 'correr'; | ||
} | ||
|
||
preAnimacion(){ | ||
this.argumentos.velocidad = 100; | ||
this.argumentos.cantPasos = 1; | ||
super.preAnimacion(); | ||
this.receptor.escena.fondo.hacer_luego(GirarMarquesina,{}); | ||
} | ||
|
||
postAnimacion(){ | ||
super.postAnimacion(); | ||
if(this.receptor.fraseAlCorrer) this.receptor.decir(this.receptor.fraseAlCorrer()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/// <reference path = "../comportamientos/MovimientoAnimado.ts" /> | ||
|
||
// Si se pasa por argumento "irseCon" entonces el receptor debe ser actor compuesto | ||
class Irse extends MovimientoAnimado { | ||
|
||
iniciar(receptor){ | ||
this.argumentos.idTransicion = "irse"; | ||
super.iniciar(receptor); | ||
} | ||
|
||
preAnimacion(){ | ||
this.argumentos.direccion = new Direct(1); | ||
this.argumentos.distancia = 600; | ||
this.argumentos.velocidad = 8; | ||
this.argumentos.cantPasos = 40; | ||
|
||
if (this.argumentos.irseCon) { | ||
|
||
if (typeof this.argumentos.irseCon == 'string') { | ||
this.argumentos.irseCon = eval("pilas.escena_actual()." + this.argumentos.irseCon); | ||
} | ||
this.receptor.agregarSubactor(this.argumentos.irseCon); | ||
} | ||
super.preAnimacion(); | ||
} | ||
|
||
configurarVerificaciones() { | ||
super.configurarVerificaciones(); | ||
this.verificacionesPre.push(new Verificacion(() => { | ||
return this.estaEnTransporte(); | ||
}, "Para irse hace falta un transporte")); | ||
} | ||
|
||
estaEnTransporte(){ | ||
if (typeof this.argumentos.irseCon == 'string') { | ||
this.argumentos.irseCon = eval("pilas.escena_actual()." + this.argumentos.irseCon); | ||
} | ||
|
||
let noTieneQueirseConNingunActor = (!this.argumentos.irseCon); | ||
let colisionaConElActorParaIrse = this.receptor.colisiona_con(this.argumentos.irseCon); | ||
|
||
return (noTieneQueirseConNingunActor || colisionaConElActorParaIrse); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// <reference path = "../../node_modules/pilasweb/dist/pilasweb.d.ts"/> | ||
/// <reference path = "Decir.ts"/> | ||
|
||
/* | ||
Comportamiento que hace decir una | ||
frase definida por la escena | ||
*/ | ||
|
||
class PingPongAnimado extends Decir { | ||
preAnimacion(): void { | ||
this.receptor.escena.antesDeRebotar(); | ||
this.argumentos.mensaje = this.receptor.escena.getFraseAlRebotar() | ||
super.preAnimacion(); | ||
} | ||
|
||
postAnimacion(){ | ||
super.postAnimacion(); | ||
this.receptor.decir(this.receptor.escena.fraseAlRebotar()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/// <reference path = "EscenaActividad.ts" /> | ||
/// <reference path = "../actores/segundoCiclo/Chuy/Chuy.ts" /> | ||
/// <reference path = "../actores/segundoCiclo/Chuy/Pelotas.ts" /> | ||
|
||
class ChuyHaciendoJueguito extends EscenaActividad { | ||
automata; | ||
pulpito; | ||
fondo; | ||
cuadricula; | ||
|
||
iniciar() { | ||
this.fondo = new Fondo('fondo.chuy.png',0,0); | ||
this.colocarCuadricula() | ||
this.construirObjeto(); | ||
this.construirAutomata(); | ||
this.construirFSM(); | ||
} | ||
|
||
colocarCuadricula(){ | ||
this.cuadricula = new Cuadricula(0, 0, 1, 1, | ||
{ alto: 100, ancho: 400 }, | ||
{ grilla: 'invisible.png', cantColumnas: 1 }); | ||
} | ||
|
||
construirAutomata() { | ||
this.automata = new Chuy(); | ||
this.automata.escala *= 1.2; | ||
this.cuadricula.agregarActor(this.automata, 0, 0, false); | ||
this.automata.x -= 50; | ||
} | ||
|
||
construirObjeto() { | ||
this.pulpito = new Pulpito(); | ||
this.pulpito.y = -120; | ||
this.pulpito.escala *= 0.2; | ||
this.pulpito.aprender(Flotar, {Desvio: 4}); | ||
this.cuadricula.agregarActor(this.pulpito, 0, 0, false); | ||
} | ||
|
||
private construirFSM(){ | ||
var builder= new BuilderStatePattern(this, 'inicial',false); | ||
builder.agregarEstado('posCorrecta',false); | ||
builder.agregarEstado('calentar1',false); | ||
builder.agregarEstado('calentar2',false); | ||
builder.agregarEstado('enCalor',false); | ||
builder.agregarEstado('levantarPelota',false); | ||
builder.agregarEstado('tirarAlAire',false); | ||
builder.agregarEstado('jugarConElPie',false); | ||
builder.agregarEstado('resuelto',false); | ||
builder.agregarEstado('noResuelve',false); | ||
builder.agregarEstadoAceptacion('fin'); | ||
|
||
builder.agregarTransicion('inicial', 'posCorrecta', 'avanzar'); | ||
builder.agregarTransicion('posCorrecta','calentar1','retroceder'); | ||
builder.agregarTransicion('posCorrecta','calentar2','avanzar'); | ||
builder.agregarTransicion('calentar1','enCalor','avanzar'); | ||
builder.agregarTransicion('calentar2','enCalor','retroceder'); | ||
builder.agregarTransicion('enCalor','levantarPelota','recoger'); | ||
builder.agregarTransicion('levantarPelota','tirarAlAire','revolearPulpito'); | ||
builder.agregarTransicion('levantarPelota','jugarConElPie','rebotarPiePulpito'); | ||
builder.agregarTransicion('tirarAlAire','resuelto','rebotarPiePulpito'); | ||
builder.agregarTransicion('jugarConElPie','resuelto','revolearPulpito'); | ||
builder.agregarTransicion('resuelto','fin','retroceder'); | ||
|
||
builder.agregarError('inicial', 'recoger', 'Primero hay que entrar en calor'); | ||
builder.agregarError('inicial', 'revolearPulpito', 'Primero hay que entrar en calor y agarrar la pelota'); | ||
builder.agregarError('inicial', 'rebotarPiePulpito', 'Primero hay que entrar en calor y agarrar la pelota'); | ||
builder.agregarError('inicial', 'retroceder', 'Primero hay que avanzar y entrar en calor'); | ||
|
||
builder.agregarError('posCorrecta', 'recoger', 'Primero hay que entrar en calor'); | ||
builder.agregarError('posCorrecta', 'revolearPulpito', 'Primero hay que entrar en calor y agarrar la pelota'); | ||
builder.agregarError('posCorrecta', 'rebotarPiePulpito', 'Primero hay que entrar en calor y agarrar la pelota'); | ||
|
||
builder.agregarError('calentar1', 'revolearPulpito', 'Primero hay que entrar en calor y agarrar la pelota'); | ||
builder.agregarError('calentar1', 'rebotarPiePulpito', 'Primero hay que entrar en calor y agarrar la pelota'); | ||
builder.agregarError('calentar1', 'retroceder', 'Primero hay que avanzar, entrar en calor y agarrar la pelota'); | ||
|
||
builder.agregarError('calentar2', 'revolearPulpito', 'Primero hay que entrar en calor y agarrar la pelota'); | ||
builder.agregarError('calentar2', 'rebotarPiePulpito', 'Primero hay que entrar en calor y agarrar la pelota'); | ||
|
||
builder.agregarError('enCalor', 'revolearPulpito', 'Primero hay que agarrar la pelota'); | ||
builder.agregarError('enCalor', 'rebotarPiePulpito', 'Primero hay que agarrar la pelota'); | ||
builder.agregarError('enCalor', 'retroceder', 'Primero hay que agarrar la pelota'); | ||
|
||
builder.agregarError('levantarPelota', 'retroceder', 'Primero hay que jugar con la pelota'); | ||
|
||
this.estado = builder.estadoInicial(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
/// <reference path = "../../node_modules/pilasweb/dist/pilasweb.d.ts" /> | ||
/// <reference path = "EscenaActividad.ts" /> | ||
/// <reference path = "../actores/Cuadricula.ts" /> | ||
/// <reference path = "../actores/segundoCiclo/Capy/Capy.ts" /> | ||
/// <reference path = "../actores/NaveAnimada.ts" /> | ||
/// <reference path = "../actores/segundoCiclo/Capy/Papel.ts" /> | ||
/// <reference path = "../actores/segundoCiclo/Capy/Lata.ts" /> | ||
/// <reference path = "../actores/segundoCiclo/Capy/Tacho.ts" /> | ||
/// <reference path = "../actores/Tablero.ts" /> | ||
/// <reference path = "../actores/ObservadoAnimado.ts" /> | ||
/// <reference path = "../actores/ActorCompuesto.ts" /> | ||
/// <reference path = "EstadosDeEscena.ts" /> | ||
/// <reference path = "../habilidades/Flotar.ts" /> | ||
|
||
class LimpiandoElHumedal extends EscenaActividad { | ||
compus; | ||
fondo; | ||
cuadricula; | ||
papel; | ||
lata; | ||
tacho; | ||
yacare; | ||
|
||
iniciar() { | ||
this.fondo = new Fondo('fondo.capy.png', 0, 0); | ||
|
||
this.cuadricula = new Cuadricula(0, 0, 4, 5, | ||
{ ancho: 380, alto: 380 }, | ||
{ | ||
grilla: 'casillas.capy.png', | ||
cantFilas: 1, | ||
cantColumnas: 16, | ||
bordesDecorados: true, | ||
relAspecto: 1 | ||
}); | ||
|
||
this.crearActores(); | ||
this.crearTableros(); | ||
this.crearEstado(); | ||
} | ||
|
||
private crearActores() { | ||
this.crearAutomata(); | ||
|
||
var elTacho = new Tacho(); | ||
this.cuadricula.agregarActor(elTacho, this.cuadricula.cantFilas - 1, 0); | ||
this.tacho = new ActorCompuesto(0, 0, { subactores: [elTacho] }); | ||
this.tacho.escala *= 0.9; | ||
this.tacho.y -= 20; | ||
this.tacho.x += 10; | ||
|
||
this.yacare = new Yacare(); | ||
this.cuadricula.agregarActor(this.yacare, this.cuadricula.cantFilas - 1, 2); | ||
this.yacare.escala *= 2; | ||
this.yacare.y -= 20; | ||
this.yacare.aprender(Flotar, { Desvio: 2 }); | ||
|
||
this.lata = new Lata(); | ||
this.lata.cantidad = 3; | ||
this.papel = new Papel(); | ||
this.papel.cantidad = 3; | ||
this.cuadricula.agregarActor(this.lata, 0, 0); | ||
this.lata.aprender(Flotar, { Desvio: 2 }); | ||
this.cuadricula.agregarActor(this.papel, 0, this.cuadricula.cantColumnas - 1); | ||
this.papel.aprender(Flotar, { Desvio: 2 }); | ||
this.lata.escala *= 0.8; | ||
this.papel.escala *= 0.8; | ||
} | ||
|
||
private crearAutomata() { | ||
this.automata = new ActorCompuesto(0, 0, { subactores: [new Capy()] }); | ||
this.cuadricula.agregarActorEnPerspectiva(this.automata, this.cuadricula.cantFilas - 1, 0, false); | ||
this.automata.escala = 0.8; | ||
this.automata.y += 50; | ||
} | ||
|
||
private crearTableros() { | ||
Trait.toObject(ObservadoConDisminuir, this.papel); | ||
Trait.toObject(ObservadoConDisminuir, this.lata); | ||
|
||
this.lata.registrarObservador( | ||
new Tablero(-150, 190, { texto: "Lata" })); | ||
this.papel.registrarObservador( | ||
new Tablero(150, 190, { texto: "Papel" })); | ||
|
||
this.papel.changed(); | ||
this.lata.changed(); | ||
} | ||
|
||
private crearEstado() { | ||
var builder = new BuilderStatePattern(this, 'faltanMateriales'); | ||
builder.agregarEstado('tachoLleno'); | ||
builder.agregarEstadoAceptacion('montandoYacare'); | ||
builder.agregarError('faltanMateriales', 'montar', '¡No puedo montar el yacaré sin antes haber limpiado el humedal!'); | ||
builder.agregarError('faltanMateriales', 'irse', '¡No puedo irme sin antes haber limpiado el humedal!'); | ||
|
||
builder.agregarTransicion('faltanMateriales', 'tachoLleno', 'colocar', | ||
() => this.lata.cantidad == 0 && this.papel.cantidad == 0); | ||
builder.agregarTransicion('tachoLleno', 'montandoYacare','irse'); | ||
|
||
this.estado = builder.estadoInicial(); | ||
} | ||
|
||
actualizar(): void { | ||
super.actualizar(); | ||
if( this.tacho.nombreAnimacionActual() != "lleno" && | ||
( this.lata.cantidad != 3 || this.papel.cantidad != 3 ) && | ||
this.automata.casillaActual() === this.tacho.subactores[0].casillaActual() ) | ||
this.tacho.cargarAnimacion("lleno") | ||
} | ||
} |
Oops, something went wrong.