-
Notifications
You must be signed in to change notification settings - Fork 1
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
Changes from all commits
0eac7ca
ef7e153
b79fa94
64e1cfa
2c5cc8e
4c1f9d4
37dda4e
e6f0323
e00ba01
18ff3d9
1628861
191b6ff
220b1c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
class DibujarLinea extends MovimientoAnimado { | ||
|
||
iniciar(receptor) { | ||
|
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 }]; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️