-
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.
- Loading branch information
Showing
24 changed files
with
305 additions
and
10 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
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,21 @@ | ||
/// <reference path="../../ActorAnimado.ts"/> | ||
class Celular extends ActorAnimado { | ||
static _grilla = 'actor.celular.png' | ||
|
||
constructor(prendido = false) { | ||
super(0, 0, {cantColumnas: 2}); | ||
this.definirAnimacion("cargado", [1], 1); | ||
this.definirAnimacion("prendido", [1], 1); | ||
this.definirAnimacion("descargado", [0], 1); | ||
|
||
if(prendido) this.cargarAnimacion("prendido") | ||
} | ||
} | ||
|
||
class Cargador extends ActorAnimado { | ||
static _grilla = 'actor.cargador.png' | ||
|
||
constructor() { | ||
super(0, 0, { cantColumnas:1, cantFilas: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/// <reference path="../../ActorAnimado.ts"/> | ||
class Luciernaga extends ActorAnimado { | ||
static _grilla = 'actor.luciernaga.png' | ||
|
||
constructor() { | ||
super(0, 0, {cantColumnas: 2}); | ||
this.definirAnimacion("dormida",[0],1); | ||
this.definirAnimacion("despierta",[1],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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/// <reference path="../../ActorAnimado.ts"/> | ||
|
||
class Mariposa extends ActorAnimado { | ||
static _grilla = 'actor.mariposa.png' | ||
|
||
constructor() { | ||
super(0, 0, {cantColumnas:1, cantFilas: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/// <reference path="../../ActorAnimado.ts"/> | ||
/// <reference path="../../../comportamientos/ComportamientoAnimado.ts"/> | ||
|
||
class Yvoty extends ActorAnimado { | ||
static _grilla = 'actor.yvoty.png' | ||
|
||
constructor() { | ||
super(0, 0, { cantColumnas: 10, cantFilas: 8 }); | ||
|
||
this.definirAnimacion("parado", | ||
new Cuadros(0).repetirVeces(16) | ||
.concat([4, 5, 6, 7, 8, 7, 6, 5, 4, 9, 9, 9, 9, 9, 9, 9, 4, 5, 6, 7, 8, 7, 6, 5, 4, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 11, 12, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 13, 13, 14, 14, 14, 14, 14, 14, 14, 15, 15, 14, 14, 14, 14]) | ||
.concat(new Cuadros(0).repetirVeces(30)) | ||
.concat([4, 5, 6, 7, 8, 7, 6, 5, 4, 9, 9, 9, 9, 9, 9, 9, 4, 5, 6, 7, 8, 7, 6, 5, 4, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 11, 12, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 13, 13, 14, 14, 14, 14, 14, 14, 14, 15, 15, 14, 14, 14, 14]) | ||
.concat(new Cuadros(0).repetirVeces(30)) | ||
.concat([4, 5, 6, 7, 8, 7, 6, 5, 4, 9, 9, 9, 9, 9, 9, 9, 4, 5, 6, 7, 8, 7, 6, 5, 4, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 11, 12, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 13, 13, 14, 14, 14, 14, 14, 14, 14, 15, 15, 14, 14, 14, 14]) | ||
.concat(new Cuadros(0).repetirVeces(16)) | ||
.concat([14]) | ||
.concat(new Cuadros(0).repetirVeces(5)), | ||
20, true); | ||
this.definirAnimacion("correr", [52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71], 20); | ||
this.definirAnimacion("correrChocando", [52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71], 20) | ||
this.definirAnimacion("obstaculo", [20, 21, 21, 22, 23, 24, 24, 24, 24, 25, 26, 27, 28, 29, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28], 12) | ||
this.definirAnimacion("error", [30, 30, 30, 30, 30, 30, 30, 31, 32, 33, 34, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 36, 36, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37], 12) | ||
this.definirAnimacion("recoger", [0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 20); | ||
this.definirAnimacion("usarCelu", [38, 38, 38, 39, 39, 40, 40, 40, 41, 42, 43, 41, 43, 42, 42, 42, 44, 45, 46, 47, 46, 42, 42, 42, 45, 46, 46, 46, 45, 44, 48, 48, 48, 49, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 51, 51, 38, 38, 38, 38, 38, 38, 38], 20); | ||
this.definirAnimacion("sacarFoto", [38, 38, 38, 39, 39, 40, 40, 40, 41, 42, 43, 41, 43, 42, 42, 42, 44, 45, 46, 47, 46, 42, 42, 42, 45, 46, 46, 46, 45, 44, 48, 48, 48, 49, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 51, 51, 38, 38, 38, 38, 38, 38, 38], 20); | ||
this.definirAnimacion("escribir", [16, 16, 17, 17, 18, 18, 18, 19, 19, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18], 20); | ||
} | ||
} |
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.
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.
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.
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.
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.
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,32 @@ | ||
/// <reference path = "../../node_modules/pilasweb/dist/pilasweb.d.ts"/> | ||
/// <reference path = "Encender.ts" /> | ||
|
||
class CargarCelular extends Encender { | ||
|
||
public nombreAnimacion(): String { | ||
return "usarCelu" | ||
} | ||
|
||
public nombreProximaAnimacion(): string { | ||
return "cargado" | ||
} | ||
|
||
configurarVerificaciones() { | ||
super.configurarVerificaciones() | ||
|
||
const escena = pilas.escena_actual() | ||
|
||
this.verificacionesPre.push(new Verificacion(() => escena.noHay("Cargador"), | ||
'¡Todavía no recogí el cargador!')) | ||
|
||
} | ||
|
||
postAnimacion() { | ||
super.postAnimacion() | ||
if (pilas.escena_actual().celularesCargados()) { | ||
pilas.escena_actual().estado = new Estado(() => | ||
true | ||
) | ||
} | ||
} | ||
} |
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,13 @@ | ||
/// <reference path = "../../node_modules/pilasweb/dist/pilasweb.d.ts"/> | ||
/// <reference path = "Encender.ts" /> | ||
|
||
class SacarFoto extends Encender { | ||
|
||
public nombreAnimacion(): String { | ||
return "sacarFoto" | ||
} | ||
|
||
public nombreProximaAnimacion(): string { | ||
return "despierta" | ||
} | ||
} |
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,44 @@ | ||
/// <reference path = "EscenaActividad.ts" /> | ||
/// <reference path = "../actores/Cuadricula.ts" /> | ||
/// <reference path = "../actores/CompuAnimada.ts" /> | ||
/// <reference path = "../actores/InstaladorAnimado.ts" /> | ||
/// <reference path = "../comportamientos/ComportamientoAnimado.ts" /> | ||
/// <reference path = "../comportamientos/MovimientosEnCuadricula.ts" /> | ||
|
||
class InstalandoJuegosYvoty extends InstalandoJuegos { | ||
compus; | ||
automata; | ||
fondo; | ||
cuadricula; | ||
estado; | ||
|
||
|
||
colocarCuadricula(){ | ||
this.cuadricula = new Cuadricula(0, -20, 1, 4, | ||
{ ancho: 400, alto: 380 }, | ||
{ grilla: 'casillas.yvoty.png', | ||
cantFilas: 1, | ||
cantColumnas: 16, | ||
bordesDecorados: true, | ||
relAspecto: 1, | ||
}) | ||
} | ||
|
||
imagenFondo(){ | ||
return 'fondo.yvoty.png' | ||
} | ||
|
||
colocarAutomata() { | ||
this.automata = new Yvoty(); | ||
this.cuadricula.agregarActor(this.automata, 0, 0); | ||
this.automata.escala *= this.escalaSegunCuadricula(1.5); | ||
this.automata.setY(0); | ||
this.automata.x -= 10 | ||
} | ||
|
||
ajustarCompu(compu) { | ||
compu.escala *= this.escalaSegunCuadricula(0.6) | ||
compu.setX(compu.getX() + 9) | ||
compu.setY(compu.getY() + 14) | ||
} | ||
} |
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,121 @@ | ||
/// <reference path = "../libroPrimaria/EscenaDesdeMapa.ts" /> | ||
|
||
|
||
class EscenaYvoty extends EscenaDesdeMapa { | ||
automata: Yvoty; | ||
|
||
static clasesDeActoresInvolucrados(): typeof ActorAnimado[] { | ||
return [Yvoty, Celular, Luciernaga, Cargador, Mariposa, CompuAnimada]; | ||
}; | ||
|
||
static pathFondo(): string { | ||
return 'fondo.yvoty.png'; | ||
} | ||
|
||
static imagenesAdicionales(): string[] { | ||
return Casilla.imagenesPara('yvoty').concat(Obstaculo.imagenesPara('yvoty')); | ||
} | ||
|
||
constructor(especificacion: Spec, opciones?: opcionesMapaAleatorio) { | ||
super(); | ||
this.initDesdeUnaOVariasDescripciones(especificacion, opciones); | ||
} | ||
|
||
ajustarGraficos() { | ||
this.automata.escala *= this.escalaSegunCuadricula(1.8); | ||
this.automata.setY(this.automata.getY() + this.automata.getAlto() / 4); | ||
|
||
this.obtenerActoresConEtiqueta("Luciernaga").forEach(actor => { | ||
actor.aprender(Flotar, { Desvio: 4 }); | ||
actor.escala *= this.escalaSegunCuadricula(0.8); | ||
}); | ||
|
||
this.obtenerActoresConEtiquetas(["Celular", "Mariposa"]).forEach(actor => { | ||
actor.aprender(Flotar, { Desvio: 4 }); | ||
actor.escala *= this.escalaSegunCuadricula(0.6); | ||
}); | ||
|
||
this.obtenerActoresConEtiqueta("Cargador").forEach(actor => { | ||
actor.aprender(Flotar, { Desvio: 4 }); | ||
actor.escala *= this.escalaSegunCuadricula(0.7); | ||
}); | ||
|
||
this.obtenerActoresConEtiqueta("Obstaculo").forEach(obstaculo => { | ||
obstaculo.escala *= this.escalaSegunCuadricula(1.1); | ||
}); | ||
} | ||
|
||
mapearIdentificadorAActor(id, nroFila, nroColumna): ActorAnimado { | ||
switch (id) { | ||
case 'A': return this.automata; | ||
case 'O': return this.obtenerObstaculo(nroFila, nroColumna); | ||
case 'C': return new Celular(); | ||
case 'P': return new Celular(true); //celular prendido | ||
case 'K': return new Cargador(); | ||
case 'L': return new Luciernaga(); | ||
case 'M': return new Mariposa(); | ||
case 'T': return new CompuAnimada(0, 0); | ||
default: throw new Error("El identificador '" + id + | ||
"' no es válido en una escena de Yvoty."); | ||
} | ||
} | ||
|
||
obtenerAutomata(): Yvoty { | ||
return new Yvoty(); | ||
} | ||
|
||
obtenerObstaculo(fila: number, columna: number): Obstaculo { | ||
let archivosObstaculos = ["obstaculo.yvoty1.png", "obstaculo.yvoty2.png", "obstaculo.yvoty3.png", "obstaculo.yvoty4.png"]; | ||
return new Obstaculo(archivosObstaculos, (fila + 1) + (fila + 1) * (columna + 1)); | ||
} | ||
|
||
todosLosActoresCumplen(actor, estado) { | ||
return this.obtenerActoresConEtiqueta(actor).every(o => o.nombreAnimacionActual() == estado); | ||
} | ||
|
||
luciernagasDespiertas(): boolean { | ||
return this.todosLosActoresCumplen("Luciernaga", "despierta") | ||
} | ||
|
||
celularesCargados(): boolean { | ||
return this.todosLosActoresCumplen("Celular", "cargado") && this.noHay("Cargador") | ||
} | ||
|
||
celularResuelto(): boolean { | ||
return this.celularesCargados() || this.noHay("Celular") | ||
} | ||
|
||
computadorasPrendidas(): boolean { | ||
return this.todosLosActoresCumplen("CompuAnimada", "prendida") | ||
} | ||
|
||
noHay(actor): boolean { | ||
return this.contarActoresConEtiqueta(actor) == 0 | ||
} | ||
|
||
estaResueltoElProblema(): boolean { | ||
return this.luciernagasDespiertas() && this.celularResuelto() && this.noHay("Mariposa") && this.computadorasPrendidas() | ||
} | ||
|
||
archivoFondo() { | ||
return "fondo.yvoty.png"; | ||
} | ||
cuadriculaX() { | ||
return 0; | ||
} | ||
cuadriculaY() { | ||
return -20; | ||
} | ||
opsCuadricula() { | ||
return { ancho: 400, alto: 380 }; | ||
} | ||
opsCasilla() { | ||
return { | ||
grilla: 'casillas.yvoty.png', | ||
cantFilas: 1, | ||
cantColumnas: 16, | ||
bordesDecorados: true, | ||
relAspecto: 1, | ||
}; | ||
} | ||
} |