Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paleteando con parametros #60

Merged
merged 8 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.4.15",
"version": "1.4.18",
"description": "Exercises for Pilas Bloques",
"homepage": "http://pilasbloques.program.ar",
"author": {
Expand Down
1 change: 0 additions & 1 deletion src/actores/segundoCiclo/Capy/CapySolo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference path="../../ActorAnimado.ts"/>
/// <reference path="../../../comportamientos/ComportamientoAnimado.ts"/>e

class CapySolo extends ActorAnimado {
static _grilla = 'actor.capySolo.png'
Expand Down
3 changes: 2 additions & 1 deletion src/actores/segundoCiclo/Chuy/Chuy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ class Chuy extends ActorAnimado {
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);
}
this.definirAnimacion("surfear", [68, 69, 70, 71, 72, 73, 74, 75, 76], 12);
}
}
1 change: 1 addition & 0 deletions src/actores/segundoCiclo/Chuy/Pelotas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class Pulpito extends ActorAnimado {

constructor() {
super(0, 0, { cantColumnas: 2 });
this.definirAnimacion("correr", [0], 12)
this.definirAnimacion("desaparecer", [1], 12);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/actores/segundoCiclo/Manic/Manic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ class Manic extends ActorAnimado {
this.definirAnimacion("recoger", [28, 29, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 31, 28], 12);
this.definirAnimacion("usarCatalejo", [54, 55, 56, 57, 58, 59, 60, 61, 61, 62, 62, 62, 63, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 77, 78, 79, 80, 81, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82], 20);
this.definirAnimacion("dibujar", [0, 1, 2, 3, 4, 5, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27], 20);
this.definirAnimacion("surfear", [0, 1, 2, 3, 4, 5, 6, 7, 6, 5, 6, 7, 6, 5, 6, 7, 7], 20);
}
}
1 change: 1 addition & 0 deletions src/actores/segundoCiclo/Manic/Telescopio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class Telescopio extends ActorAnimado {
super(0, 0, {cantColumnas: 2});
this.definirAnimacion("roto", [1], 1);
this.definirAnimacion("arreglado", [0], 1);
this.definirAnimacion("recoger", [0], 1)

if(arreglado)
this.cargarAnimacion("arreglado")
Expand Down
1 change: 1 addition & 0 deletions src/actores/segundoCiclo/Yvoty/Yvoty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ class Yvoty extends ActorAnimado {
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, 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);
this.definirAnimacion("surfear", [52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71], 20)
}
}
Binary file added src/assets/casilla.chuy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/comportamientos/Escapar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Escapar extends MovimientoAnimado {
}

preAnimacion(){
this.argumentos.direccion = new Direct(1, 5);
this.argumentos.direccion = this.argumentos.direccion || new Direct(1,5)
this.argumentos.distancia = 600;
this.argumentos.velocidad = 8;
this.argumentos.cantPasos = 40;
Expand Down Expand Up @@ -42,4 +42,4 @@ class Escapar extends MovimientoAnimado {

return (noTieneQueEscaparConNingunActor || colisionaConElActorParaEscapar);
}
}
}
44 changes: 0 additions & 44 deletions src/comportamientos/Irse.ts

This file was deleted.

6 changes: 5 additions & 1 deletion src/comportamientos/Sostener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Sostener extends Interactuar {
var objetoAgarrado: any = interactuado.clonar()
objetoAgarrado.escala = interactuado.escala
objetoAgarrado.y = this.receptor.y
objetoAgarrado.x = this.receptor.subactores[0].derecha - (this.receptor.subactores[0].ancho / 4)
objetoAgarrado.x = this.posicionHorizontalDeProximoSubactor()
this.receptor.agregarSubactor(objetoAgarrado)
objetoAgarrado.cargarAnimacion("correr") // porque tiene que cargar la misma imagen que va a usar al moverse

Expand All @@ -29,6 +29,10 @@ class Sostener extends Interactuar {

}

posicionHorizontalDeProximoSubactor(): number {
return this.receptor.subactores[0].derecha - (this.receptor.subactores[0].ancho / 4)
}

configurarVerificaciones() {
super.configurarVerificaciones()
this.verificacionesPre.push(new Verificacion(() => this.puedoSostener(), "No puedo sostener dos cosas a la vez..."))
Expand Down
75 changes: 75 additions & 0 deletions src/escenas/PaleteandoConParametros.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/// <reference path = "EscenaActividad.ts" />
/// <reference path = "../actores/ScoutAnimado.ts" />
/// <reference path = "../actores/Cuadricula.ts" />
/// <reference path = "../actores/CompuAnimada.ts" />


class PaleteandoConParametros extends EscenaActividad {
cuadricula;
cantidadFilas;
cantidadColumnas;

iniciar() {
this.cantidadFilas = 5;
this.cantidadColumnas = 5;

let matriz = [
['T','T','T','T','T'],
['T','F','F','F','T'],
['T','F','F','F','T'],
['T','F','F','F','T'],
['T','T','T','T','T']
];


this.cuadricula = new CuadriculaEsparsa(0, 0,
{ separacionEntreCasillas: 5, ancho: 360, alto: 360},
{grilla: 'casilla.chuy.png'}, matriz)

this.fondo = new Fondo('fondo.chuy.png', 0, 0);

this.agregarPelotasDePingPong();

this.automata = new Chuy();
this.cuadricula.agregarActor(this.automata, 0, 0);
this.automata.escala *= 3;
this.automata.y += 50;
}

private agregarPelotasDePingPong() {

for (var i=1; i<this.cantidadColumnas-1; i++){
if (Math.random() < .5) {
this.agregarPelotaDePingPong(0, i);
//filaSuperior
}

if (Math.random() < .5) {
this.agregarPelotaDePingPong(this.cantidadFilas-1, i);
}
//filaInferior
}

for (var j=1; j<this.cantidadFilas-1; j++){
if (Math.random() < .5) {
this.agregarPelotaDePingPong(j, 0);
}

if (Math.random() < .5) {
this.agregarPelotaDePingPong(j, this.cantidadColumnas-1);
}
}
}

private agregarPelotaDePingPong(fila, columna) {
let pelota = new PingPong();
this.cuadricula.agregarActor(pelota, fila, columna);
pelota.aprender(Flotar, { Desvio: 2 });
pelota.escala *= 0.3;
}

estaResueltoElProblema() {
return pilas.escena_actual().noHay("PingPong");
}

}
Loading
Loading