Skip to content

Commit

Permalink
Merge 'origin' into manic
Browse files Browse the repository at this point in the history
  • Loading branch information
danielferro69 committed Jun 14, 2023
2 parents 6bfa720 + 7d7649f commit 7d4a428
Show file tree
Hide file tree
Showing 33 changed files with 366 additions and 59 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pilas-bloques-exercises",
"version": "1.2.19",
"version": "1.2.22",
"description": "Exercises for Pilas Bloques",
"homepage": "http://pilasbloques.program.ar",
"author": {
Expand Down
4 changes: 3 additions & 1 deletion src/actores/PelotaAnimada.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/// <reference path = "../actores/ActorAnimado.ts" />

class PelotaAnimada extends ActorAnimado {
static _grilla = 'pelotaAnimada.png'

constructor(x: number, y: number) {
super(x, y, { grilla: 'pelotaAnimada.png', cantColumnas: 16 })
super(x, y, { cantColumnas: 17 })
this.definirAnimacion("patear", [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], 12)
this.definirAnimacion("desaparecer", [16],12)
}

}
39 changes: 39 additions & 0 deletions src/actores/segundoCiclo/Chuy/Chuy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/// <reference path="../../ActorAnimado.ts"/>
/// <reference path="../../../comportamientos/ComportamientoAnimado.ts"/>

class Chuy extends ActorAnimado {
static _grilla = 'actor.chuy.png'

constructor() {
super(0,0,{
cantColumnas: 10,cantFilas: 11});
this.definirAnimacion("parado",
new Cuadros(5).repetirVeces(16)
.concat([6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 11, 12, 13, 14, 15, 11, 12, 13, 14, 15, 11, 12, 13, 14, 15, 11, 11, 11, 16, 17, 18, 18, 18, 18, 18, 19, 20, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 47, 47, 47, 47, 47, 47, 47, 47, 47, 49, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50])
.concat(new Cuadros(5).repetirVeces(30))
.concat([6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 11, 12, 13, 14, 15, 11, 12, 13, 14, 15, 11, 12, 13, 14, 15, 11, 11, 11, 16, 17, 18, 18, 18, 18, 18, 19, 20, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 47, 47, 47, 47, 47, 47, 47, 47, 47, 49, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50])
.concat(new Cuadros(5).repetirVeces(30))
.concat([6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 11, 12, 13, 14, 15, 11, 12, 13, 14, 15, 11, 12, 13, 14, 15, 11, 11, 11, 16, 17, 18, 18, 18, 18, 18, 19, 20, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 47, 47, 47, 47, 47, 47, 47, 47, 47, 49, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50])
.concat(new Cuadros(5).repetirVeces(16)),
20, true);
this.definirAnimacion("correr", [68, 69, 70, 71, 72, 73, 74, 75, 76], 12);
this.definirAnimacion("correrChocando", [68, 69, 70, 71, 72, 73, 74, 75, 76], 12)
this.definirAnimacion("obstaculo", [0, 1, 1, 2, 2, 3, 3, 4, 4, 4], 12)
this.definirAnimacion("error", [101, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105]
, 12)
this.definirAnimacion("recoger", [97, 98, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 100, 97], 12);
this.definirAnimacion("usarPaleta", [51, 52, 53, 54, 55, 56, 57, 58, 57, 56, 55, 56, 57, 58, 57, 56, 55, 56, 57, 58, 57, 56, 55, 56, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67], 12);
this.definirAnimacion("rebotarPelota", [87, 88, 89, 90, 91, 92, 93, 92, 91, 90, 94, 95, 90, 91, 92, 93, 91, 94, 91, 93, 90, 94, 96, 87, 87, 87, 87], 12);
this.definirAnimacion("patear", [87, 88, 89, 90, 91, 92, 93, 92, 91, 90, 94, 95, 90, 91, 92, 93, 91, 94, 91, 93, 90, 94, 96, 87, 87, 87, 87], 12)
this.definirAnimacion("rebotarPulpito", [77, 78, 79, 80, 81, 82, 83, 82, 81, 80, 84, 85, 80, 81, 82, 83, 81, 84, 81, 83, 80, 84, 86, 77, 77, 77, 77], 12);
}


puedeMoverseAbajo(){
return this.tocandoFlechaAbajo() && !this.tieneEnLaCasillaDeAbajo("Obstaculo")
}

puedeMoverseDerecha(){
return this.tocandoFlechaDerecha() && !this.tieneEnLaCasillaASuDerecha("Obstaculo")
}
}
9 changes: 9 additions & 0 deletions src/actores/segundoCiclo/Chuy/Paleta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/// <reference path="../../ActorAnimado.ts"/>

class Paleta extends ActorAnimado {
static _grilla = 'actor.paleta.png'

constructor() {
super(0, 0, {cantColumnas:1, cantFilas: 1});
}
}
19 changes: 19 additions & 0 deletions src/actores/segundoCiclo/Chuy/Pelotas.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/// <reference path="../../ActorAnimado.ts"/>

class Pulpito extends ActorAnimado {
static _grilla = 'actor.pelota.png'

constructor() {
super(0, 0, { cantColumnas: 2 });
this.definirAnimacion("desaparecer", [1], 12);
}
}

class PingPong extends ActorAnimado {
static _grilla = 'actor.pelotita.png'

constructor() {
super(0, 0, { cantColumnas: 2 });
this.definirAnimacion("desaparecer", [1], 12);
}
}
9 changes: 9 additions & 0 deletions src/actores/segundoCiclo/Chuy/Trofeo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/// <reference path="../../ActorAnimado.ts"/>

class Trofeo extends ActorAnimado {
static _grilla = 'actor.trofeo.png'

constructor() {
super(0, 0, {cantColumnas:1, cantFilas: 1});
}
}
3 changes: 2 additions & 1 deletion src/actores/segundoCiclo/Yvoty/Celular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ class Celular extends ActorAnimado {
static _grilla = 'actor.celular.png'

constructor(prendido = false) {
super(0, 0, {cantColumnas: 2});
super(0, 0, {cantColumnas: 3});
this.definirAnimacion("cargado", [1], 1);
this.definirAnimacion("prendido", [1], 1);
this.definirAnimacion("descargado", [0], 1);
this.definirAnimacion("desaparecer", [2], 1);

if(prendido) this.cargarAnimacion("prendido")
}
Expand Down
31 changes: 19 additions & 12 deletions src/actores/segundoCiclo/Yvoty/Yvoty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,30 @@ class Yvoty extends ActorAnimado {
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);
new Cuadros(4).repetirVeces(1).
concat([5, 6, 7, 8, 7, 6, 5]).
concat(new Cuadros(9).repetirVeces(7)).
concat([4, 5, 6, 7, 8, 7, 6, 5]).
concat(new Cuadros(9).repetirVeces(16)).
concat([10, 11, 12]).
concat([4, 5, 6, 7, 8, 7, 6, 5]).
concat(new Cuadros(9).repetirVeces(7)).
concat([4, 5, 6, 7, 8, 7, 6, 5]).
concat(new Cuadros(9).repetirVeces(16)).
concat([10, 11, 12]).
concat(new Cuadros(9).repetirVeces(11)).
concat([13, 14, 14]).
concat(new Cuadros(15).repetirVeces(15)).
concat([14, 14, 13, 12]).
concat(new Cuadros(9).repetirVeces(9))
, 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("recoger", [0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 0, 0, 0], 12);
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("sacarFoto", [38, 38, 38, 39, 39, 40, 40, 40, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 40, 40, 40, 40], 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);
}
}
Binary file modified src/assets/actor.celular.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/actor.chuy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/actor.paleta.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/actor.pelota.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/actor.pelotita.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/actor.trofeo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/actor.yvoty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/casilla.futbolChuy1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/casilla.futbolChuy2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/casillas.chuy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/fondo.chuy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/obstaculo.chuy1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/obstaculo.chuy2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/obstaculo.chuy3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/obstaculo.chuy4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/pelotaAnimada.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/escenas/EscenaActividad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ class EscenaActividad extends Base {
return this.obtenerActoresConEtiqueta(etiqueta).length;
}

