-
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
1 parent
d1c0f58
commit 0bfb030
Showing
2 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
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,97 @@ | ||
/// <reference path = "EscenaActividad.ts" /> | ||
/// <reference path = "../actores/ScoutAnimado.ts" /> | ||
/// <reference path = "../actores/Cuadricula.ts" /> | ||
/// <reference path = "../actores/CompuAnimada.ts" /> | ||
|
||
|
||
class PaleteandoConParametros extends EscenaActividad { | ||
cuadricula; | ||
// pelotas; | ||
cantidadFilas; | ||
cantidadColumnas; | ||
|
||
iniciar() { | ||
//this.pelotas = []; | ||
this.cantidadFilas = 5; | ||
this.cantidadColumnas = 5; | ||
|
||
/* | ||
let matriz = [ | ||
['T','T','T','T','T','T','T'], | ||
['T','F','F','F','F','F','T'], | ||
['T','F','F','F','F','F','T'], | ||
['T','F','F','F','F','F','T'], | ||
['T','F','F','F','F','F','T'], | ||
['T','F','F','F','F','F','T'], | ||
['T','T','T','T','T','T','T'] | ||
]; | ||
*/ | ||
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.ladoCasilla = 30; | ||
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.escala *= 0.3; | ||
// this.pelotas.push(pelota); | ||
} | ||
|
||
estaResueltoElProblema() { | ||
/* | ||
return this.pelotas.every((pelota) => { | ||
return (pelota.nombreAnimacionActual() === 'prendida'); | ||
}); | ||
*/ | ||
const escena = pilas.escena_actual() | ||
|
||
return escena.noHay("PingPong"); | ||
|
||
} | ||
|
||
} |