From 9a32cc8d4849c127160186a3b91db1d18bbe3fc4 Mon Sep 17 00:00:00 2001 From: Daniel Ferro Date: Mon, 2 Oct 2023 10:21:28 -0300 Subject: [PATCH] CountManic first Challenge --- src/assets/casillafin.manic.png | Bin 0 -> 1667 bytes src/assets/casillainicio.manic.png | Bin 0 -> 1866 bytes src/escenas/ContandoPlanetasYEstrellas.ts | 52 ++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 src/assets/casillafin.manic.png create mode 100644 src/assets/casillainicio.manic.png create mode 100644 src/escenas/ContandoPlanetasYEstrellas.ts diff --git a/src/assets/casillafin.manic.png b/src/assets/casillafin.manic.png new file mode 100644 index 0000000000000000000000000000000000000000..7e4456d448d048c8db106a17a20924b43b09addc GIT binary patch literal 1667 zcmeAS@N?(olHy`uVBq!ia0vp^e?XXn4M+yBKAFzIz}S-M>>S|f?5t2wl%JNFlghxL zF|l@{t;b;piMIR8x`Lu)-Y7hpu+S<}VCth4p&CxD0oq$$B^14sH_7w}ijiTx-qdX0 z9m+1A9xEHe>iB{E$kn5s7hS#n=xJ{0_}KSY?%wZv(|5mTSQwc)>#8wh#;)A7AWy^T z@uI)u1e+Q-&bFM4R+ica9H#_0Dbn^ZK8R;MN2~1qGq=Mu)d_ns*4#-gdBZ zzQw6io4jiLZ1OI#cFONuSMlfA&L^7=7%xsUGxnEJ74wc=Q(~w+Tk4}pq0iNlQ{qK( ztLJRD$i8ZoeSh+PgP059({}o0vuNrhaSFL;tXSNnm2)KXy646T3qLREufOrt`$^D= zP)6nBOj#EccGrEd|8X~ZwT0jM`iE6(1e&6>%1ROv&V+x;o*Z265BW?kR@&C*Z4 zLFcPhEwhXaQ?lx*xbKza_2u{ftFXwLpM@=Jix!j|Oi?gFHN;HUHMdLYGF z;1OBOz`!jG!i)^F=12eq*-JcqUD=;=G4Tp=vVM#V2MS4+xJHyX=jZ08=9Mrw7o{ea zq^2m8XO?6rxO@5rgg5euGcd43d%8G=RNQ)dH!$dy1HcJK_fG9^6(rFP;~#eshQaf`1Rz zADuV(_Hwz}>SzDgwyaS5@pkTa>BX^=QrrKE9eVC|_V(7N|Bf$Rw(jhw;ChAcJ5R(v z-gx>#v;Eg^hvufPlAOoMa{ejvL(8};E*}b(Grzq&GxVC>$DE~uH+Zb*}FbcLd(1A z*w!uau@)K%6$d5(!w}Ue`?put&C3kc%Q<%>$;<8c^s?PwtZyEg8NsnH>FKnCAAnl+ z`Td^v+gh0WVECJl5+8q^a!jnf^Zvoc236aHHk4=qdjdVK;64LI;EFqE1P)ZbZN0s1 z<$ETzruO|WiVZK7PU=;)y^=YvE?ll|)r<1tm6|U$%&E7svgK((TyX|M*hc7p8JImug_nYna`%;?%KWv+m`uFMu{x;7K zKsTZVC2}%?I}I2n_XMz{Gn^iJ4vvVI8@9Hs&hoAF@SOClG=l%Yce8h^`2+L*>~fvd z{BZRLzIqQ!xBn}nXHU75nEm;u{p%UqiXNMpmxbmv&wTj%j7jg~FL!}4=e_C8j{kNi z!#7uNO>_R~c+GR3^}FMLWhU9gRa!mOocjEOyxr?Hes=d~1t#n{$Si;Ob`hGFU}*?z zu3$XajGBKQD4*eB{9^3C$?E4H&67qafvI?RtvU1Wo3Zk8RT}0sXO&JKoFum_G1Zg5 zG;7k9{$7EhfL}kWF*Nrg1v|(m#QNsJ{67pAUR-Vs-m>f>uq_p A1^@s6 literal 0 HcmV?d00001 diff --git a/src/assets/casillainicio.manic.png b/src/assets/casillainicio.manic.png new file mode 100644 index 0000000000000000000000000000000000000000..75f3d76f9d2a424ff46fa8ebc11d5955c50a6500 GIT binary patch literal 1866 zcma)6do&Yz9N!k^aY|89VT&GUN0vl+j7F?75_jA@x5S8rWn@gdNs(7lU1p9)k)dm3 z*TjaDlv16w^}w2xX>5|bhPzI;$L(~^?RU=i_dVzH$M<|ckKgaC2ij$+`dW1W0I(G0 z>g1{D@=v9zqPPz-?uG&Yz*Bf6(gTG=LXX7|j^K}m0073hNx62e9S*vu2d<`j{;ns1 zigHSJ`7X~FReBr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OiDQ^|IgcUSq zvkyu2n|Bl`r~THCaKVwSToEcN+u*;Oy_Q7*p`V z@mBFuOg&q}z&BnGqbm@y#hi`e_>SD{x#A+4Ei;uW}}4XB1( +/// +/// +/// +/// +/// +/// + + + + +class ContandoPlanetasYEstrellas extends EscenaActividad { + fondo; + cuadricula : CuadriculaMultipleColumnas; + tableros; + + iniciar() { + this.fondo = new Fondo('fondo.manic.png',0,0); + this.cuadricula = new CuadriculaMultipleColumnas( + new DefinidorColumnasRandom(5, 6), + 0, -45, + { separacionEntreCasillas: 5 }, + { alto: 40, ancho: 40, grilla: 'casillas.manic.png', cantColumnas: 1 }) + this.cuadricula.cambiarImagenInicio('casillainicio.manic.png'); + this.cambiarImagenesFin(); + + this.cuadricula.completarConObjetosRandom(new ConjuntoClases([Planeta, Estrella]), + {condiciones:[ + (casilla) => casilla.hayArriba(), //no incluye en primera fila + (casilla) => casilla.hayAbajo() //no incluye en ultima fila + ]} + ); + + this.automata = new Manic(); + this.cuadricula.agregarActorEnPerspectiva(this.automata, 0, 0); + this.automata.escala *= 1.5; + + this.tableros = {}; + this.tableros.Planeta = new Tablero(150,210,{texto:"Planetas"}); + this.tableros.Estrella = new Tablero(-150,210,{texto:"Estrellas"}); + } + + cambiarImagenesFin(){ + this.cuadricula.cambiarImagenFin('casillafin.manic.png'); + } + + estaResueltoElProblema(){ + return this.cantidadObjetosConEtiqueta('Planeta') === this.tableros.Planeta.dameValor() && + this.cantidadObjetosConEtiqueta('Estrella') === this.tableros.Estrella.dameValor(); + } + +}