noHay(actor): boolean {
return this.contarActoresConEtiqueta(actor) == 0
}

todosLosActoresCumplen(actor, estado) {
return this.obtenerActoresConEtiqueta(actor).every(o => o.nombreAnimacionActual() == estado);
}

/**
* Computa un multiplicador que crece según la cantidad de filas y columnas de la cuadrícula.
* El multiplicador es 1 si la cuadrícula es de 1x1, y crece acotado por maxRatio.
Expand Down
39 changes: 39 additions & 0 deletions src/escenas/FutbolAlSur.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/// <reference path = "FutbolRobots.ts" />

class FutbolAlSur extends FutbolRobots {

static clasesDeActoresInvolucrados(): typeof ActorAnimado[] {
return [Chuy, PelotaAnimada];
};

static imagenesAdicionales(): string[] {
return ['casilla.futbolChuy1.png', 'casilla.futbolChuy2.png'].concat(Obstaculo.imagenesPara('chuy'));
}

static pathFondo(): string {
return 'fondo.chuy.png';
}

ajustarAutomata() {
this.automata.traer_al_frente()
this.automata.escala *= this.escalaSegunCuadricula(3.3);
this.automata.setY(this.automata.getY() + this.automata.getAlto() / 4);
this.automata.setX(this.automata.getX() + 10)
}

obtenerAutomata() {
return new Chuy();
}

obtenerFondo() {
return new Fondo('fondo.chuy.png', 0, 0);
}

imagenCasillas() {
return 'casilla.futbolChuy1.png'
}

imagenCasillasInicio() {
return 'casilla.futbolChuy2.png'
}
}
72 changes: 46 additions & 26 deletions src/escenas/FutbolRobots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,55 @@
/// <reference path="../actores/CuadriculaMultiple.ts"/>
/// <reference path = "EstadosDeEscena.ts" />

class FutbolRobots extends EscenaActividad{
automata : ActorAnimado;
class FutbolRobots extends EscenaActividad {
automata: ActorAnimado;
fondo;
cuadricula : CuadriculaMultiple;
cuadricula: CuadriculaMultiple;
cantPateadas;
cantidadFilas;

iniciar() {
this.fondo = new Fondo('fondos.futbolRobots.png',0,0);
this.cantidadFilas=8;

this.cuadricula = new CuadriculaMultiple(
new DefinidorColumnasRandom(this.cantidadFilas,6),
0,-50,
{separacionEntreCasillas: 5},
{grilla:'casilla.futbolRobots2.png', alto:40,ancho:40})
this.cuadricula.cambiarImagenInicio('casilla.futbolRobots1.png');

this.automata = new RobotAnimado(0, 0);
this.cuadricula.agregarActor(this.automata,0,0);
var casilla = this.cuadricula.casilla(0, 0);
this.automata.escalarAAlto(3.5 * casilla.alto);
this.automata.abajo = casilla.y - (0.25 * casilla.alto);
this.automata.radio_de_colision = this.automata.alto / 2.5;

for (var fila=0;fila<this.cantidadFilas;++fila){
this.cuadricula.agregarActor(new PelotaAnimada(0,0),fila,this.cuadricula.dameIndexUltimaPosicion(fila))
};

this.estado = new EstadoParaContarBuilder(this, 'patear', this.cantidadFilas).estadoInicial();
}
this.fondo = this.obtenerFondo()
this.cantidadFilas = 8;

this.cuadricula = new CuadriculaMultiple(
new DefinidorColumnasRandom(this.cantidadFilas, 6),
0, -50,
{ separacionEntreCasillas: 5 },
{ grilla: this.imagenCasillas(), alto: 40, ancho: 40 })
this.cuadricula.cambiarImagenInicio(this.imagenCasillasInicio());

this.automata = this.obtenerAutomata()
this.cuadricula.agregarActor(this.automata, 0, 0);
this.automata.radio_de_colision = this.automata.alto / 2.5;

for (var fila = 0; fila < this.cantidadFilas; ++fila) {
this.cuadricula.agregarActor(new PelotaAnimada(0, 0), fila, this.cuadricula.dameIndexUltimaPosicion(fila))
};
this.ajustarAutomata()

this.estado = new EstadoParaContarBuilder(this, 'patear', this.cantidadFilas).estadoInicial();
}

ajustarAutomata() {
var casilla = this.cuadricula.casilla(0, 0);
this.automata.escalarAAlto(3.5 * casilla.alto);
this.automata.abajo = casilla.y - (0.25 * casilla.alto);
}

obtenerAutomata() {
return new RobotAnimado(0, 0);
}

obtenerFondo() {
return new Fondo('fondos.futbolRobots.png', 0, 0);
}

imagenCasillas() {
return 'casilla.futbolRobots2.png'
}

imagenCasillasInicio() {
return 'casilla.futbolRobots1.png'
}
}
13 changes: 12 additions & 1 deletion src/escenas/InstalandoJuegosYvoty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ class InstalandoJuegosYvoty extends InstalandoJuegos {
cuadricula;
estado;

static clasesDeActoresInvolucrados(): typeof ActorAnimado[] {
return [Yvoty, CompuAnimada];
};

static pathFondo(): string {
return 'fondo.yvoty.png';
}

static imagenesAdicionales(): string[] {
return Casilla.imagenesPara('yvoty').concat(Obstaculo.imagenesPara('yvoty'));
}

colocarCuadricula(){
this.cuadricula = new Cuadricula(0, -20, 1, 4,
Expand All @@ -32,7 +43,7 @@ class InstalandoJuegosYvoty extends InstalandoJuegos {
this.automata = new Yvoty();
this.cuadricula.agregarActor(this.automata, 0, 0);
this.automata.escala *= this.escalaSegunCuadricula(1.5);
this.automata.setY(0);
this.automata.setY(3);
this.automata.x -= 10
}

Expand Down
Loading

0 comments on commit 7d4a428

Please sign in to comment.