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

Dibujando (parte 1) #61

Merged
merged 13 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all 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.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pilas-bloques-exercises",
"version": "1.4.18",
"version": "1.4.22",
"description": "Exercises for Pilas Bloques",
"homepage": "http://pilasbloques.program.ar",
"author": {
Expand All @@ -27,7 +27,9 @@
"Lucas Alan Silvestri <silvestrilucasalan@gmail.com> (https://github.com/51lv3str1)",
"Diana López Alvas <dlopezalvas@gmail.com> (https://github.com/dlopezalvas)",
"Tomás Floxo Lodeiro <tomasfloxolodeiro@gmail.com> (https://github.com/tfloxolodeiro)",
"Ezequiel Pereyra <pereyra.ezequielh@gmail.com> (https://github.com/ezequielPereyra)"
"Ezequiel Pereyra <pereyra.ezequielh@gmail.com> (https://github.com/ezequielPereyra)",
"Daniel Ferro <danieloscarferro@gmail.com> (https://github.com/danielferro69)",
"Rocío González <rgonzalezt94@gmail.com> (https://github.com/rgonzalezt)"
Comment on lines +30 to +32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

],
"keywords": [
"programar",
Expand Down
1 change: 1 addition & 0 deletions src/actores/Dibujante.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class Dibujante extends ActorAnimado {
super(x, y, { grilla: 'dibujante.png', cantColumnas: 5 });
this.definirAnimacion("parado", new Cuadros([0, 1, 2, 1]).repetirVeces(4).concat(new Cuadros([0]).repetirVeces(40)), 4, true);
this.definirAnimacion("correr", [3,4,4,4,4,4], 12);
this.definirAnimacion("dibujar", [3,4,4,4,4,4], 12);
this.definirAnimacion("rotar", [3], 12);
this.definirAnimacion("saltar", [3,4,4,4,4,4], 12);
}
Expand Down
2 changes: 1 addition & 1 deletion src/actores/libroPrimaria/Coty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Coty extends ActorAnimado {
.concat([20, 21, 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, 49])
.concat(new Cuadros(0).repetirVeces(5)),
12, true);
this.definirAnimacion("correrDibujando", [50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62], 12);
this.definirAnimacion("dibujar", [50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62], 12);
this.definirAnimacion("saltar", [63, 64, 65, 66, 67, 68, 69, 69, 69, 70, 71, 72, 73, 74, 75, 76, 77], 14);
this.definirAnimacion("obstaculo", [78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100], 7.5);
this.definirAnimacion("rotar", [0], 1);
Expand Down
27 changes: 24 additions & 3 deletions src/actores/segundoCiclo/Manic/Manic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ class Manic extends ActorAnimado {
static _grilla = 'actor.manic.png'

constructor() {
super(0,0,{cantColumnas: 10, cantFilas: 9});
super(0, 0, { cantColumnas: 10, cantFilas: 9 });
this.definirAnimacion("parado",
new Cuadros(32).repetirVeces(18)
new Cuadros(32).repetirVeces(18)
.concat([33, 34, 34, 32, 32, 32, 32, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 44, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32])
.concat(new Cuadros(32).repetirVeces(18))
.concat([33, 34, 34, 32, 32, 32, 32, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 44, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32])
Expand All @@ -20,7 +20,28 @@ class Manic extends ActorAnimado {
this.definirAnimacion("error", [47, 48, 49, 50, 51, 51, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53], 12)
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);
}
}

//Usado para ejercicios de Manic dibujando, se necesita tener la grilla con mayor espacio para que no sea vea feo al dibujar y rotar, ya que el dibujo sale desde el centro de la imagen.
class ManicDibujando extends ActorAnimado {
static _grilla = 'actor.manicDibujando.png'

constructor() {
super(0, 0, { cantColumnas: 10, cantFilas: 4 });
this.definirAnimacion("parado",
new Cuadros(23).repetirVeces(18)
.concat([24, 25])
.concat(new Cuadros(23).repetirVeces(45))
.concat([24, 25])
.concat(new Cuadros(23).repetirVeces(45))
.concat([24, 25])
.concat(new Cuadros(23).repetirVeces(45))
.concat([26, 27, 28, 29, 30, 31, 32, 33, 34, 35]),
20, true);
this.definirAnimacion("rotar", [0], 1);
this.definirAnimacion("error", [17, 18, 19, 20, 21, 21, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23], 12)
this.definirAnimacion("dibujar", [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], 20);
}
}
Binary file modified src/assets/actor.manic.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.manicDibujando.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.dibujando.manic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/comportamientos/DibujarLinea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// Está pensado para iniciar la línea en el centro del receptor.
// Esto hace que no haya que hacer cálculos ni aprender qué significa Shape.regX ó cómo lo usa pilas.
// Llámenme cobarde, sí. Perdón.
// Llámenme cobarde, sí. Perdón. (x2)
Copy link
Contributor Author

@dlopezalvas dlopezalvas Nov 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Contador de cobardía.

Como la línea sale del centro del actor, para que se vea bien en Mañic (desde sus patines) había que hacer alguna macumba para cambiar la x con el y al momento que rotara. Se me hizo más rápido crear al actor MañicDibujando que solo tenga más espacio en la imagen para que el centro sean sus patines.
No lo hice en la misma grilla para que no pierda calidad al ser más chica.

class DibujarLinea extends MovimientoAnimado {

iniciar(receptor) {
Expand Down
48 changes: 48 additions & 0 deletions src/escenas/libroPrimaria/DibujandoManic.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
abstract class DibujandoManic extends DibujandoFiguras {

xManic: number;
yManic: number;

static clasesDeActoresInvolucrados(): typeof ActorAnimado[] {
return [ManicDibujando]
}

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

iniciar() {
super.iniciar();
this.automata.aprender(EstallarAlSalirDePantalla, {});
}

crearAutomata() {
this.automata = new ManicDibujando();
this.automata.escala = 0.8;
this.automata.x = this.coordenadasAutomata().x;
this.automata.y = this.coordenadasAutomata().y;
}

colorDibujo() {
return pilas.colores.rgb(230, 240, 6);
}

colorDibujoEsperado(){
return pilas.colores.gris;
}

coordenadasAutomata() {
return {x: 0, y: 0}
}
}

class DibujandoCuadradoManic extends DibujandoManic {

coordenadasAutomata() {
return { x: -50, y: 50 }
}

puntosEsperados() {
return [{ x: -50, y: 50 }, { x: -40, y: 50 }, { x: -30, y: 50 }, { x: -20, y: 50 }, { x: -10, y: 50 }, { x: 0, y: 50 }, { x: 10, y: 50 }, { x: 20, y: 50 }, { x: 30, y: 50 }, { x: 40, y: 50 }, { x: 50, y: 50 }, { x: 50, y: 40 }, { x: 50, y: 30 }, { x: 50, y: 20 }, { x: 50, y: 10 }, { x: 50, y: 0 }, { x: 50, y: -10 }, { x: 50, y: -20 }, { x: 50, y: -30 }, { x: 50, y: -40 }, { x: 50, y: -50 }, { x: 40, y: -50 }, { x: 30, y: -50 }, { x: 20, y: -50 }, { x: 10, y: -50 }, { x: 0, y: -50 }, { x: -10, y: -50 }, { x: -20, y: -50 }, { x: -30, y: -50 }, { x: -40, y: -50 }, { x: -50, y: -50 }, { x: -50, y: -40 }, { x: -50, y: -30 }, { x: -50, y: -20 }, { x: -50, y: -10 }, { x: -50, y: 0 }, { x: -50, y: 10 }, { x: -50, y: 20 }, { x: -50, y: 30 }, { x: -50, y: 40 }, { x: -50, y: 50 }];
}
}
Loading