User prompt
después de terminar el día 7 ahora dice "JUGAR DÍA 8" si presionamos el botón "JUGAR DÍA 8" comienza el dia 8 y se muestra en pantalla el siguiente texto (no es un dialogo): Las explosiones sacudieron el quinto mundo como un corazón desbocado. Una tras otra, las paredes temblaron hasta resquebrajarse, y el eco de la última detonación hizo vibrar incluso el aire en tus pulmones. Los lapislázuli se apagaron con un resplandor sordo, y en su lugar brilló el fragmento de sol que Stiri había profetizado. Lo tomaste en tus manos. El calor recorrió tu cuerpo, y la familiar sensación de ser arrancado del mundo comenzó a apoderarse de ti . El resplandor debía conducirte de regreso al segundo mundo... pero algo salió mal. En un parpadeo, el rugido de las ruinas fue sustituido por un silencio absoluto. La tierra desapareció bajo tus pies. No había montañas, ni cavernas, ni cielos oscuros. Solo vacío. Un espacio gris, infinito, que no parecía pertenecer a ninguno de los seis mundos. Y allí, en medio de esa nada inmóvil, lo viste. Una silueta conocida, Strazca, el guardián de las almas en pena, estaba de pie frente a ti. Sus ojos vacíos brillaban con una intensidad gélida, y aunque no movía los labios, sabías que estaba a punto de hablar. Una vez más, tu viaje había sido desviado... y no por casualidad. abajo de este texto hay un botón llamado "presiona AQUÍ para continuar" al presionar ese botón se deja de mostrar el texto y poco a poco se comienza a mostrar el asset: "Strazca" y dice los siguientes diálogos: Strazca Has vuelto a mí... aunque no era aquí donde debías estar. El flujo de los mundos te ha traído porque lo que hiciste no puede quedar sin respuesta. Strazca El lugar que custodiaba... mi morada, el refugio de las almas en pena... era el quinto mundo. Allí las encadenaba, las contenía, para que su dolor no se derramara sobre los demás. Ese mundo ya no existe. Lo hiciste añicos con tus explosivos. Strazca —Y ahora, sin un mundo que las retenga... esas almas vagan libres. Se han dispersado como plaga por los demás mundos. No comprendes lo que has desatado... eran almas en pena, presas de tormento eterno. Allí donde caminen, sembrarán caos y desgracia. Strazca Me fallaste. No solo perdiste un mundo: desataste la condena de los demás. Y por ese daño, hay un precio que debes pagar. Strazca Devuélveme el pedazo de sol que te entregué. No eres digno de cargarlo, no después de lo que has hecho. abajo de este ultimo dialogo aparece un botón llamado "Dar pedazo de sol" y si lo presionamos el asset "Strazca" se oscurece poco a poco hasta desaparecer y ahora se muestra poco a poco el asset "Kid" y dice los siguientes diálogos: Kid ¡Basta ya! Nadie... absolutamente nadie nos va a decir qué hacer. Kid ¿Que devolvamos el pedazo de sol? ¡Ja! No, viejo fantasma. Ese fragmento ya no es tuyo, es nuestro. Lo conseguimos, lo cargamos, lo protegemos. Y si tú crees que puedes quitárnoslo... pues será mejor que lo intentes. Kid Mi nuevo amigo y yo no vinimos hasta aquí para obedecer órdenes. Vinimos para traer de vuelta el sol. Y si alguien se interpone, aunque seas tú, guardián de almas en pena... le daremos una lección que nunca olvidará. Kid Prepárate, Strazca... porque nadie puede detenernos. Nadie. después de esto se oscurece el asset "Kid" y ahora se muestra en pantalla completa y centrado el asset "kidstrazca" y se muestra durante 7 segundos y se muestra el siguiente dialogo: kidstrazca: (Kid) Lo siento Strazca, pero nadie se interpondrá en nuestro camino... kidstrazca: (Strazca) Por favor... si tu... ayúdame, quítame al niño de encima... que abajo del ultimo dialogo haya un botón llamado "ayudar a Strazca" y si lo presionamos se deja de mostrar el asset "kidstrazca" y poco a poco se comienza a mostrar el asset "strazcaderrota" y este dice el siguiente dialogo strazcaderrota: gracias por ayudarme muchacho, te lo recompensare... despues de este dialogo se oscurece y poco a poco se muestra el asset "Kid" y dice los siguientes diálogos Kid: ¡Eres un idiota! ¡Un completo idiota! ¿Cómo se te ocurre ponerte del lado de ese saco de huesos cuando estábamos a punto de acabarlo? ¡Traicionaste nuestra unión, amigo! Kid: Supongo que ya lo notaste... ¿verdad? Que mientras “jugábamos”, hubo días que se borraron como si nunca hubieran existido. Días que no recuerdas. Kid: La verdad es que estabas sedado. Sí... el Propofol en tu sistema mantenía tu mente atrapada, lejos de todo. Kid: No... no debía decir eso. Maldición. Tengo que tener más cuidado. Si la Vigía del Umbral escucha algo de esto... podría eliminarme al instante. Kid: Lo importante es que... durante esos días que no estabas del todo lúcido, yo sí lo estaba. Y mientras tú vagabas en tu propia niebla, yo conseguí lo que faltaba. Sí, conseguí uno de los pedazos de sol por mi cuenta. después de este dialogo se deja de mostrar el asset "Kid" y se comienza a mostrar el asset "pedazo" el cual dice los siguientes diálogos: pedazo: Ahora tenemos el de Pinkcraiyon... el de Rugbert... el de Strazca... y el que conseguí solo. despues de este dialogo se deja de mostrar el asset "pedazo" y se muestra el asset "kid" el cual dice el siguiente dialogo: kid: Eso significa que solo falta uno. El último fragmento... no te lo dije pero... el último fragmento es el que late dentro de ti. Esta en tu corazón. Kid: Lo quieras o no... tendrás que morir. Todo sea por devolver la luz a los mundos. ahora después de este dialogo se deja de mostrar el asset "Kid" y se muestra poco a poco el asset "formafinal" el cual dice el siguiente dialogo: formafinal: por cierto, esta es mi verdadera forma... quería que la conocieras antes de morir... después de esto el asset "formafinal" se oscurece y se muestra poco a poco al asset "strazcaderrota" el cual dice el siguiente dialogo: strazcaderrota: ¡Detente, criatura! No permitiré que reclames la vida de este muchacho... no mientras yo aún exista. strazcaderrota —Tú no morirás aquí. No bajo las garras de quien te usa como peón. Hay fuerzas que vigilan... y aunque pronunciar su nombre es un riesgo, es el único modo de protegerte. se deja de mostrar el asset "strazcaderrota" y se comienza a mostrar el asset "formafinal" y dice los siguientes diálogos: formafinal: ¡Basta! ¡Por favor, basta ya! formafinal: Te lo daré... lo que quieras, lo que sea... ¡pero no sigas hablando! No invoques a la Vigía... se deja de mostrar el asset "formafinal" y se comienza a mostrar el asset "strazcaderrota" y dice los siguientes diálogos: strazcaderrota Escucha mis palabras, oh guardiana del límite entre mundos... Vigía del Umbral. Yo, Strazca, guardián de las almas en pena, te llamo. Atiende mi voz. se deja de mostrar el asset "strazcaderrota" y se comienza a mostrar el asset "formafinal" y dice los siguientes diálogos: formafinal: ¿Quieres el fragmento de sol que encontré? ¡Tómalo! ¿Quieres todos los fragmentos? ¡Son tuyos! ¿Quieres la existencia del muchacho? ¡La entregaré! Pero... pero detente, te lo suplico. se deja de mostrar el asset "formafinal" y se comienza a mostrar el asset "strazcaderrota" y dice los siguientes diálogos: strazcaderrota Mira lo que esta criatura de oscuridad ha hecho. Escucha lo que sus labios han revelado. Se atrevió a quebrantar tus secretos, a profanar tu silencio. Te invoco, Vigía del Umbral... ven y pon orden donde él ha sembrado traición. strazcaderrota Resiste. Muchacho. El destino no quiere que seas un sacrificio... sino el portador de la verdadera luz. se deja de mostrar el asset "strazcaderrota" y se comienza a mostrar el asset "formafinal" y dice los siguientes diálogos: formafinal: oh... ¡Solo deja de pronunciar su nombre! ¡Solo calla! Dios... Por favor no... Clemencia, ¡lo suplico!.. después de ese dialogo el asset "formafinal" se deja de mostrar porque el poco a poco aparece en pantalla completa el asset "blanco" el cual lo tapa, después de 10 segundos se deja de mostrar poco a poco el asset "blanco" y debajo del mismo esta el asset "Lavigia" este mismo asset (Lavigia) ahora se muestra en pantalla completa y dice los siguientes diálogos: Lavigia Hola... soy la Vigía del Umbral Lavigia Probablemente ya escuchaste mi nombre en susurros... y ahora, al fin, me ves. Te preguntas qué es este lugar, ¿verdad? Esa realidad extraña, partida en seis mundos con criaturas aún más extrañas. Pues bien... este sitio no es un mundo verdadero. Es un limbo. Lavigia Fue creado como un simple juzgatorio para las personas que están por morir, un pasillo entre la vida y lo que viene después. Pero ocurrió un error. Al formarse, las criaturas que lo habitan... desarrollaron sentimientos. Y eso jamás debió suceder. Lavigia Yo tengo un deber: vigilar. Vigilar en silencio para que ninguna de esas criaturas te diga la verdad. La verdad de por qué entraste aquí: lo hiciste porque estabas a punto de morir. Quienes traicionan ese secreto, tanto las criaturas como las personas que escuchan, son eliminadas. Esa es mi tarea. Lavigia Normalmente, quienes llegan aquí aparecen en uno de los seis mundos. Si es en los primeros cinco, son acompañados por una criatura, cumplen tareas... y entonces yo decido, (el sexto mundo es el mío, si aparecen aquí todo se hace mas fácil) desde las sombras, su destino: el cielo, alguno de los nueve círculos del infierno, o convertirse en un alma en pena, para ser resguardada en el quinto mundo por Strazca, uno de los guardianes más importantes de esta dimensión. Lavigia Pero destruiste el quinto mundo. Las almas en pena escaparon, y yo tuve que... improvisar. Pensar en otra solución. Lavigia Escúchame bien. Muchas veces, cuando alguien muere... es por las manos de otra persona. Por eso, desde ahora, quienes no sean dignos ni del cielo ni del infierno, y hayan sido asesinados, tendrán dos caminos: Lavigia Primera opción: tomar venganza. Hacer pagar a quien les quitó la vida. Pero si eligen ese sendero, deberán quedarse aquí... como mis ayudantes, ejecutando las labores que les ordene, hasta que encuentre un reemplazo. Solo entonces podrán descansar en paz. Lavigia Segunda opción: rechazar la venganza. Dejar libre a su atacante... y entonces podrán volver a la vida. Una segunda oportunidad. Pero sin recuerdos de esta dimensión, como si jamás hubiese existido. Lavigia Tú serás el primero en decidir. La razón de tu casi muerte es clara: en el mundo humano, alguien te atacó con un machete. se oscurece el asset "Lavigia" y se muestra el asset "Harlom" y dice el siguiente dialogo: Su nombre es Harlom, tiene 24 años, y se le acusa de 56 asesinatos hasta ahora. Un hechicero vudú... que sacrifica vidas para su dios. cuando termina ese dialogo se oscurece el asset "Harlom" y se muestra poco a poco en pantalla completa y centrado el asset "Lavigia" el cual dice los siguientes diálogos: Lavigia Tu destino, allí, pende de un hilo. Los doctores luchan por ti en un hospital, tu familia sufre, y tu índice de mortalidad es alto. Ellos no saben si despertarás. Lavigia Tu asesino también acabó con la vida de tu hermana de seis años. Y ahora yo te ofrezco elegir: Lavigia Si eliges venganza, harás pagar a Harlom. Pero deberás quedarte aquí, sirviendo como mi ayudante, hasta que encuentre tu reemplazo. Solo entonces morirás en paz. Lavigia Si eliges la segunda oportunidad, dejarás libre al asesino. Él podrá continuar su matanza... pero tú sobrevivirás. Y aunque olvidarás todo lo que viste en esta dimensión, recordarás quién es tu atacante: Harlom, 24 años, hechicero vudú. Sabrás su nombre, sabrás lo que es... pero nada más. Lo que cuando despiertes desees hacer con esa información es tu problema. Lavigia Elige. Tu camino no lo decido yo... sino tú. Lavigia Y... al final... que es lo que decidiste? luego de este ultimo dialogo se oscurece el asset "Lavigia" y se muestra el asset "TITULO" el cual se ve pequeño en el centro de la pantalla pero se va agrandando hasta que se ve de tamaño normal en toda la pantalla y después de 5 segundos de oscurece. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
DESPUES DE TERMINAR EL DIA 7 QUE CUANDO VOLVAMOS MENU EL BOTON DIGA "JUGAR DIA 8" Y AL PRECIONARLO COMIENZE EL DIA OCHO
User prompt
después de terminar el día 7 ahora dice "JUGAR DÍA 8" después de presionar el botón "JUGAR DÍA 8" se muestra en pantalla el siguiente texto (no es un dialogo): Las explosiones sacudieron el quinto mundo como un corazón desbocado. Una tras otra, las paredes temblaron hasta resquebrajarse, y el eco de la última detonación hizo vibrar incluso el aire en tus pulmones. Los lapislázuli se apagaron con un resplandor sordo, y en su lugar brilló el fragmento de sol que Stiri había profetizado. Lo tomaste en tus manos. El calor recorrió tu cuerpo, y la familiar sensación de ser arrancado del mundo comenzó a apoderarse de ti . El resplandor debía conducirte de regreso al segundo mundo... pero algo salió mal. En un parpadeo, el rugido de las ruinas fue sustituido por un silencio absoluto. La tierra desapareció bajo tus pies. No había montañas, ni cavernas, ni cielos oscuros. Solo vacío. Un espacio gris, infinito, que no parecía pertenecer a ninguno de los seis mundos. Y allí, en medio de esa nada inmóvil, lo viste. Una silueta conocida, Strazca, el guardián de las almas en pena, estaba de pie frente a ti. Sus ojos vacíos brillaban con una intensidad gélida, y aunque no movía los labios, sabías que estaba a punto de hablar. Una vez más, tu viaje había sido desviado... y no por casualidad. abajo de este texto hay un botón llamado "presiona AQUÍ para continuar" al presionar ese botón se deja de mostrar el texto y poco a poco se comienza a mostrar el asset: "Strazca" y dice los siguientes diálogos: Strazca Has vuelto a mí... aunque no era aquí donde debías estar. El flujo de los mundos te ha traído porque lo que hiciste no puede quedar sin respuesta. Strazca El lugar que custodiaba... mi morada, el refugio de las almas en pena... era el quinto mundo. Allí las encadenaba, las contenía, para que su dolor no se derramara sobre los demás. Ese mundo ya no existe. Lo hiciste añicos con tus explosivos. Strazca —Y ahora, sin un mundo que las retenga... esas almas vagan libres. Se han dispersado como plaga por los demás mundos. No comprendes lo que has desatado... eran almas en pena, presas de tormento eterno. Allí donde caminen, sembrarán caos y desgracia. Strazca Me fallaste. No solo perdiste un mundo: desataste la condena de los demás. Y por ese daño, hay un precio que debes pagar. Strazca Devuélveme el pedazo de sol que te entregué. No eres digno de cargarlo, no después de lo que has hecho. abajo de este ultimo dialogo aparece un botón llamado "Dar pedazo de sol" y si lo presionamos el asset "Strazca" se oscurece poco a poco hasta desaparecer y ahora se muestra poco a poco el asset "Kid" y dice los siguientes diálogos: Kid ¡Basta ya! Nadie... absolutamente nadie nos va a decir qué hacer. Kid ¿Que devolvamos el pedazo de sol? ¡Ja! No, viejo fantasma. Ese fragmento ya no es tuyo, es nuestro. Lo conseguimos, lo cargamos, lo protegemos. Y si tú crees que puedes quitárnoslo... pues será mejor que lo intentes. Kid Mi nuevo amigo y yo no vinimos hasta aquí para obedecer órdenes. Vinimos para traer de vuelta el sol. Y si alguien se interpone, aunque seas tú, guardián de almas en pena... le daremos una lección que nunca olvidará. Kid Prepárate, Strazca... porque nadie puede detenernos. Nadie. después de esto se oscurece el asset "Kid" y ahora se muestra en pantalla completa y centrado el asset "kidstrazca" y se muestra durante 7 segundos y se muestra el siguiente dialogo: kidstrazca: (Kid) Lo siento Strazca, pero nadie se interpondrá en nuestro camino... kidstrazca: (Strazca) Por favor... si tu... ayúdame, quítame al niño de encima... que abajo del ultimo dialogo haya un botón llamado "ayudar a Strazca" y si lo presionamos se deja de mostrar el asset "kidstrazca" y poco a poco se comienza a mostrar el asset "strazcaderrota" y este dice el siguiente dialogo strazcaderrota: gracias por ayudarme muchacho, te lo recompensare... despues de este dialogo se oscurece y poco a poco se muestra el asset "Kid" y dice los siguientes diálogos Kid: ¡Eres un idiota! ¡Un completo idiota! ¿Cómo se te ocurre ponerte del lado de ese saco de huesos cuando estábamos a punto de acabarlo? ¡Traicionaste nuestra unión, amigo! Kid: Supongo que ya lo notaste... ¿verdad? Que mientras “jugábamos”, hubo días que se borraron como si nunca hubieran existido. Días que no recuerdas. Kid: La verdad es que estabas sedado. Sí... el Propofol en tu sistema mantenía tu mente atrapada, lejos de todo. Kid: No... no debía decir eso. Maldición. Tengo que tener más cuidado. Si la Vigía del Umbral escucha algo de esto... podría eliminarme al instante. Kid: Lo importante es que... durante esos días que no estabas del todo lúcido, yo sí lo estaba. Y mientras tú vagabas en tu propia niebla, yo conseguí lo que faltaba. Sí, conseguí uno de los pedazos de sol por mi cuenta. después de este dialogo se deja de mostrar el asset "Kid" y se comienza a mostrar el asset "pedazo" el cual dice los siguientes diálogos: pedazo: Ahora tenemos el de Pinkcraiyon... el de Rugbert... el de Strazca... y el que conseguí solo. despues de este dialogo se deja de mostrar el asset "pedazo" y se muestra el asset "kid" el cual dice el siguiente dialogo: kid: Eso significa que solo falta uno. El último fragmento... no te lo dije pero... el último fragmento es el que late dentro de ti. Esta en tu corazón. Kid: Lo quieras o no... tendrás que morir. Todo sea por devolver la luz a los mundos. ahora después de este dialogo se deja de mostrar el asset "Kid" y se muestra poco a poco el asset "formafinal" el cual dice el siguiente dialogo: formafinal: por cierto, esta es mi verdadera forma... quería que la conocieras antes de morir... después de esto el asset "formafinal" se oscurece y se muestra poco a poco al asset "strazcaderrota" el cual dice el siguiente dialogo: strazcaderrota: ¡Detente, criatura! No permitiré que reclames la vida de este muchacho... no mientras yo aún exista. strazcaderrota —Tú no morirás aquí. No bajo las garras de quien te usa como peón. Hay fuerzas que vigilan... y aunque pronunciar su nombre es un riesgo, es el único modo de protegerte. se deja de mostrar el asset "strazcaderrota" y se comienza a mostrar el asset "formafinal" y dice los siguientes diálogos: formafinal: ¡Basta! ¡Por favor, basta ya! formafinal: Te lo daré... lo que quieras, lo que sea... ¡pero no sigas hablando! No invoques a la Vigía... se deja de mostrar el asset "formafinal" y se comienza a mostrar el asset "strazcaderrota" y dice los siguientes diálogos: strazcaderrota Escucha mis palabras, oh guardiana del límite entre mundos... Vigía del Umbral. Yo, Strazca, guardián de las almas en pena, te llamo. Atiende mi voz. se deja de mostrar el asset "strazcaderrota" y se comienza a mostrar el asset "formafinal" y dice los siguientes diálogos: formafinal: ¿Quieres el fragmento de sol que encontré? ¡Tómalo! ¿Quieres todos los fragmentos? ¡Son tuyos! ¿Quieres la existencia del muchacho? ¡La entregaré! Pero... pero detente, te lo suplico. se deja de mostrar el asset "formafinal" y se comienza a mostrar el asset "strazcaderrota" y dice los siguientes diálogos: strazcaderrota Mira lo que esta criatura de oscuridad ha hecho. Escucha lo que sus labios han revelado. Se atrevió a quebrantar tus secretos, a profanar tu silencio. Te invoco, Vigía del Umbral... ven y pon orden donde él ha sembrado traición. strazcaderrota Resiste. Muchacho. El destino no quiere que seas un sacrificio... sino el portador de la verdadera luz. se deja de mostrar el asset "strazcaderrota" y se comienza a mostrar el asset "formafinal" y dice los siguientes diálogos: formafinal: oh... ¡Solo deja de pronunciar su nombre! ¡Solo calla! Dios... Por favor no... Clemencia, ¡lo suplico!.. después de ese dialogo el asset "formafinal" se deja de mostrar porque el poco a poco aparece en pantalla completa el asset "blanco" el cual lo tapa, después de 10 segundos se deja de mostrar poco a poco el asset "blanco" y debajo del mismo esta el asset "Lavigia" este mismo asset (Lavigia) ahora se muestra en pantalla completa y dice los siguientes diálogos: Lavigia Hola... soy la Vigía del Umbral Lavigia Probablemente ya escuchaste mi nombre en susurros... y ahora, al fin, me ves. Te preguntas qué es este lugar, ¿verdad? Esa realidad extraña, partida en seis mundos con criaturas aún más extrañas. Pues bien... este sitio no es un mundo verdadero. Es un limbo. Lavigia Fue creado como un simple juzgatorio para las personas que están por morir, un pasillo entre la vida y lo que viene después. Pero ocurrió un error. Al formarse, las criaturas que lo habitan... desarrollaron sentimientos. Y eso jamás debió suceder. Lavigia Yo tengo un deber: vigilar. Vigilar en silencio para que ninguna de esas criaturas te diga la verdad. La verdad de por qué entraste aquí: lo hiciste porque estabas a punto de morir. Quienes traicionan ese secreto, tanto las criaturas como las personas que escuchan, son eliminadas. Esa es mi tarea. Lavigia Normalmente, quienes llegan aquí aparecen en uno de los seis mundos. Si es en los primeros cinco, son acompañados por una criatura, cumplen tareas... y entonces yo decido, (el sexto mundo es el mío, si aparecen aquí todo se hace mas fácil) desde las sombras, su destino: el cielo, alguno de los nueve círculos del infierno, o convertirse en un alma en pena, para ser resguardada en el quinto mundo por Strazca, uno de los guardianes más importantes de esta dimensión. Lavigia Pero destruiste el quinto mundo. Las almas en pena escaparon, y yo tuve que... improvisar. Pensar en otra solución. Lavigia Escúchame bien. Muchas veces, cuando alguien muere... es por las manos de otra persona. Por eso, desde ahora, quienes no sean dignos ni del cielo ni del infierno, y hayan sido asesinados, tendrán dos caminos: Lavigia Primera opción: tomar venganza. Hacer pagar a quien les quitó la vida. Pero si eligen ese sendero, deberán quedarse aquí... como mis ayudantes, ejecutando las labores que les ordene, hasta que encuentre un reemplazo. Solo entonces podrán descansar en paz. Lavigia Segunda opción: rechazar la venganza. Dejar libre a su atacante... y entonces podrán volver a la vida. Una segunda oportunidad. Pero sin recuerdos de esta dimensión, como si jamás hubiese existido. Lavigia Tú serás el primero en decidir. La razón de tu casi muerte es clara: en el mundo humano, alguien te atacó con un machete. se oscurece el asset "Lavigia" y se muestra el asset "Harlom" y dice el siguiente dialogo: Su nombre es Harlom, tiene 24 años, y se le acusa de 56 asesinatos hasta ahora. Un hechicero vudú... que sacrifica vidas para su dios. cuando termina ese dialogo se oscurece el asset "Harlom" y se muestra poco a poco en pantalla completa y centrado el asset "Lavigia" el cual dice los siguientes diálogos: Lavigia Tu destino, allí, pende de un hilo. Los doctores luchan por ti en un hospital, tu familia sufre, y tu índice de mortalidad es alto. Ellos no saben si despertarás. Lavigia Tu asesino también acabó con la vida de tu hermana de seis años. Y ahora yo te ofrezco elegir: Lavigia Si eliges venganza, harás pagar a Harlom. Pero deberás quedarte aquí, sirviendo como mi ayudante, hasta que encuentre tu reemplazo. Solo entonces morirás en paz. Lavigia Si eliges la segunda oportunidad, dejarás libre al asesino. Él podrá continuar su matanza... pero tú sobrevivirás. Y aunque olvidarás todo lo que viste en esta dimensión, recordarás quién es tu atacante: Harlom, 24 años, hechicero vudú. Sabrás su nombre, sabrás lo que es... pero nada más. Lo que cuando despiertes desees hacer con esa información es tu problema. Lavigia Elige. Tu camino no lo decido yo... sino tú. Lavigia Y... al final... que es lo que decidiste? luego de este ultimo dialogo se oscurece el asset "Lavigia" y se muestra el asset "TITULO" el cual se ve pequeño en el centro de la pantalla pero se va agrandando hasta que se ve de tamaño normal en toda la pantalla y después de 5 segundos de oscurece. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
después de 5 segundos el fondo "blando" (que esta en pantalla completa) pase poco a poco a color negro, ahora se muestra el asset "pedazo" y dice el siguiente dialogo (el cual para pasar al siguiente tenemos que hacer click en cualquier lugar de la pantalla): pedazo: (cuarta cabeza) Aquí esta tu recompensa. después de este dialogo el asset "pedazo" se oscurece y desvanece poco a poco, ahora se deja de mostrar y ahora se muestra el menu principal ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
al final del dia 7 en vez de mostrarse el asset "floor" que en su lugar se muestre poco a poco el asset "blando" en pantalla completa ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
elimina el boton "presiona AQUI para EXPLOTAR este lugar, que directamente cuando terminemos de colocar los 10 "tnt" en "cincopared" que se deje de mostrar todos los assets y que ahora se muestre un fondo blanco después de 5 segundos el fondo blanco (que esta en pantalla completa) pase poco a poco a color negro, ahora se muestra el asset "pedazo" y dice el siguiente dialogo (el cual para pasar al siguiente tenemos que hacer click en cualquier lugar de la pantalla): pedazo: (cuarta cabeza) Aquí esta tu recompensa. después de este dialogo el asset "pedazo" se oscurece y desvanece poco a poco, ahora se deja de mostrar y ahora se muestra el menu principal ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
diga dia 7 en lugar de dia 9
User prompt
cuando terminemos de colocar los 10 "tnt" en "cincopared" que se deje de mostrar todos los assets y que ahora se muestre un fondo blanco después de 5 segundos el fondo blanco (que esta en pantalla completa) pase poco a poco a color negro, ahora se muestra el asset "pedazo" y dice el siguiente dialogo (el cual para pasar al siguiente tenemos que hacer click en cualquier lugar de la pantalla): pedazo: (cuarta cabeza) Aquí esta tu recompensa. después de este dialogo el asset "pedazo" se oscurece y desvanece poco a poco, ahora se deja de mostrar y ahora se muestra el menu principal pero ahora dice "JUGAR DÍA 9" (antes decia jugar dia 8) ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
despues de terminar el dia 2 y que volvamos al menu que se muestre que ahora diga "JUGAR DÍA 3" (no jugar dia 4) ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
despues de terminar el dia 3 y regresar al menu, que ahora diga "JUGAR DÍA 4" (no jugar dia 5) ahora, despues de terminar el dia 4 y regresar al menu que ahora diga "JUGAR DÍA 5" (no jugar dia 6) ahora despues de terminar el dia 5 y regresar al menu que ahora diga "JUGAR DÍA 6" (no jugar dia 7) despues de terminar el dia 6 que diga "JUGAR DÍA 7" (no jugar día 8) y has que cuando terminemos de colocar los 10 "tnt" en "cincopared" que todo se funde en color blanco y después de 5 segundos el color blanco (y se deja de mostrar los assets "tnt" y "cincopared") ahora el color blanco que envuelve la pantalla pasa poco a poco a color negro, ahora se muestra el asset "pedazo" y dice el siguiente dialogo (el cual para pasar al siguiente tenemos que hacer click en cualquier lugar de la pantalla) pedazo: (cuarta cabeza) Aquí esta tu recompensa después de este dialogo el asset "pedazo" se oscurece y desvanece poco a poco, ahora se deja de mostrar y ahora se muestra el menu principal pero ahora dice "JUGAR DÍA 8" ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
que en lugar de decir dia 8 diga dia 7
User prompt
cuando aparezca el botón llamado "presiona AQUI para EXPLOTAR este lugar" al presionarlo todo se funde en color blanco y después de 5 segundos el color blanco (y se deja de mostrar los assets "tnt" y "cincopared") ahora el color blanco que envuelve la pantalla pasa poco a poco a color negro, ahora se muestra el asset "pedazo" y dice el siguiente dialogo (el cual para pasar al siguiente tenemos que hacer click en cualquier lugar de la pantalla) pedazo: (cuarta cabeza) Aquí esta tu recompensa después de este dialogo el asset "pedazo" se oscurece y desvanece poco a poco, ahora se deja de mostrar y ahora se muestra el menu principal pero ahora dice "JUGAR DÍA 8" ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
después de terminar el día 3 que el botón cambie a JUGAR DÍA 4 y después de terminar el día 4 en el menú diga JUGAR DIA 5 y después de terminar el día 5 se muestre en el menú JUGAR DIA 6 después de presionar el botón "JUGAR DÍA 6" se muestra en pantalla el siguiente texto (no es un dialogo): El aire era pesado, cargado de un olor metálico, como hierro viejo y ceniza húmeda. El suelo crujía bajo tus pasos, cubierto de fragmentos de piedra brillante que reflejaban una luz que no venía de ningún sol. Habías llegado al cuarto mundo. Un lugar extraño, vasto, con montañas que parecían torres partidas y un cielo tan oscuro que no podías distinguir si realmente existía algo sobre tu cabeza. Avanzaste apenas unos pasos y lo sentiste: no estabas solo. Una sombra inmensa se movía en la distancia, arrastrando consigo un rugido de respiraciones profundas. Y entonces, lo viste. De entre la bruma emergió una criatura con cuatro cabezas que iban en distintas direcciones, como si cada una tuviera una voluntad propia. Ojos múltiples se clavaron en ti, observándote desde ángulos imposibles. Sus fauces se abrían al unísono, pero no emitían sonido alguno... solo un silencio denso, lleno de amenaza. Aquella criatura no parecía un enemigo inmediato ni un aliado claro. Era un guardián de este mundo, un ser nacido de la oscuridad misma. Y sus cuatro cabezas parecían discutir en silencio, decidiendo qué hacer contigo. El cuarto mundo había comenzado a revelarse, y ya sabías que nada sería sencillo aquí. abajo del texto hay un botón que se llama "presiona AQUI para continuar" si lo presionamos se deja de mostrar el texto y poco a poco se muestra el asset "Stiri" y dice los siguientes diálogos (los cuales para pasar al siguiente dialogo tenemos que hacer click en cualquier lugar de la pantalla): Stiri: (Cabeza izquierda) Mírenlo, mírenlo bien... ¡qué tierno se ve este muchachito! ¿No creen que podríamos... *devorarlo*? Ja, ja... sería un bocado exquisito, y además acabaríamos rápido con cualquier problema. ¡Qué lástima desperdiciar tanta carne fresca! Stiri: (Cabeza derecha) ¡No, no, no! ¡Estás loca! No deberíamos ni acercarnos. Ese chico... no sé, hay algo en él... algo que me asusta. ¿Y si puede hacernos daño? ¿Y si no es lo que aparenta? Mejor alejémonos, ¡mucho mejor! Stiri: (Cabeza izquierda) Ay, por favor... siempre tan miedosa. ¿Y si nos hiere? ¿Y si nos mira feo? ¡Bah! Me exasperas con tus temores... Stiri: (Cabeza del centro) Silencio, los dos. Basta de disputas. Stiri: (Cabeza del centro) Yo sé quién es este muchacho. Yo sé por qué está aquí. Stiri: (Cabeza del centro) No ha venido por casualidad, ni por error. Stiri: (Cabeza del centro) Ha venido buscando algo que poseemos. Stiri: (Cabeza del centro) Quieres el pedazo de sol, ¿verdad? Sí... lo sentimos en ti, lo vemos ardiendo en tu interior. Pero no podemos decidirlo solos. Stiri: (Cabeza del centro) Debemos consultar a la cuarta cabeza. Solo ella puede dar la respuesta. después de estos diálogos el asset de Stiri se oscurece y se muestra el siguiente texto texto en pantalla (no es un dialogo): La criatura se estremeció, y desde la sombra trasera emergió lentamente la cuarta cabeza. Su aspecto era más marchito, más antiguo, como si llevara siglos dormida en silencio. Cuando abrió la boca, su voz no era un simple sonido, sino un eco profundo que resonaba en tu mente, helándote hasta los huesos. abajo de ese texto hay un botón llamado "presiona AQUI para dialogar con la cabeza trasera" y si presionamos el botón se deja de mostrar el texto y ahora se muestra en PANTALLA COMPLETA y de manera centrada el asset "cabeza" y dice los siguientes diálogos (los cuales para pasar al siguiente dialogo tenemos que hacer click en cualquier lugar de la pantalla): cabeza El fragmento de sol... no se da, no se entrega tan fácilmente. Quien desee portarlo debe mostrar que puede destruir tanto como restaurar. cabeza Escúchame, viajero... si realmente quieres nuestro pedazo de sol, no será aquí donde lo obtengas. Debes viajar al quinto mundo. Allí, en las entrañas de piedra y oscuridad, hallarás muros que susurran y que custodian el secreto. cabeza Antes de nada, recogerás los lapislázuli, gemas tan antiguas como la noche misma. No podremos hacer lo siguiente sin antes haberlas recogido todas, pues si no seria un gran desperdicio de gemas preciosas. cabeza Después... plantarás diez explosivos en las paredes del lugar. Y cuando la última detonación retumbe, las ruinas caerán y el vacío hablará. Solo entonces, el fragmento brillará para ti... y será tuyo. cabeza Ve, portador de la luz naciente. Demuestra que tu voluntad puede arrasar tanto como salvar. Si lo logras... el pedazo de sol será tuyo. después de estos diálogos el asset "cabeza" se oscurece y se deja de mostrar, ahora se muestra en pantalla completa el asset "cincopared" y arriba aparece un contador llamado "LAPISLÁZULIS RESTANTES 10/10" y sobre el asset "cincopared" aparezca un total de 10 assets "lapiz" en lugares aleatorios frente al fondo (cincopared) y que tocamos uno de ellos ese mismo desaparezca y se reste un numero al 10/10 de el contador, cuando llegue a cero (lógicamente cuando también terminemos de tocar a todos los "lapiz" que estén por la pantalla) entonces desaparecerá el contador y ahora aparecerá un texto que dice "COLOCA LOS EXPLOSIVOS" ahora en la parte baja de la pantalla aparecerá un botón llamado "EXPLOSIVOS 10/10" y si lo presionamos en el cursor del mouse aparecerá el asset "tnt" y se moverá junto al cursor del mouse, ahora si presionamos cualquier lado de la pantalla (excepto en el botón "EXPLOSIVOS 10/10") en el lugar que presionemos va a quedar pegado en ese lugar una copia del asset "tnt" y el 10/10 del contador va a bajar primero bajara a 9/10, después de que hagamos el segundo click en la pantalla bajara a 8/10 y así sucesivamente hasta que llegue a 0/10 y cuando eso pase el contador "EXPLOSIVOS 0/10" se desvanecerá y aparecerá un botón llamado "presiona AQUI para EXPLOTAR este lugar" y al presionarlo todo se funde en color blanco y después de 5 segundos el color blanco pasa poco a poco a color negro, ahora se muestra el asset "pedazo" y dice el siguiente dialogo (el cual para pasar al siguiente tenemos que hacer click en cualquier lugar de la pantalla) pedazo: (cuarta cabeza) Aquí esta tu recompensa después de este dialogo el asset "pedazo" se oscurece y desvanece poco a poco, ahora se deja de mostrar y ahora se muestra el menu principal pero ahora dice "JUGAR DÍA 7" ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
después de los diálogos de el asset Pinkdead estos son los dialogos de kid (corregidos): Kid: No escuches esas tonterías, nuevo amigo. Pinkcraiyon solo quería confundirte. Sus últimas palabras no fueron más que delirios de alguien que sabía que había perdido. Kid: ¿Yo, gobernar los seis mundos? ¿Ja, ja, ja! Suena gracioso, ¿no? Esa cosa solo trataba de distraernos, de sembrar miedo en tu corazón para que no recuperaras el pedazo de sol que guardaba con tanta obsesión. Pero fracasó. Porque tú eres más fuerte. Kid: Mírate... ahora cargas con tres pedazos de sol. ¿Lo sientes? Ese calor en tu pecho, esa fuerza que te sostiene... Eso es la esperanza, nuevo amigo. Kid: Solo nos faltan tres fragmentos más. Tres. Y cuando los tengamos todos, el sol volverá a brillar sobre los seis mundos. No habrá más sombras eternas, no habrá más cavernas sin amanecer. Habrá luz... y será gracias a ti. Kid: Eres el salvador que siempre supe que serías. Y yo estaré contigo hasta el final. Kid: El siguiente mundo nos espera, con otro pedazo de sol escondido en su corazón. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Pinkcraiyon: Pequeño... tú otra vez. Je, je, je... ¿por qué has vuelto a mi mundo de sombras? ¿Acaso me extrañabas? ¿O acaso perdiste algo entre mis pasillos? Pinkcraiyon: Mírate... con esos ojos cansados, pero aún firmes. Ven... dime qué buscas. Dímelo al oído... yo quiero escucharlo todo. abajo de este texto hay un botón que se llama "presiona AQUI para explicarle porque hemos venido" y si presionamos ese botón se muestra el siguiente dialogo de pinkcraiyon: Pinkcraiyon: ¿El sol...? ¿Mi sol...? Ohhh, pequeño... ahora entiendo. Pinkcraiyon: Ese fragmento brillante, caliente... lo escondí porque arde, porque me hiere... pero también porque lo deseo. El sol no te pertenece a ti... ni a nadie. Es mío. Mi único tesoro. Pinkcraiyon: ¿De verdad crees que te lo daría? ¿Después de que trajiste luz a mis sombras, después de que me enseñaste lo que quiero olvidar? Pinkcraiyon: No, pequeño. No puedo... no quiero. Ese pedazo de sol no saldrá de mis manos. Pinkcraiyon: Si lo quieres... tendrás que arrancarlo de mí. Y te advierto... no dejaré que lo tomes ni aunque me des algo a cambio. cuando se muestren estos dialogos que tambien se muestre el asset "Pinkcraiyon" Kid: Je... amigo... ¿crees que todo este tiempo fui solo un niño perdido? Kid: Tengo que contarte algo... algo que quizá no te guste escuchar. Kid: Yo... soy una de esas “criaturas oscuras”. Kid: ¿Sorprendido? No deberías. No somos demonios ni monstruos sin sentido. Solo... depredadores. Como el lobo que caza al ciervo, como el ave que baja en picada por su presa. Eso es lo que somos. Cazamos... porque tenemos hambre. Nada más. Kid: No te mentí cuando te pedí ser tu amigo. No te mentí cuando dije que quería la luz de regreso. Porque incluso las criaturas oscuras necesitamos un sol al que volver. La oscuridad eterna no alimenta a nadie. Kid: Pinkcraiyon... ella es distinta. Ella guarda el pedazo de sol como si fuera suyo, pero no lo devoró, no lo dejó morir... lo protege. Y eso la hace peligrosa. Y a mi entender, ni negociando con ella se pudo llegar a un acuerdo. Kid: No te preocupes, nuevo amigo. No dejaré que luches solo contra ella. Llamaré a los míos... a decenas de criaturas oscuras. Ellos saben quién eres, saben lo que cargas. Y aunque tengan hambre, aunque su instinto les diga que te devoren... obedecerán. Kid: Se “encargarán” de Pinkcraiyon. De su sombra, de su deseo enfermizo por la luz. Y cuando todo termine... el pedazo de sol será tuyo. Kid: Porque al final, nuevo amigo, no importa qué seas o qué sea yo. Importa lo que haremos juntos. Tú salvarás los seis mundos... y yo me aseguraré de que nada te detenga. y que cuando se muestren esos dialogos se muestre el asset "Kid"
User prompt
que el asset "strazcafondo" cuando se vea que esté en pantalla completa, NO tan arriba como actualmente lo está.
User prompt
despues de terminar el dia 4 que el boton cambie a JUGAR DÍA 5 no a JUGAR DÍA 6 este ultimo solo se muestra despues de completar el dia 5
User prompt
al presionar el botón "JUGAR DÍA 5" se mostro el siguiente texto (no es un dialogo): no apareciste en el lugar que esperabas. Ante ti se extendía un paraje gris, lleno de lamentos que parecían flotar en el aire como un viento eterno. Allí, emergiendo de las sombras, se alzó una figura imponente: Strazca, el guardián de las almas en pena. abajo de este texto hay un botón llamado "presiona AQUI para continuar" y al presionar este botón se deja de mostrar el texto y poco a poco se comienza a mostrar el asset "strazcafondo" y dice los siguientes diálogos (los cuales para pasar al siguiente dialogo tendremos que hacer click en cualquier lugar de la pantalla): Strazca: humano, no te sorprendas. No ibas a venir aquí. Tu viaje fue desviado. Tantos saltos entre mundos... eso siempre despierta sospechas. Es mi deber observar a los que alteran el orden de los caminos. Strazca: Pero ahora... al mirarte con atención, ya no tengo dudas. Sé quién eres. He escuchado tu nombre susurrado incluso por las almas en pena. Tú eres quien traerá la luz de regreso a los seis mundos. El salvador que pondrá fin a la oscuridad eterna. ahora se oscurece el asset "strazcafondo" y se muestra el asset "pedazo" y dice los siguientes diálogos: pedazo: Este pedazo de sol ha estado bajo mi custodia, protegido de los horrores que lo anhelan. Pero no me pertenece. Te lo entrego a ti... a quien fue destinado. pedazo: Tómalo, salvador. Es tuyo. Llévalo contigo y que su luz te guíe. ahora se oscurece el asset "pedazo" y se vuelve a mostrar poco a poco el asset "strazcafondo" y dice el siguiente dialogo: Strazca: Ya es hora. Te enviaré al destino que originalmente aguardaba tu llegada. Ve con la bendición de este fragmento... y con mi deseo: que tu fuerza no flaquee. La oscuridad sabe de ti, y no se detendrá. luego de eso el asset "strazcafondo" se oscurece se muestra poco a poco el siguiente texto (no es un dialogo): Cuando Strazca levantó su mano espectral, sentiste cómo el aire se comprimía a tu alrededor. La grieta que había abierto vibraba como un espejo líquido, oscuro y frío, y antes de que pudieras respirar de nuevo, todo tu ser fue absorbido hacia él. Las voces de las almas en pena se despidieron con un murmullo suave, casi un canto lejano que se desvaneció en la nada. Por un instante no hubo arriba ni abajo, ni luz ni sombra, solo la sensación de estar suspendido en un vacío sin fin. Y entonces, de golpe, la oscuridad cedió. El suelo volvió bajo tus pies, áspero y familiar. El bosque grande e interminable, esa extraña sensación de soledad, la opresión del aire cargado... estabas allí otra vez. El primer mundo. Aquél donde comenzaste, donde quedaba un de los fragmentos de sol el cual lo tenía la primer criatura con la que hablaste; Y aunque Strazca había cumplido su palabra enviándote a tu destino, algo en tu pecho ardía distinto: ahora tenías más de lo que jamás habías tenido, valías mas de lo que jamás habías valido, y con ello también tenias más peso sobre tus hombros. Todo estaba en silencio, demasiado silencio. Como si el mundo mismo aguardara, expectante, a que dieras el siguiente paso... o a que la criatura que lo habitaba se presentara de nuevo. abajo de este texto hay un botón que se llama "presiona AQUI para continuar" y si presionamos ese botón el texto poco a poco se deja de mostrar para ahora mostrar poco a poco a el asset "Pinkcraiyon" la cual dice los siguientes diálogos (los cuales para pasar al siguiente dialogo tendremos que hacer click en cualquier lugar de la pantalla): Pinkcraiyon: Pequeño... tú otra vez. Je, je, je... ¿por qué has vuelto a mi mundo de sombras? ¿Acaso me extrañabas? ¿O acaso perdiste algo entre mis pasillos? Pinkcraiyon: Mírate... con esos ojos cansados, pero aún firmes. Ven... dime qué buscas. Dímelo al oído... yo quiero escucharlo todo. abajo de este texto hay un botón que se llama "presiona AQUI para explicarle porque hemos venido" y si presionamos ese botón se muestra el siguiente dialogo de pinkcraiyon: Pinkcraiyon: ¿El sol...? ¿Mi sol...? Ohhh, pequeño... ahora entiendo. Pinkcraiyon: Ese fragmento brillante, caliente... lo escondí porque arde, porque me hiere... pero también porque lo deseo. El sol no te pertenece a ti... ni a nadie. Es mío. Mi único tesoro. Pinkcraiyon: ¿De verdad crees que te lo daría? ¿Después de que trajiste luz a mis sombras, después de que me enseñaste lo que quiero olvidar? Pinkcraiyon: No, pequeño. No puedo... no quiero. Ese pedazo de sol no saldrá de mis manos. Pinkcraiyon: Si lo quieres... tendrás que arrancarlo de mí. Y te advierto... no dejaré que lo tomes ni aunque me des algo a cambio. después de los diálogos el asset se oscurece poco a poco y se muestra el siguiente texto en pantalla (no es un dialogo) El eco de las risas de Pinkcraiyon aún flotaba en el aire. Ella no cedió, no quiso entregarte el pedazo de sol. Sus palabras fueron un muro, y en sus ojos ardía un deseo que no podías quebrar. No hubo negociación, solo rechazo. Tu pecho pesaba con la derrota, pero antes de que pudieras dar un paso más, la oscuridad alrededor se quebró como un vidrio roto. Flotabas de nuevo, despojado de toda dirección, hasta que la penumbra se abrió mostrando la figura del pequeño. Allí estaba, de pie, el niño, con su pijama sucio, mirándote con esa inexpresiva cara. no venía a consolarte... venía a hablarte. Un mensaje importante estaba a punto de ser revelado ante ti. abajo de este texto hay un botón que se llama "presiona AQUI para continuar" y si presionamos ese botón el texto poco a poco se deja de mostrar para ahora mostrar poco a poco al asset "kid" y que diga los siguientes diálogos (los cuales para pasar al siguiente dialogo tendremos que hacer click en cualquier lugar de la pantalla): Kid: Je... amigo... ¿crees que todo este tiempo fui solo un niño perdido? Kid: Tengo que contarte algo... algo que quizá no te guste escuchar. Kid: Yo... soy una de esas “criaturas oscuras”. Kid: ¿Sorprendido? No deberías. No somos demonios ni monstruos sin sentido. Solo... depredadores. Como el lobo que caza al ciervo, como el ave que baja en picada por su presa. Eso es lo que somos. Cazamos... porque tenemos hambre. Nada más. Kid: No te mentí cuando te pedí ser tu amigo. No te mentí cuando dije que quería la luz de regreso. Porque incluso las criaturas oscuras necesitamos un sol al que volver. La oscuridad eterna no alimenta a nadie. Kid: Pinkcraiyon... ella es distinta. Ella guarda el pedazo de sol como si fuera suyo, pero no lo devoró, no lo dejó morir... lo protege. Y eso la hace peligrosa. Y a mi entender, ni negociando con ella se pudo llegar a un acuerdo. Kid: No te preocupes, nuevo amigo. No dejaré que luches solo contra ella. Llamaré a los míos... a decenas de criaturas oscuras. Ellos saben quién eres, saben lo que cargas. Y aunque tengan hambre, aunque su instinto les diga que te devoren... obedecerán. Kid: Se “encargarán” de Pinkcraiyon. De su sombra, de su deseo enfermizo por la luz. Y cuando todo termine... el pedazo de sol será tuyo. Kid: Porque al final, nuevo amigo, no importa qué seas o qué sea yo. Importa lo que haremos juntos. Tú salvarás los seis mundos... y yo me aseguraré de que nada te detenga. luego de los diálogos el asset de kid se oscurece y se muestra en pantalla completa el siguiente texto no es un dialogo: Pinkcraiyon cayó de rodillas, su cuerpo hecho jirones de sombra, temblando bajo la marea de criaturas oscuras que la habían doblegado. Sus ojos, antes llenos de soberbia, ahora ardían con un brillo febril: no de odio, sino de urgencia. Con voz quebrada, se dirigió a ti. abajo de este texto hay un botón que se llama "presiona AQUI para continuar" y si presionamos ese botón el texto poco a poco se deja de mostrar para ahora mostrar poco a poco en pantalla completa el asset "pinkdead" y los siguientes diálogos (que para pasar al siguiente dialogo tenemos que hacer click en cualquier lugar de la pantalla): Pinkdead: Pequeño... escucha... escucha bien lo que voy a decirte... Pinkdead: Ese niño... ese niño no es lo que parece. No se deja guiar por nobleza ni por bondad. No confíes en esa sonrisa, no confíes en esa voz. Todo lo que hace... todo lo que dice... es una trampa. Pinkdead: Él no quiere salvar los seis mundos... quiere poseerlos. Cuando consiga reunir todos los pedazos de sol, tendrá el poder absoluto, el fuego eterno en la palma de su mano... y gobernará en soledad. Pinkdead: No eres su amigo... eres su herramienta. Él te está usando para recolectar lo que jamás podría obtener por sí mismo. Pinkdead: Si sigues a ese niño... condenarás a todos... después de los diálogos se oscurece el asset Pinkdead y se muestra poco a poco el asset "kid" y dice los siguientes diálogos (que para pasar al siguiente dialogo tenemos que hacer click en cualquier lugar de la pantalla): Kid: No escuches esas tonterías, nuevo amigo. Pinkcraiyon solo quería confundirte. Sus últimas palabras no fueron más que delirios de alguien que sabía que había perdido. Kid: ¿Yo, gobernar los seis mundos? ¿Ja, ja, ja! Suena gracioso, ¿no? Esa cosa solo trataba de distraernos, de sembrar miedo en tu corazón para que no recuperaras el pedazo de sol que guardaba con tanta obsesión. Pero fracasó. Porque tú eres más fuerte. Kid: Mírate... ahora cargas con dos pedazos de sol. ¿Lo sientes? Ese calor en tu pecho, esa fuerza que te sostiene... Eso es la esperanza, nuevo amigo. Kid: Solo nos faltan tres fragmentos más. Tres. Y cuando los tengamos todos, el sol volverá a brillar sobre los seis mundos. No habrá más sombras eternas, no habrá más cavernas sin amanecer. Habrá luz... y será gracias a ti. Kid: Eres el salvador que siempre supe que serías. Y yo estaré contigo hasta el final. Kid: El siguiente mundo nos espera, con otro pedazo de sol escondido en su corazón. ahora el asset de "Kid" se oscurece y se muestra el siguiente texto (no es un dialogo): El portal palpitaba, esperando. El calor de los dos fragmentos en tu interior ardía como si respondieran a la llamada del umbral. Sabías que no había vuelta atrás. El viaje debía continuar... y el niño sería tu guía hacia lo desconocido. bajo de este texto hay un botón que se llama "presiona AQUI para terminar el día" y si presionamos ese botón el texto poco a poco se deja de mostrar para ahora mostrar poco a poco en pantalla completa el menú principal pero ahora dice "JUGAR DÍA 6" ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
cuando estemos en "paredcueva" que además de el contador de kilos de oro también haya otro de tiempo, que se llame ____ restante (los ____ son el tiempo que nos queda el cual comienza con 40 segundos y si conseguimos en el contador del oro el 50/50 antes de que el tiempo termine pues seguiremos con el juego de manera habitual, pero si termina el tiempo y no hemos completado aun los 50/50 entonces se nos mostrara una pantalla en negro con el texto "PERDISTE" y con el subtitulo "se acabo el tiempo, mejor suerte la próxima" y que después de unos 10 segundos donde se muestre ese texto se oscurezca poco a poco hasta desaparecer y se muestre el menu y que diga "JUGAR DÍA 4" (osea que hayamos perdido y tengamos que volver a jugar el DÍA 4... ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
los assets de el laberinto del dia 3 son reutilizados, ejemplo: usaste el asset roca para las paredes y usaste el asset bosque para el suelo, no quiero eso, quiero que sean assets nuevos, crealos, haz uno para las paredes y otro para el suelo, esos solo se usaran en el laberinto de el dia 3.
User prompt
kid Bien hecho, nuevo amigo... solo faltan 5 pedazos, te sorprendera saber que el siguiente esta en un lugar el cual ya has visitado... kid Seras teletransportado hacia el primer mundo... El segundo pedazo lo tiene una criatura llamada Pinkcraiyon... Te deseo suerte mi amigo. cuando se muestran estos dialogos que tambien se muestre el asset "kid" y cuando terminen estos dialogos que el asset "kid" se deje de mostrar ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
dialogos corregidos despues de terminar de juntar los 50/50 en "paredcueva" Rugbert: Así que es verdad... no eres una criatura oscura. Has probado tu esencia. Ninguna de esas sombras habría soportado tanto oro en sus manos sin desmoronarse. Rugbert: Gracias, humano. Sé quién eres... y lo que significas. En nombre de todas las criaturas de este mundo, te lo digo: tú serás el salvador de los seis mundos. Rugbert: Desde hace generaciones sabemos lo que anuncia tu llegada. Cuando un humano aparece aquí, no es casualidad. Es señal de que la oscuridad puede ser derrotada... y de que la luz puede ser recuperada. Tú traerás de vuelta el sol que nos fue arrebatado. se deja de mostrar poco a poco el asset "Rugbert" y ahora se ve el asset "pedazo" y dice los siguientes dialogos: pedazo: Este es el pedazo de sol que hemos protegido durante eras. Lo guardamos con nuestras vidas, esperando el día en que llegara aquel que pudiera unir todos los fragmentos. Ese día ha llegado... y tú eres ese elegido. pedazo: Recíbelo, Llévalo contigo. Es la luz de todos nosotros... y nuestra esperanza.
User prompt
Cuando por fin el último estuvo en tus manos, el silencio se hizo absoluto. El aire dejó de moverse. El suelo, ese mismo que había soportado tus pasos inseguros, comenzó a desvanecerse como arena negra arrastrada por un viento invisible. Sentiste que caías, que todo tu cuerpo se entregaba a un abismo sin fin. Fue entonces cuando una voz, desconocida y profunda, habló desde todas partes y desde ninguna: "Has superado la prueba. Eres más fuerte de lo que parecía... mi felicitación es tu pase hacia lo que sigue." Las palabras retumbaron en tu mente, y aunque sonaban como un premio, no traían alivio, sino un escalofrío inevitable. La oscuridad te envolvió por completo, y con ella llegó la certeza de que el viaje aún no había hecho más que empezar. Ahora temes al mundo al que serás arrojado. No sabes qué encontrarás al abrir los ojos otra vez: si criaturas que nunca has visto , si un paisaje imposible, o si algo aún peor, aguardando tu llegada. Lo único seguro es que el próximo mundo ya te espera... y que no tendrás opción más que caminar en él. abajo de ese texto hay un gran botón el cual dice "presiona AQUÍ para terminar el día" si presionamos el botón el texto se oscurece y se deja de mostrar el mismo, se muestra en pantalla completa el menú pero ahora dice "JUGAR DÍA 4" ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Cuando por fin el último estuvo en tus manos, el silencio se hizo absoluto. El aire dejó de moverse. El suelo, ese mismo que había soportado tus pasos inseguros, comenzó a desvanecerse como arena negra arrastrada por un viento invisible. Sentiste que caías, que todo tu cuerpo se entregaba a un abismo sin fin. Fue entonces cuando una voz, desconocida y profunda, habló desde todas partes y desde ninguna: "Has superado la prueba. Eres más fuerte de lo que parecía... mi felicitación es tu pase hacia lo que sigue." Las palabras retumbaron en tu mente, y aunque sonaban como un premio, no traían alivio, sino un escalofrío inevitable. La oscuridad te envolvió por completo, y con ella llegó la certeza de que el viaje aún no había hecho más que empezar. Ahora temes al mundo al que serás arrojado. No sabes qué encontrarás al abrir los ojos otra vez: si criaturas que nunca has visto , si un paisaje imposible, o si algo aún peor, aguardando tu llegada. Lo único seguro es que el próximo mundo ya te espera... y que no tendrás opción más que caminar en él. abajo de ese texto (ese texto aparece al final del día 3) abajo de ese texto hay un gran botón el cual dice "presiona AQUÍ para terminar el día" si presionamos el botón el texto se oscurece y se vuelve a mostrar el menú pero ahora dice "JUGAR DÍA 4" al presionar el botón "JUGAR DíA 4" se muestra el siguiente texto (no es un dialogo) este es el texto: Abriste los ojos y la oscuridad era distinta. Ya no estabas en un laberinto, ni en el vacío que te había tragado, sino en un mundo subterráneo. Allí no existía el cielo, ni rumores de amaneceres; lo único que se conocía en aquel mundo era el reino bajo tierra. Nadie sabía qué había arriba... algunos decían que no existía nada más. Fue entonces cuando los viste. Decenas de criaturas salieron de las grietas de las cavernas, rodeándote con pasos ágiles, casi reptilianos. Eran humanoides, sí, pero grises y orejudos, con ojos oscuros que parecían hechos para vivir eternamente en la penumbra. Comenzaron a hablar entre ellos, una lengua áspera, llena de chasquidos y reverberaciones que tu oído no podía descifrar. Sus voces aumentaron, se cruzaban sobre ti como un enjambre de sonidos incomprensibles. Tu respiración se aceleró. No entendías nada... hasta que uno de ellos, dio un paso adelante. Te miró con una calma extraña y, sin decir palabra, te ofreció un artefacto. abajo de este texto haya un botón que diga "presiona AQUI para continuar" si presionamos el botón "presiona AQUI para continuar" que el texto deje de mostrarse y en su lugar se muestre este otro texto poco a poco: Parecía tosco, hecho de metal y piedra tallada, pero recordaba la forma de unos auriculares con micrófono. Dudaste antes de tomarlo, pero la criatura insistió . Cuando lo colocaste sobre tu cabeza, un zumbido recorrió tus oídos y, de pronto, las voces comenzaron a cambiar. Criatura: —... ¿ahora nos entiendes, forastero? La sorpresa te atravesó. Ya no eran ruidos sin sentido: podías comprenderlos. Y lo más inquietante era que, al responder con un titubeo, ellos también te entendieron; Su voz grave resonaba como un eco dentro de las cavernas y dentro de tu propia mente. abajo de ese texto que haya un botón que diga "presiona AQUI para dialogar con la criatura" y si presionamos ese botón se deja de mostrar el texto y poco a poco se comienza a ser el asset "Rugbert" y se muestran los siguientes diálogos (los cuales para pasar al siguiente dialogo tendremos que tocar cualquier lugar de la pantalla): Rugbert Existen presencias que no deberían estar aquí... las llamamos criaturas oscuras. Ellas vuelven una y otra vez a este mundo, escondiéndose bajo formas inocentes. A menudo toman la apariencia de niños... y lo más terrible es que siempre saben el nombre de sus víctimas , incluso si nadie se los ha dicho. Rugbert Por eso desconfío de ti, forastero. No basta con las palabras. Si en verdad no eres una de esas cosas, tendrás que demostrarlo. Rugbert Las criaturas oscuras solo temen una cosa: el oro. Su esencia se retuerce ante él, y su disfraz se desmorona. Minarás las entrañas de estas cavernas y traerás cincuenta kilogramos de oro. Solo así sabré que no eres uno de ellos. abajo de ese dialogo que haya un botón que diga "presiona AQUI para demostrar que no eres una criatura oscura" y si presionamos ese botón se deja de mostrar poco a poco el asset "Rugbert" ahora poco a poco se muestra en pantalla completa el asset "paredcueva" y la mecánica será esta: hay un contador arriba que se llama "KILOS DE ORO __/50" se muestra el asset "picopng" el cual esta pegado al cursor de mouse, (lo movamos para donde lo movamos siempre va a estar pegado el asset "picopng" y se moverá hacia donde el cursor de mouse lo haga) cada vez que hagamos click en cualquier lugar de la pantalla: se mostrara durante 1 segundo el asset "oro" el cual aparece y se desvanece (se muestra en el costado izquierdo de donde hagamos click) cada que hacemos click se suma un numero a los __ del contador __/50 y cuando llegue a 50/50 la pantalla se oscurecerá, luego de eso se comienza a ver poco a poco el asset "Rugbert" y dice los siguientes diálogos: Rugbert: Así que es verdad... no eres una criatura oscura. Has probado tu esencia. Ninguna de esas sombras habría soportado tanto oro en sus manos sin desmoronarse. Rugbert: Gracias, humano. Sé quién eres... y lo que significas. En nombre de todas las criaturas de este mundo, te lo digo: tú serás el salvador de los seis mundos. Rugbert: Desde hace generaciones sabemos lo que anuncia tu llegada. Cuando un humano aparece aquí, no es casualidad. Es señal de que la oscuridad puede ser derrotada... y de que la luz puede ser recuperada. Tú traerás de vuelta el sol que nos fue arrebatado. se deja de mostrar poco a poco el asset "Rugbert" y ahora se ve el asset "pedazo" y dice los siguientes diálogos: pedazo: Este es el pedazo de sol que hemos protegido durante eras. Lo guardamos con nuestras vidas, esperando el día en que llegara aquel que pudiera unir todos los fragmentos. Ese día ha llegado... y tú eres ese elegido. pedazo: Recíbelo, Llévalo contigo. Es la luz de todos nosotros... y nuestra esperanza. ahora se oscurece el asset "sol" y se muestra el siguiente texto (no es un dialogo): En cuanto el pedazo de sol tocó tus manos, una oleada de calor recorrió tu cuerpo. No era solo calor físico... era algo más profundo, como si cada rincón de tu ser se encendiera. La oscuridad que llevabas dentro fue arrasada por una claridad abrasadora, y en ese instante supiste que aquel fragmento no era un objeto: era vida, memoria, luz pura. Tu piel comenzó a brillar, primero débil, luego tan fuerte que las criaturas a tu alrededor retrocedieron con las manos sobre sus ojos. El resplandor creció hasta envolver cada parte de ti. Perdiste peso. Sentiste cómo tus pies se desprendían del suelo y, sin darte cuenta, ya flotabas en medio de la caverna. Y entonces lo viste. El niño estaba allí, esperándote, con su pijama y sus pies descalzos, el hecho de que sea solo un niño lo hacia ver tan desconcertante parecía tan frágil y, al mismo tiempo, tan imposible. Flotabas hacia él, atraído como si tu cuerpo ya no te perteneciera. El fragmento de sol ardía en tu pecho, y la voz del niño comenzó a resonar, no en tus oídos, sino en tu mente. hay un botón abajo de este texto el cual se llama "presiona AQUI para continuar" si presionamos el botón "presiona AQUI para continuar" el texto se oscurece y poco a poco se muestra el asset "kid" y se muestran sus siguientes diálogos (los cuales para pasar al siguiente tenemos que hacer click en cualquier lugar de la pantalla): kid Bien hecho, nuevo amigo... solo faltan 5 pedazos, te sorprenderá saber que el siguiente esta en un lugar el cual ya has visitado... kid Serás teletransportado hacia el primer mundo... El segundo pedazo lo tiene una criatura llamada Pinkcraiyon... Te deseo suerte mi amigo. ahora después de que terminen los diálogos se oscurece poco a poco el asset "kid" y se vuelve a mostrar el menú, pero ahora dic "JUGAR DIA 5" ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
kid: ... ¿quieres ser mi amigo? ahora aparece un botón que ser llama "ACEPTAR SER SU AMIGO" y al presionarlo se deja de mostrar el botón y se muestra los siguientes diálogos: kid: okeyjkfhggdjgjd kid: Entonces, desde ahora, tú serás *mi nuevo amigo*. kid: El sol ha muerto... por eso aquí nunca amanece. Solo queda la noche. Pero podemos traerlo de vuelta. Los pedazos del sol se dispersaron en seis mundos... y uno de ellos está aquí, en este lugar al que llamas mundo dos. kid: Pero antes... debo saber si eres capaz. Tu... Mi nuevo amigo... tendrás que superar una prueba. kid: Estarás dentro de un laberinto, encontrarás quince ojos extraídos de bebes fallecidos, bebes que alguna vez soñaron con ver el amanecer pero la vida les tenia preparado otro destino. Solo reuniéndolos todos podrás demostrar que eres digno de continuar. kid: Cuando tengas los quince, yo mismo te guiaré al mundo tres... Mi nuevo amigo. al presionar el ultimo botón "presiona AQUÍ para terminar el día" todo se oscurece y se muestra el menú pero ahora dice "JUGAR DÍA 4" ↪💡 Consider importing and using the following plugins: @upit/tween.v1
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var Eye = Container.expand(function () { var self = Container.call(this); var eyeGraphics = self.attachAsset('ojo', { anchorX: 0.5, anchorY: 0.5 }); self.collected = false; self.collect = function () { if (self.collected) return; self.collected = true; self.visible = false; LK.getSound('collect').play(); }; return self; }); var Pill = Container.expand(function () { var self = Container.call(this); var pillGraphics = self.attachAsset('pill', { anchorX: 0.5, anchorY: 0.5 }); self.collected = false; self.collect = function () { if (self.collected) return; self.collected = true; self.visible = false; LK.getSound('collect').play(); }; return self; }); var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.attachAsset('player', { anchorX: 0.5, anchorY: 0.5 }); self.targetX = 0; self.targetY = 0; self.isMoving = false; self.moveToTarget = function (targetX, targetY) { if (self.isMoving) return; self.targetX = targetX; self.targetY = targetY; self.isMoving = true; tween(self, { x: targetX, y: targetY }, { duration: 500, easing: tween.easeOut, onFinish: function onFinish() { self.isMoving = false; } }); }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ // Language system var currentLanguage = storage.language || 'spanish'; var texts = { spanish: { play: 'JUGAR', playDay2: 'JUGAR DÍA 2', playDay3: 'JUGAR DÍA 3', playDay4: 'JUGAR DÍA 4', language: 'LENGUAJE', spanish: 'ESPAÑOL', english: 'INGLES', pills: 'PASTILLAS', worms: 'LOMBRICES', "continue": 'Haz CLICK en cualquier lugar para continuar', yes: 'SI', givePills: 'DAR PASTILLAS', acceptForest: 'ACEPTAR IR AL BOSQUE', giveWorms: 'DAR LOMBRICES', endDay: 'presiona AQUÍ para terminar el día' }, english: { play: 'PLAY', playDay2: 'PLAY DAY 2', playDay3: 'PLAY DAY 3', playDay4: 'PLAY DAY 4', language: 'LANGUAGE', spanish: 'SPANISH', english: 'ENGLISH', pills: 'PILLS', worms: 'WORMS', "continue": 'Click anywhere to continue', yes: 'YES', givePills: 'GIVE PILLS', acceptForest: 'ACCEPT GO TO FOREST', giveWorms: 'GIVE WORMS', endDay: 'press HERE to end the day' } }; // Game state management var gameState = "menu"; // "menu", "dialogue", "game", "ending", "language" var currentDialogue = 0; var dialogueTexts = { spanish: ["Ahhh… qué sorpresa… un pequeño perdido en este lugar sin alma.\nMmm… qué olor más extraño tienes… ya sé de dónde vienes.", "¿Quieres salir, verdad? ¿Quieres encontrar la puerta que te lleve lejos de aquí? Je, je, je… Yo sé dónde está.\nSí… yo siempre lo sé.", "Pero nada es gratis, pequeño. Yo también necesito algo… unas píldoras. Mis dulces, mis tesoros…\nLas perdí, y sin ellas me siento… vacía. ¿Me ayudarás?", "oh..", "Eso está mejor… sabía que no me dirías que no, pequeño.\nMis píldoras… están dentro de la mansión que se levanta allá… la de cinco pisos que araña el cielo.", "No tengas miedo… no necesitas recorrerla toda.\nMis píldoras están en el primer piso, todas escondidas como pequeños ratones traviesos.", "Son diez en total. Diez. Ni una menos… ni una más.\nCuando las tengas todas… busca la puerta roja. Solo por ahí podrás salir…\nsi es que todavía quieres hacerlo.", "Ve, pequeño… la mansión te espera. Y yo… yo estaré observando."], english: ["Ahhh... what a surprise... a little one lost in this soulless place.\nMmm... what a strange smell you have... I know where you come from.", "You want to leave, right? You want to find the door that takes you away from here? Heh, heh, heh... I know where it is.\nYes... I always know.", "But nothing is free, little one. I also need something... some pills. My sweets, my treasures...\nI lost them, and without them I feel... empty. Will you help me?", "oh..", "That's better... I knew you wouldn't say no to me, little one.\nMy pills... are inside the mansion that rises there... the five-story one that scrapes the sky.", "Don't be afraid... you don't need to go through it all.\nMy pills are on the first floor, all hidden like little mischievous mice.", "There are ten in total. Ten. Not one less... not one more.\nWhen you have them all... look for the red door. Only through there can you leave... if you still want to.", "Go, little one... the mansion awaits you. And I... I will be watching."] }; var endingDialogueTexts = { spanish: ["Ahhh… has vuelto, pequeño. Y veo que... sí... sí... puedo sentirlas.\n Mis dulces tesoros están contigo, ¿verdad?", "Dámelas... por favor... necesito sentir su dulzura en mis manos otra vez.", "Sí... sí... aquí están todas. Una... dos... tres... ¡Diez! Mis preciosas... cómo las extrañé...", "Gracias, pequeño... gracias por devolverme lo que más amo.\n Me siento... completa otra vez. El vacío se llena, la oscuridad se calma...", "Pero... pero hay algo que debo decirte. Algo que me duele confesar...", "Yo... yo te mentí, pequeño. La puerta roja... no te llevará a casa.\n No puedo decirte cómo salir de aquí porque... porque Ella nos observa.", "La Vigía del Umbral... siempre está mirando, siempre está escuchando. Si te dijera la verdad sobre la salida... \nsi te mostrara el camino real... Ella lo sabría. Y entonces... entonces nos castigaría a ambos.", "Perdóname, pequeño... perdóname por engañarte. Pero necesitaba mis píldoras... \ny tú... tú necesitabas una razón para seguir adelante, para no rendirte en este lugar maldito.", "La puerta roja... solo es el comienzo de otro laberinto. Pero tal vez...\n tal vez si eres lo suficientemente astuto... encontrarás tu propio camino.", "Ve ahora... antes de que Ella se dé cuenta de que hemos hablado demasiado.\n Y recuerda... en este lugar, la verdad es un lujo que pocos pueden permitirse.", "Adiós, pequeño valiente... que la suerte te acompañe en la oscuridad que te espera."], english: ["Ahhh... you've returned, little one. And I see that... yes... yes... I can feel them.\n My sweet treasures are with you, aren't you?", "Give them to me... please... I need to feel their sweetness in my hands again.", "Yes... yes... here they all are. One... two... three... Ten! My precious ones... how I missed them...", "Thank you, little one... thank you for returning what I love most.\n I feel... complete again. The void is filled, the darkness calms...", "But... but there's something I must tell you. Something that hurts me to confess...", "I... I lied to you, little one. The red door... won't take you home.\n I can't tell you how to get out of here because... because She watches us.", "The Watcher of the Threshold... always looking, always listening. If I told you the truth about the exit... \nif I showed you the real way... She would know. And then... then she would punish us both.", "Forgive me, little one... forgive me for deceiving you. But I needed my pills... \nand you... you needed a reason to keep going, to not give up in this cursed place.", "The red door... is only the beginning of another labyrinth. But maybe...\n maybe if you're clever enough... you'll find your own way.", "Go now... before She realizes we've talked too much.\n And remember... in this place, truth is a luxury few can afford.", "Goodbye, brave little one... may luck accompany you in the darkness that awaits."] }; // Day 2 dialogue texts var day2DialogueTexts = { spanish: ["¡Ah! ¡No... no te acerques más! ¡Espera... espera...! \nTú... tú eres... ¿eres real? ¿No eres una de... una de esas cosas que rondan por aquí?", "Por favor... por favor no me lastimes...\n yo... yo solo estaba escondido aquí... como siempre...", "Espera... te... te reconozco. Sí... sí, te vi. Te vi cruzar por esa puerta...\n esa maldita puerta que lleva años cerrada. Años y años...", "Fuiste... fuiste el primero en pasar por ahí en... en casi dos años.\n Dos largos y terribles años desde que alguien se atrevió a cruzarla.", "Caíste inconsciente... te... te vi caer como un saco al suelo. \nEstuviste ahí todo el día... y toda la noche también. Yo... yo quería ayudarte pero...\n pero tenía miedo. Siempre tengo miedo...", "Pensé... pensé que morirías ahí. Como los otros.\n Pero... pero aquí estás. De pie. Respirando.", "Escucha... escucha, por favor. Yo... yo necesito tu ayuda.\n Sé que... sé que acabas de despertar pero... pero no tengo a nadie más.", "Necesito... necesito ir al bosque. \nAl bosque oscuro que está más allá de los árboles retorcidos. \nHay... hay lombrices allí. Las necesito para... para sobrevivir.", "Pero yo... yo no puedo ir solo. Tengo demasiado miedo.\n Las sombras... las criaturas... los sonidos que hace el bosque por las noches...", "Por favor... por favor, ¿podrías ir tú?\n Solo... solo necesito unas cuantas lombrices. No muchas.\n Solo las suficientes para... para no morir de hambre.", "Yo... yo te esperaré aquí. Escondido. Siempre escondido.\n Si... si las traes, te... te daré algo a cambio. Algo que podría ayudarte en este lugar terrible.", "Por favor... di que sí. No... no me hagas ir solo al bosque. \nNo cuando las criaturas están más activas..."], english: ["Ah! No... don't come any closer! Wait... wait...! You... you are... are you real? You're not one of... one of those things that roam around here?", "Please... please don't hurt me... I... I was just hiding here... as always...", "Wait... I... I recognize you. Yes... yes, I saw you. I saw you cross through that door... that damn door that's been closed for years. Years and years...", "You were... you were the first to pass through there in... in almost two years. Two long and terrible years since someone dared to cross it.", "You fell unconscious... I... I saw you fall like a sack to the ground. You were there all day... and all night too. I... I wanted to help you but... but I was afraid. I'm always afraid...", "I thought... I thought you would die there. Like the others. But... but here you are. Standing. Breathing.", "Listen... listen, please. I... I need your help. I know that... I know you just woke up but... but I have no one else.", "I need... I need to go to the forest. To the dark forest beyond the twisted trees. There are... there are worms there. I need them to... to survive.", "But I... I can't go alone. I'm too afraid. The shadows... the creatures... the sounds the forest makes at night...", "Please... please, could you go? Just... just need a few worms. Not many. Just enough to... to not die of hunger.", "I... I will wait here. Hidden. Always hidden. If... if you bring them, I... I will give you something in return. Something that could help you in this terrible place.", "Please... say yes. Don't... don't make me go alone to the forest. Not when the creatures are more active..."] }; var day2PostAcceptTexts = { spanish: ["¿De... de verdad? ¿De verdad dijiste que sí? Yo... yo no puedo creerlo.\n Nadie... nadie nunca me ayuda aquí.", "Gracias... gracias, extraño valiente. \nEres... eres más corajudo de lo que yo jamás seré.", "Escucha... escucha bien. El bosque está... está hacia el norte.\n Verás un sendero... un sendero que se adentra entre los árboles negros.\n Pero... pero ten cuidado.", "Las lombrices... están bajo los troncos caídos. Bajo las piedras húmedas. Busca... \nbusca en los lugares más oscuros y mojados. Ahí es donde se esconden.", "Solo... solo necesito cinco. Cinco lombrices grandes. \nPero... pero si puedes traer más... más sería mejor. \nNunca se sabe... nunca se sabe cuándo volveré a conseguir comida.", "Y por favor... por favor ten mucho cuidado con los Susurradores.\n Son... son criaturas que viven entre los árboles. \nParecen niños... pero no lo son. Sus voces... \nsus voces te llamarán por tu nombre aunque nunca se los hayas dicho.", "Si... si los escuchas, no les hagas caso. \nNo importa lo que digan... no importa si lloran o suplican. \nSolo... solo busca las lombrices y vuelve rápido.", "Yo... yo estaré aquí, temblando como siempre. \nContando cada segundo hasta que regreses. \nSi... si no vuelves antes del anochecer... sabré que... \nque las criaturas te atraparon.", "Pero... pero confío en ti. \nEres el primero en dos años que cruzó esa puerta y sobrevivió.\n Tienes... tienes algo especial.", "Ve ahora... ve antes de que pierda el valor\n y te suplique que no vayas. Mi estómago... \nmi estómago no puede esperar más.", "Y recuerda... cinco lombrices como mínimo.\n Solo... solo eso y podrás irte. \nTe... te prometo que te daré algo útil a cambio."], english: ["Really? Did you really say yes? I... I can't believe it.\n Nobody... nobody ever helps me here.", "Thank you... thank you, brave stranger. \nYou are... you are braver than I could ever be.", "Listen... listen well. The forest is... is to the north.\n You'll see a path... a path that goes into the black trees.\n But... but be careful.", "The worms... are under fallen logs. Under wet stones. Look... \nlook in the darkest and wettest places. That's where they hide.", "Just... just need five. Five big worms. But... but if you can bring more... \nmore would be better. You never know... you never know when I'll get food again.", "And please... please be very careful with the Whisperers. They are... they are creatures that live among the trees. \nThey look like children... but they're not. Their voices... their voices will call you by name even though you never told them.", "If... if you hear them, ignore them. No matter what they say... no matter if they cry or beg. \nJust... just look for the worms and come back quickly.", "I... I will be here, trembling as always. Counting every second until you return. \nIf... if you don't come back before nightfall... I'll know that... that the creatures got you.", "But... but I trust you. You're the first in two years to cross that door and survive.\n You have... you have something special.", "Go now... go before I lose courage and beg you not to go. My stomach... \nmy stomach can't wait any longer.", "And remember... five worms minimum. Just... just that and you can go. \nI... I promise I'll give you something useful in return."] }; var day2ReturnTexts = { spanish: ["¡Ah! ¡Has... has vuelto! Yo... yo estaba tan asustado.\nPensé... pensé que no regresarías nunca.", "¿Las... las conseguiste? Por favor... por favor dime que las conseguiste.\nHe estado temblando aquí todo este tiempo... imaginando lo peor.", "¿Cinco? ¿De verdad trajiste cinco? Yo... yo no puedo creerlo.\nNadie... nadie había hecho algo así por mí en tanto tiempo.", "Por favor... por favor dámelas. Mi estómago...\nlleva días vacío. Siento que... que me voy a desmayar del hambre."], english: ["Ah! You... you're back! I... I was so scared. \nI thought... I thought you would never return.", "Did you... did you get them? Please... please tell me you got them.\nI've been trembling here all this time... imagining the worst.", "Five? Did you really bring five? I... I can't believe it. \nNobody... nobody had done something like this for me in so long.", "Please... please give them to me. My stomach...\nhas been empty for days. I feel like... like I'm going to faint from hunger."] }; var day2PostGiveTexts = { spanish: ["Sí... sí... aquí están. Una... dos... tres... cuatro... ¡cinco!\nTodas gordas y jugosas. Perfecto... perfecto.", "Gracias... gracias, extraño bondadoso. No sabes...\nno sabes lo que esto significa para alguien como yo.\nAlguien que siempre tiene miedo... que siempre se esconde.", "Te... te prometí algo a cambio, ¿verdad? Sí... sí, lo prometí.\nY yo... yo siempre cumplo mis promesas, aunque tiemble al hacerlo.", "Toma esto... es... es una linterna. Pero no es una linterna común.\nEsta... esta puede ahuyentar a las criaturas pequeñas. Las sombras menores huyen de su luz.", "No... no funcionará contra las cosas grandes y terribles,\npero... pero te ayudará en la oscuridad.\nTe mantendrá a salvo de los susurros y de las cosas que se arrastran.", "Y... y hay algo más que debo decirte.\nAlgo que vi mientras estabas en el bosque...", "Vi a La Vigía del Umbral... paseándose por aquí.\nEstaba... estaba buscando algo. O a alguien. Creo... creo que sabe que estás aquí.", "Ten cuidado... ten mucho cuidado. Cuando Ella busca a alguien...\nsignifica que algo va a cambiar. Y los cambios aquí... nunca son buenos.", "Ahora... ahora debo esconderme otra vez.\nComer mis lombrices en silencio y esperar... siempre esperar.", "por cierto, me llamo Havran.", "Gracias otra vez, valiente extraño.\nQue... que la suerte te proteja de lo que viene."], english: ["Yes... yes... here they are. One... two... three... four... five!\nAll fat and juicy. Perfect... perfect.", "Thank you... thank you, kind stranger. You don't know...\nyou don't know what this means to someone like me. \nSomeone who's always afraid... who always hides.", "I... I promised you something in return, right? Yes... yes, I promised.\nAnd I... I always keep my promises, even if I tremble doing it.", "Take this... it's... it's a flashlight. But it's not a common flashlight. \nThis... this can scare away small creatures. Minor shadows flee from its light.", "No... it won't work against big and terrible things,\nbut... but it will help you in the darkness. \nIt will keep you safe from whispers and crawling things.", "And... and there's something else I must tell you. \nSomething I saw while you were in the forest...", "I saw The Watcher of the Threshold... walking around here.\nShe was... she was looking for something. Or someone. I think... I think she knows you're here.", "Be careful... be very careful. When She looks for someone...\nit means something is going to change. And changes here... are never good.", "Now... now I must hide again.\nEat my worms in silence and wait... always wait.", "by the way, my name is Havran.", "Thank you again, brave stranger. \nMay... may luck protect you from what's coming."] }; var day2EndText = { spanish: "Te quedaste allí, en el frío suelo de ese extraño lugar.\nNo había manta ni refugio, solo la dureza de la piedra bajo tu cuerpo cansado.\nIntentaste moverte un poco, buscando una posición menos dura,\npero la incomodidad era inevitable.\nRespiraste hondo, intentando engañar al frío que se filtraba por cada rincón,\ny aunque sabías que ese no era un sitio para dormir, los párpados pesaban demasiado.\nTe abrazaste a ti mismo, buscaste un poco de calor en tu propia soledad, y poco a poco fuiste cediendo.\nEl silencio te envolvió, y la penumbra pareció observar cómo,\nvencido por el cansancio, cerrabas los ojos en aquel lugar desconocido,\nconfiando en que el amanecer traería algo distinto… Si es que siquiera existía un amanecer.", english: "You stayed there, on the cold ground of that strange place. \nThere was no blanket or shelter, just the hardness of stone under your tired body.\nYou tried to move a little, looking for a less hard position,\n but discomfort was inevitable.\nYou breathed deeply, trying to fool the cold that seeped through every corner,\n and although you knew that wasn't a place to sleep, your eyelids were too heavy.\nYou hugged yourself, looked for a little warmth in your own solitude, and little by little you gave in.\n Silence enveloped you, and the gloom seemed to watch how,\n overcome by fatigue, you closed your eyes in that unknown place, \ntrusting that dawn would bring something different… If dawn even existed." }; // Day 3 intro text var day3IntroText = { spanish: "Despertaste al día siguiente… pero la noche seguía allí, intacta, como si el tiempo se hubiera negado a avanzar.\nNo había amanecer, no había pájaros, solo la misma penumbra quieta que te había visto dormir.\nTe incorporaste lentamente, con el cuerpo entumecido por el frío del suelo.\nDecidiste caminar, mover las piernas para no quedarte atrapado en la inmovilidad de ese lugar extraño.\nEn un momento apareció una silueta. No era hostil, no parecía una amenaza…\nal contrario, tenía esa mirada que reconoce la soledad en otro.\nTe encontraste con un nuevo amigo.", english: "You woke up the next day... but the night was still there, intact, as if time had refused to move forward.\nThere was no dawn, no birds, only the same quiet gloom that had watched you sleep.\nYou sat up slowly, your body numb from the cold ground.\nYou decided to walk, move your legs so you wouldn't get trapped in the immobility of that strange place.\nAt one moment a silhouette appeared. It wasn't hostile, it didn't seem like a threat...\non the contrary, it had that look that recognizes loneliness in another.\nYou met a new friend." }; // Day 3 kid dialogue texts var day3KidDialogues = { spanish: ["… ¿quieres ser mi amigo?", "Entonces, desde ahora, tú serás *mi nuevo amigo*.", "El sol ha muerto… por eso aquí nunca amanece. Solo queda la noche. Pero podemos traerlo de vuelta.\nLos pedazos del sol se dispersaron en seis mundos…\ny uno de ellos está aquí, en este lugar al que llamas mundo dos.", "Pero antes… debo saber si eres capaz.\nTu... Mi nuevo amigo... tendrás que superar una prueba.", "Estarás dentro de un laberinto, encontrarás quince ojos extraídos de bebes fallecidos,\nbebes que alguna vez soñaron con ver el amanecer pero la vida les tenia preparado otro destino.\nSolo reuniéndolos todos podrás demostrar que eres digno de continuar.", "Cuando tengas los quince, yo mismo te guiaré al mundo tres… Mi nuevo amigo."], english: ["… do you want to be my friend?", "Then, from now on, you will be *my new friend*.", "The sun has died... that's why it never dawns here. Only night remains. But we can bring it back.\nThe pieces of the sun scattered in six worlds...\nand one of them is here, in this place you call world two.", "But first... I must know if you are capable.\nYou... My new friend... will have to overcome a test.", "You will be inside a labyrinth, you will find fifteen eyes extracted from deceased babies,\nbabies who once dreamed of seeing the dawn but life had another destiny prepared for them.\nOnly by gathering them all can you prove that you are worthy to continue.", "When you have all fifteen, I myself will guide you to world three... My new friend."] }; // Day 3 ending text var day3EndingText = { spanish: "Cuando por fin el último estuvo en tus manos, el silencio se hizo absoluto.\nEl aire dejó de moverse. El suelo, ese mismo que había soportado tus pasos inseguros,\ncomenzó a desvanecerse como arena negra arrastrada por un viento invisible.\nSentiste que caías, que todo tu cuerpo se entregaba a un abismo sin fin.\nFue entonces cuando una voz, desconocida y profunda,\nhabló desde todas partes y desde ninguna:\n\n\"Has superado la prueba. Eres más fuerte de lo que parecía…\nmi felicitación es tu pase hacia lo que sigue.\"\n\nLas palabras retumbaron en tu mente, y aunque sonaban como un premio, no traían alivio,\nsino un escalofrío inevitable. La oscuridad te envolvió por completo,\ny con ella llegó la certeza de que el viaje aún no había hecho más que empezar.\n\nAhora temes al mundo al que serás arrojado.\nNo sabes qué encontrarás al abrir los ojos otra vez: si criaturas que nunca has visto,\nsi un paisaje imposible, o si algo aún peor, aguardando tu llegada.\nLo único seguro es que el próximo mundo ya te espera…\ny que no tendrás opción más que caminar en él.", english: "When the last one was finally in your hands, silence became absolute.\nThe air stopped moving. The ground, the same one that had supported your uncertain steps,\nbegan to fade like black sand carried by an invisible wind.\nYou felt yourself falling, your whole body surrendering to an endless abyss.\nIt was then when a voice, unknown and deep,\nspoke from everywhere and from nowhere:\n\n\"You have passed the test. You are stronger than you seemed...\nmy congratulations are your pass to what follows.\"\n\nThe words echoed in your mind, and although they sounded like a prize, they brought no relief,\nbut an inevitable chill. Darkness enveloped you completely,\nand with it came the certainty that the journey had only just begun.\n\nNow you fear the world you will be thrown into.\nYou don't know what you'll find when you open your eyes again: if creatures you've never seen,\nif an impossible landscape, or if something even worse, awaiting your arrival.\nThe only certainty is that the next world is already waiting for you...\nand that you will have no choice but to walk in it." }; var currentEndingDialogue = 0; var showYesButton = false; var showGivePillsButton = false; var pillAssetShown = false; var day2Unlocked = false; var day3Unlocked = false; var day4Unlocked = false; var abriendoSoundPlayed = false; var currentDay2Dialogue = 0; var showAcceptForestButton = false; var showGiveWormsButton = false; var isDay2 = false; var isDay3 = false; var inForest = false; var wormsCollected = 0; var requiredWorms = 5; var forestRocks = []; var forestWorms = []; var lightRadius = 150; var currentDay2State = "dialogue"; // "dialogue", "forest", "return", "final" var currentDay3State = "intro"; // "intro", "dialogue", "maze", "ending" var currentDay3Dialogue = 0; var showAcceptFriendButton = false; var eyesCollected = 0; var requiredEyes = 15; var eyes = []; var CELL_SIZE = 64; // Mouse position tracking for forest lighting var mouseX = 0; var mouseY = 0; // Menu UI Elements var titleText = LK.getAsset('TITULO', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 600, scaleX: 8, scaleY: 8 }); game.addChild(titleText); var playButton = new Text2(texts[currentLanguage].play, { size: 80, fill: 0x4a90e2 }); playButton.anchor.set(0.5, 0.5); playButton.x = 1024; playButton.y = 1000; game.addChild(playButton); // Day 2 play button var playDay2Button = new Text2(texts[currentLanguage].playDay2, { size: 80, fill: 0x4a90e2 }); playDay2Button.anchor.set(0.5, 0.5); playDay2Button.x = 1024; playDay2Button.y = 1000; playDay2Button.visible = false; game.addChild(playDay2Button); var languageButton = new Text2(texts[currentLanguage].language, { size: 60, fill: 0x4a90e2 }); languageButton.anchor.set(0.5, 0.5); languageButton.x = 1024; languageButton.y = 1150; game.addChild(languageButton); // Language selection buttons (initially hidden) var spanishButton = new Text2(texts[currentLanguage].spanish, { size: 60, fill: 0x4a90e2 }); spanishButton.anchor.set(0.5, 0.5); spanishButton.x = 1024; spanishButton.y = 1250; spanishButton.visible = false; game.addChild(spanishButton); var englishButton = new Text2(texts[currentLanguage].english, { size: 60, fill: 0x4a90e2 }); englishButton.anchor.set(0.5, 0.5); englishButton.x = 1024; englishButton.y = 1350; englishButton.visible = false; game.addChild(englishButton); // Character sprite (initially hidden) var pinkcraiyon = LK.getAsset('Pinkcraiyon', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 800, scaleX: 2, scaleY: 2 }); pinkcraiyon.alpha = 0; game.addChild(pinkcraiyon); // Havran character sprite (initially hidden) var havran = LK.getAsset('Havran', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 800, scaleX: 4, scaleY: 4 }); havran.alpha = 0; game.addChild(havran); // Forest background (initially hidden) var bosque = LK.getAsset('bosque', { anchorX: 0, anchorY: 0, x: 0, y: 0, scaleX: 20.48, scaleY: 18.24 }); bosque.alpha = 0; game.addChild(bosque); // Lantern asset (initially hidden) var linterna = LK.getAsset('linterna', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 800, scaleX: 8, scaleY: 8 }); linterna.alpha = 0; game.addChild(linterna); // Kid character sprite (initially hidden) var kid = LK.getAsset('kid', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 800, scaleX: 8, scaleY: 8 }); kid.alpha = 0; game.addChild(kid); // Dialogue UI var dialogueBox = new Text2('', { size: 35, fill: 0xffffff }); dialogueBox.anchor.set(0.5, 0.5); dialogueBox.x = 1024; dialogueBox.y = 1800; dialogueBox.visible = false; game.addChild(dialogueBox); var continueText = new Text2(texts[currentLanguage]["continue"], { size: 28, fill: 0xcccccc }); continueText.anchor.set(0.5, 0.5); continueText.x = 1024; continueText.y = 2200; continueText.visible = false; game.addChild(continueText); var yesButton = new Text2(texts[currentLanguage].yes, { size: 60, fill: 0x4a90e2 }); yesButton.anchor.set(0.5, 0.5); yesButton.x = 1024; yesButton.y = 2000; yesButton.visible = false; game.addChild(yesButton); var givePillsButton = new Text2(texts[currentLanguage].givePills, { size: 60, fill: 0x4a90e2 }); givePillsButton.anchor.set(0.5, 0.5); givePillsButton.x = 1024; givePillsButton.y = 2000; givePillsButton.visible = false; game.addChild(givePillsButton); var acceptForestButton = new Text2(texts[currentLanguage].acceptForest, { size: 50, fill: 0x4a90e2 }); acceptForestButton.anchor.set(0.5, 0.5); acceptForestButton.x = 1024; acceptForestButton.y = 2000; acceptForestButton.visible = false; game.addChild(acceptForestButton); var giveWormsButton = new Text2(texts[currentLanguage].giveWorms, { size: 60, fill: 0x4a90e2 }); giveWormsButton.anchor.set(0.5, 0.5); giveWormsButton.x = 1024; giveWormsButton.y = 2000; giveWormsButton.visible = false; game.addChild(giveWormsButton); var endDayButton = new Text2(texts[currentLanguage].endDay, { size: 50, fill: 0x4a90e2 }); endDayButton.anchor.set(0.5, 0.5); endDayButton.x = 1024; endDayButton.y = 2400; endDayButton.visible = false; game.addChild(endDayButton); var acceptFriendButton = new Text2('ACEPTAR SER SU AMIGO', { size: 50, fill: 0x4a90e2 }); acceptFriendButton.anchor.set(0.5, 0.5); acceptFriendButton.x = 1024; acceptFriendButton.y = 2000; acceptFriendButton.visible = false; game.addChild(acceptFriendButton); var continueDay3Button = new Text2('presiona AQUÍ para continuar', { size: 50, fill: 0x4a90e2 }); continueDay3Button.anchor.set(0.5, 0.5); continueDay3Button.x = 1024; continueDay3Button.y = 2400; continueDay3Button.visible = false; game.addChild(continueDay3Button); var eyesCounterText = new Text2('', { size: 80, fill: 0xFFFFFF }); eyesCounterText.anchor.set(0.5, 0); eyesCounterText.visible = false; LK.gui.top.addChild(eyesCounterText); var wormsCounterText = new Text2('', { size: 80, fill: 0xFFFFFF }); wormsCounterText.anchor.set(0.5, 0); wormsCounterText.visible = false; LK.gui.top.addChild(wormsCounterText); var endingText = new Text2('', { size: 35, fill: 0xffffff }); endingText.anchor.set(0.5, 0.5); endingText.x = 1024; endingText.y = 1366; endingText.visible = false; game.addChild(endingText); // Pill asset for ending sequence var pillAsset = LK.getAsset('pill', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 800, scaleX: 15, scaleY: 15 }); pillAsset.alpha = 0; game.addChild(pillAsset); // Red door asset for final sequence var puertaRoja = LK.getAsset('puertaroja', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1366, scaleX: 0.5, scaleY: 0.5 }); puertaRoja.alpha = 0; game.addChild(puertaRoja); // Game variables (will be initialized when starting game) var MAZE_WIDTH, MAZE_HEIGHT, maze, mazeContainer, player, pills, pillsCollected, totalPills, counterText, door; // Function to update all UI texts with current language function updateLanguageTexts() { if (day4Unlocked) { playButton.setText(texts[currentLanguage].playDay4); playButton.visible = true; playDay2Button.visible = false; } else if (day3Unlocked) { playButton.setText(texts[currentLanguage].playDay3); playButton.visible = true; playDay2Button.visible = false; } else if (day2Unlocked) { playButton.visible = false; playDay2Button.setText(texts[currentLanguage].playDay2); playDay2Button.visible = true; } else { playButton.setText(texts[currentLanguage].play); playButton.visible = true; playDay2Button.visible = false; } languageButton.setText(texts[currentLanguage].language); spanishButton.setText(texts[currentLanguage].spanish); englishButton.setText(texts[currentLanguage].english); continueText.setText(texts[currentLanguage]["continue"]); yesButton.setText(texts[currentLanguage].yes); givePillsButton.setText(texts[currentLanguage].givePills); acceptForestButton.setText(texts[currentLanguage].acceptForest); giveWormsButton.setText(texts[currentLanguage].giveWorms); endDayButton.setText(texts[currentLanguage].endDay); if (counterText) { counterText.setText(texts[currentLanguage].pills + ' ' + pillsCollected + '/' + totalPills); } if (wormsCounterText && inForest) { wormsCounterText.setText(texts[currentLanguage].worms + ' ' + wormsCollected + '/' + requiredWorms); } if (eyesCounterText && isDay3 && gameState === "game") { eyesCounterText.setText('OJOS RECOLECTADOS ' + eyesCollected + '/15'); } } // Function to check if a position is walkable function isWalkable(x, y) { var gridX = Math.floor(x / CELL_SIZE); var gridY = Math.floor(y / CELL_SIZE); if (gridX < 0 || gridX >= MAZE_WIDTH || gridY < 0 || gridY >= MAZE_HEIGHT) { return false; } return maze[gridY][gridX] === 0; } // Function to check if path between two points is clear function hasPathTo(fromX, fromY, toX, toY) { var fromGridX = Math.floor(fromX / CELL_SIZE); var fromGridY = Math.floor(fromY / CELL_SIZE); var toGridX = Math.floor(toX / CELL_SIZE); var toGridY = Math.floor(toY / CELL_SIZE); // Simple line-of-sight check var dx = Math.abs(toGridX - fromGridX); var dy = Math.abs(toGridY - fromGridY); var stepX = fromGridX < toGridX ? 1 : -1; var stepY = fromGridY < toGridY ? 1 : -1; var err = dx - dy; var currentX = fromGridX; var currentY = fromGridY; while (true) { if (currentX < 0 || currentX >= MAZE_WIDTH || currentY < 0 || currentY >= MAZE_HEIGHT) { return false; } if (maze[currentY][currentX] === 1) { return false; } if (currentX === toGridX && currentY === toGridY) { return true; } var e2 = 2 * err; if (e2 > -dy) { err -= dy; currentX += stepX; } if (e2 < dx) { err += dx; currentY += stepY; } } } // Function to get random walkable position function getRandomWalkablePosition() { var attempts = 0; while (attempts < 100) { var x = Math.floor(Math.random() * MAZE_WIDTH); var y = Math.floor(Math.random() * MAZE_HEIGHT); if (maze[y][x] === 0) { return { x: x * CELL_SIZE + CELL_SIZE / 2, y: y * CELL_SIZE + CELL_SIZE / 2 }; } attempts++; } // Fallback to player starting position return { x: CELL_SIZE / 2, y: CELL_SIZE / 2 }; } // Spawn initial pills for (var i = 0; i < totalPills; i++) { var pillPos = getRandomWalkablePosition(); // Make sure pill is not too close to player start while (Math.abs(pillPos.x - CELL_SIZE / 2) < 128 && Math.abs(pillPos.y - CELL_SIZE / 2) < 128) { pillPos = getRandomWalkablePosition(); } var pill = game.addChild(new Pill()); pill.x = pillPos.x; pill.y = pillPos.y + 150; // Adjust for maze container offset pills.push(pill); } // Game move handler for mouse tracking game.move = function (x, y, obj) { mouseX = x; mouseY = y; }; // Game click handler game.down = function (x, y, obj) { if (gameState === "menu") { // Check if play button was clicked if (playButton.visible && x >= playButton.x - 100 && x <= playButton.x + 100 && y >= playButton.y - 50 && y <= playButton.y + 50) { if (day3Unlocked) { startDay3(); } else { startDialogue(); } } // Check if play Day 2 button was clicked else if (playDay2Button.visible && x >= playDay2Button.x - 100 && x <= playDay2Button.x + 100 && y >= playDay2Button.y - 50 && y <= playDay2Button.y + 50) { startDay2Dialogue(); } // Check if language button was clicked else if (x >= languageButton.x - 120 && x <= languageButton.x + 120 && y >= languageButton.y - 50 && y <= languageButton.y + 50) { gameState = "language"; spanishButton.visible = true; englishButton.visible = true; } } else if (gameState === "day3") { if (currentDay3State === "intro") { // Check if continue button was clicked if (continueDay3Button.visible && x >= continueDay3Button.x - 150 && x <= continueDay3Button.x + 150 && y >= continueDay3Button.y - 30 && y <= continueDay3Button.y + 30) { startDay3Dialogue(); } } else if (currentDay3State === "dialogue") { if (showAcceptFriendButton && acceptFriendButton.visible) { // Check if accept friend button was clicked if (x >= acceptFriendButton.x - 150 && x <= acceptFriendButton.x + 150 && y >= acceptFriendButton.y - 30 && y <= acceptFriendButton.y + 30) { showAcceptFriendButton = false; acceptFriendButton.visible = false; continueText.visible = true; currentDay3Dialogue++; if (currentDay3Dialogue < day3KidDialogues[currentLanguage].length) { dialogueBox.setText(day3KidDialogues[currentLanguage][currentDay3Dialogue]); } } } else { // Continue dialogue currentDay3Dialogue++; if (currentDay3Dialogue === 1) { // Show accept friend button after first dialogue showAcceptFriendButton = true; acceptFriendButton.visible = true; continueText.visible = false; } else if (currentDay3Dialogue >= day3KidDialogues[currentLanguage].length) { // Start the maze game startDay3Maze(); } else { dialogueBox.setText(day3KidDialogues[currentLanguage][currentDay3Dialogue]); } } } else if (currentDay3State === "ending") { // Check if end day button was clicked if (endDayButton.visible && x >= endDayButton.x - 150 && x <= endDayButton.x + 150 && y >= endDayButton.y - 30 && y <= endDayButton.y + 30) { returnToMenuDay4(); } } } else if (gameState === "day2") { if (showAcceptForestButton && acceptForestButton.visible) { // Check if accept forest button was clicked if (x >= acceptForestButton.x - 150 && x <= acceptForestButton.x + 150 && y >= acceptForestButton.y - 30 && y <= acceptForestButton.y + 30) { showAcceptForestButton = false; acceptForestButton.visible = false; continueText.visible = true; currentDay2State = "postAccept"; currentDay2Dialogue = 0; dialogueBox.setText(day2PostAcceptTexts[currentLanguage][currentDay2Dialogue]); } } else if (showGiveWormsButton && giveWormsButton.visible) { // Check if give worms button was clicked if (x >= giveWormsButton.x - 120 && x <= giveWormsButton.x + 120 && y >= giveWormsButton.y - 30 && y <= giveWormsButton.y + 30) { showGiveWormsButton = false; giveWormsButton.visible = false; continueText.visible = true; currentDay2State = "final"; currentDay2Dialogue = 0; dialogueBox.setText(day2PostGiveTexts[currentLanguage][currentDay2Dialogue]); } } else if (endDayButton.visible) { // Check if end day button was clicked if (x >= endDayButton.x - 150 && x <= endDayButton.x + 150 && y >= endDayButton.y - 30 && y <= endDayButton.y + 30) { returnToMenuDay3(); } } else { // Continue Day 2 dialogue if (currentDay2State === "dialogue") { currentDay2Dialogue++; if (currentDay2Dialogue === day2DialogueTexts[currentLanguage].length) { // Show accept forest button showAcceptForestButton = true; acceptForestButton.visible = true; continueText.visible = false; currentDay2Dialogue = 0; } else { dialogueBox.setText(day2DialogueTexts[currentLanguage][currentDay2Dialogue]); } } else if (currentDay2State === "postAccept") { currentDay2Dialogue++; if (currentDay2Dialogue >= day2PostAcceptTexts[currentLanguage].length) { // Start forest sequence startForestSequence(); } else { dialogueBox.setText(day2PostAcceptTexts[currentLanguage][currentDay2Dialogue]); } } else if (currentDay2State === "return") { currentDay2Dialogue++; if (currentDay2Dialogue === day2ReturnTexts[currentLanguage].length) { // Show give worms button showGiveWormsButton = true; giveWormsButton.visible = true; continueText.visible = false; currentDay2Dialogue = 0; } else { dialogueBox.setText(day2ReturnTexts[currentLanguage][currentDay2Dialogue]); } } else if (currentDay2State === "final") { currentDay2Dialogue++; if (currentDay2Dialogue === 3) { // Show lantern showLantern(); dialogueBox.setText(day2PostGiveTexts[currentLanguage][currentDay2Dialogue]); } else if (currentDay2Dialogue === 5) { // Hide lantern, show Havran again hideLantern(); dialogueBox.setText(day2PostGiveTexts[currentLanguage][currentDay2Dialogue]); } else if (currentDay2Dialogue >= day2PostGiveTexts[currentLanguage].length) { // Show ending text and button showDay2Ending(); } else { dialogueBox.setText(day2PostGiveTexts[currentLanguage][currentDay2Dialogue]); } } } } else if (gameState === "forest") { // Handle forest rock clicking handleForestClick(x, y); } else if (gameState === "language") { // Check if Spanish button was clicked if (x >= spanishButton.x - 100 && x <= spanishButton.x + 100 && y >= spanishButton.y - 50 && y <= spanishButton.y + 50) { currentLanguage = 'spanish'; storage.language = currentLanguage; gameState = "menu"; spanishButton.visible = false; englishButton.visible = false; updateLanguageTexts(); } // Check if English button was clicked else if (x >= englishButton.x - 100 && x <= englishButton.x + 100 && y >= englishButton.y - 50 && y <= englishButton.y + 50) { currentLanguage = 'english'; storage.language = currentLanguage; gameState = "menu"; spanishButton.visible = false; englishButton.visible = false; updateLanguageTexts(); } } else if (gameState === "dialogue") { if (showYesButton && yesButton.visible) { // Check if yes button was clicked if (x >= yesButton.x - 50 && x <= yesButton.x + 50 && y >= yesButton.y - 30 && y <= yesButton.y + 30) { showYesButton = false; yesButton.visible = false; continueText.visible = true; currentDialogue++; if (currentDialogue < dialogueTexts[currentLanguage].length) { dialogueBox.setText(dialogueTexts[currentLanguage][currentDialogue]); } } } else { // Continue dialogue currentDialogue++; if (currentDialogue === 3) { // Show YES button after third dialogue showYesButton = true; yesButton.visible = true; continueText.visible = false; } else if (currentDialogue >= dialogueTexts[currentLanguage].length) { // Start the game startGame(); } else { dialogueBox.setText(dialogueTexts[currentLanguage][currentDialogue]); } } } else if (gameState === "ending") { if (showGivePillsButton && givePillsButton.visible) { // Check if give pills button was clicked if (x >= givePillsButton.x - 120 && x <= givePillsButton.x + 120 && y >= givePillsButton.y - 30 && y <= givePillsButton.y + 30) { showGivePillsButton = false; givePillsButton.visible = false; continueText.visible = true; currentEndingDialogue++; dialogueBox.setText(endingDialogueTexts[currentLanguage][currentEndingDialogue]); } } else { // Continue ending dialogue currentEndingDialogue++; if (currentEndingDialogue === 2) { // Show give pills button after second dialogue showGivePillsButton = true; givePillsButton.visible = true; continueText.visible = false; } else if (currentEndingDialogue === 3) { dialogueBox.setText(endingDialogueTexts[currentLanguage][currentEndingDialogue]); } else if (currentEndingDialogue >= endingDialogueTexts[currentLanguage].length) { // End sequence with door animation startEndingSequence(); } else { dialogueBox.setText(endingDialogueTexts[currentLanguage][currentEndingDialogue]); } } } else if (gameState === "game") { if (player.isMoving) return; // Adjust for maze container offset var adjustedY = y - 150; var adjustedPlayerY = player.y - 150; // Check if target position is walkable and path is clear if (isWalkable(x, adjustedY) && hasPathTo(player.x, adjustedPlayerY, x, adjustedY)) { // Snap to grid center var gridX = Math.floor(x / CELL_SIZE); var gridY = Math.floor(adjustedY / CELL_SIZE); var targetX = gridX * CELL_SIZE + CELL_SIZE / 2; var targetY = gridY * CELL_SIZE + CELL_SIZE / 2 + 150; // Add offset back player.moveToTarget(targetX, targetY); } } }; function startDialogue() { gameState = "dialogue"; titleText.visible = false; playButton.visible = false; languageButton.visible = false; // Fade in Pinkcraiyon tween(pinkcraiyon, { alpha: 1 }, { duration: 1000, easing: tween.easeOut, onFinish: function onFinish() { // Show first dialogue dialogueBox.visible = true; continueText.visible = true; dialogueBox.setText(dialogueTexts[currentLanguage][currentDialogue]); } }); } function startGame() { gameState = "game"; // Hide dialogue elements pinkcraiyon.visible = false; dialogueBox.visible = false; continueText.visible = false; initializeGame(); } function startEndingDialogue() { gameState = "ending"; currentEndingDialogue = 0; // Hide game elements if (mazeContainer) mazeContainer.visible = false; if (player) player.visible = false; if (counterText) counterText.visible = false; // Hide all pills for (var i = 0; i < pills.length; i++) { pills[i].visible = false; } // Show dialogue elements game.setBackgroundColor(0x000000); dialogueBox.visible = true; continueText.visible = true; // Fade in Pinkcraiyon tween(pinkcraiyon, { alpha: 1 }, { duration: 1000, easing: tween.easeOut, onFinish: function onFinish() { pinkcraiyon.visible = true; dialogueBox.setText(endingDialogueTexts[currentLanguage][currentEndingDialogue]); } }); } function startEndingSequence() { // Hide dialogue elements first dialogueBox.visible = false; continueText.visible = false; // Fade out Pinkcraiyon tween(pinkcraiyon, { alpha: 0 }, { duration: 1000, onFinish: function onFinish() { // After Pinkcraiyon fades out, show and animate puerta roja puertaRoja.visible = true; puertaRoja.scaleX = 0.5; puertaRoja.scaleY = 0.5; tween(puertaRoja, { alpha: 1, scaleX: 8, scaleY: 8 }, { duration: 12000, easing: tween.easeOut, onFinish: function onFinish() { // Play opening sound only once if (!abriendoSoundPlayed) { LK.getSound('abriendo').play(); abriendoSoundPlayed = true; } // Wait for sound to finish, then fade out door and show black background LK.setTimeout(function () { tween(puertaRoja, { alpha: 0 }, { duration: 1000, onFinish: function onFinish() { // After door fades out and black background is shown, return to menu returnToMenu(); } }); }, 3000); // Wait 3 seconds for sound to finish } }); } }); } function startDay2Dialogue() { gameState = "day2"; isDay2 = true; currentDay2State = "dialogue"; currentDay2Dialogue = 0; titleText.visible = false; playButton.visible = false; playDay2Button.visible = false; languageButton.visible = false; // Fade in Havran tween(havran, { alpha: 1 }, { duration: 1000, easing: tween.easeOut, onFinish: function onFinish() { // Show first dialogue dialogueBox.visible = true; continueText.visible = true; dialogueBox.setText(day2DialogueTexts[currentLanguage][currentDay2Dialogue]); } }); } function startForestSequence() { currentDay2State = "forest"; gameState = "forest"; inForest = true; wormsCollected = 0; // Hide dialogue elements havran.visible = false; dialogueBox.visible = false; continueText.visible = false; // Show forest background darkened bosque.visible = true; bosque.alpha = 1; bosque.tint = 0x000000; // Make it completely dark // Show worms counter wormsCounterText.visible = true; wormsCounterText.setText(texts[currentLanguage].worms + ' ' + wormsCollected + '/' + requiredWorms); // Spawn initial rocks spawnForestRocks(); } function spawnForestRocks() { // Clear existing rocks for (var i = 0; i < forestRocks.length; i++) { if (forestRocks[i]) { forestRocks[i].destroy(); } } forestRocks = []; // Spawn 5-8 random rocks var numRocks = 5 + Math.floor(Math.random() * 4); for (var i = 0; i < numRocks; i++) { var rock = LK.getAsset('roca', { anchorX: 0.5, anchorY: 0.5, x: 200 + Math.random() * 1648, y: 200 + Math.random() * 2332, scaleX: 2, scaleY: 2 }); rock.tint = 0x000000; // Start completely dark game.addChild(rock); forestRocks.push(rock); } } function handleForestClick(x, y) { // Check if clicked on any visible rock for (var i = 0; i < forestRocks.length; i++) { var rock = forestRocks[i]; if (rock && rock.visible) { var dx = x - rock.x; var dy = y - rock.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance < 50) { // Rock hit radius // Fade out rock tween(rock, { alpha: 0 }, { duration: 500, onFinish: function onFinish() { // 50% chance to spawn worm if (Math.random() < 0.5) { spawnWorm(rock.x, rock.y); } rock.destroy(); } }); // Remove from array forestRocks.splice(i, 1); // Spawn new rock after delay LK.setTimeout(function () { if (inForest && wormsCollected < requiredWorms) { var newRock = LK.getAsset('roca', { anchorX: 0.5, anchorY: 0.5, x: 200 + Math.random() * 1648, y: 200 + Math.random() * 2332, scaleX: 2, scaleY: 2 }); newRock.tint = 0x000000; game.addChild(newRock); forestRocks.push(newRock); } }, 2000); break; } } } } function spawnWorm(x, y) { var worm = LK.getAsset('lombriz', { anchorX: 0.5, anchorY: 0.5, x: x, y: y, scaleX: 2, scaleY: 2 }); worm.tint = 0x000000; // Start dark, will be lit by light effect game.addChild(worm); forestWorms.push(worm); wormsCollected++; wormsCounterText.setText(texts[currentLanguage].worms + ' ' + wormsCollected + '/' + requiredWorms); // Auto-fade worm after 2 seconds LK.setTimeout(function () { if (worm) { tween(worm, { alpha: 0 }, { duration: 500, onFinish: function onFinish() { worm.destroy(); // Remove from array var index = forestWorms.indexOf(worm); if (index > -1) { forestWorms.splice(index, 1); } } }); } }, 2000); // Check if collected enough worms if (wormsCollected >= requiredWorms) { LK.setTimeout(function () { endForestSequence(); }, 1000); } } function endForestSequence() { inForest = false; gameState = "day2"; currentDay2State = "return"; currentDay2Dialogue = 0; // Hide forest elements bosque.visible = false; wormsCounterText.visible = false; // Clear rocks and worms for (var i = 0; i < forestRocks.length; i++) { if (forestRocks[i]) { forestRocks[i].destroy(); } } for (var i = 0; i < forestWorms.length; i++) { if (forestWorms[i]) { forestWorms[i].destroy(); } } forestRocks = []; forestWorms = []; // Show Havran again and start return dialogue game.setBackgroundColor(0x000000); tween(havran, { alpha: 1 }, { duration: 1000, easing: tween.easeOut, onFinish: function onFinish() { havran.visible = true; dialogueBox.visible = true; continueText.visible = true; dialogueBox.setText(day2ReturnTexts[currentLanguage][currentDay2Dialogue]); } }); } function showLantern() { havran.visible = false; tween(havran, { alpha: 0 }, { duration: 500, onFinish: function onFinish() { linterna.visible = true; tween(linterna, { alpha: 1 }, { duration: 1000 }); } }); } function hideLantern() { tween(linterna, { alpha: 0 }, { duration: 500, onFinish: function onFinish() { linterna.visible = false; havran.visible = true; tween(havran, { alpha: 1 }, { duration: 1000 }); } }); } function showDay2Ending() { // Hide dialogue elements havran.visible = false; dialogueBox.visible = false; continueText.visible = false; // Show ending text endingText.visible = true; endingText.setText(day2EndText[currentLanguage]); endDayButton.visible = true; } function returnToMenuDay3() { gameState = "menu"; day3Unlocked = true; // Reset all Day 2 variables isDay2 = false; currentDay2Dialogue = 0; currentDay2State = "dialogue"; showAcceptForestButton = false; showGiveWormsButton = false; wormsCollected = 0; inForest = false; // Show menu elements titleText.visible = true; playButton.visible = true; playDay2Button.visible = false; languageButton.visible = true; spanishButton.visible = false; englishButton.visible = false; updateLanguageTexts(); // Hide all Day 2 elements havran.visible = false; havran.alpha = 0; bosque.visible = false; linterna.visible = false; linterna.alpha = 0; endingText.visible = false; endDayButton.visible = false; acceptForestButton.visible = false; giveWormsButton.visible = false; wormsCounterText.visible = false; dialogueBox.visible = false; continueText.visible = false; } function startDay3() { gameState = "day3"; isDay3 = true; currentDay3State = "intro"; titleText.visible = false; playButton.visible = false; playDay2Button.visible = false; languageButton.visible = false; // Show intro text endingText.visible = true; endingText.setText(day3IntroText[currentLanguage]); continueDay3Button.visible = true; } function startDay3Dialogue() { currentDay3State = "dialogue"; currentDay3Dialogue = 0; // Hide intro elements endingText.visible = false; continueDay3Button.visible = false; // Fade in Kid tween(kid, { alpha: 1 }, { duration: 1000, easing: tween.easeOut, onFinish: function onFinish() { // Show first dialogue dialogueBox.visible = true; continueText.visible = true; dialogueBox.setText(day3KidDialogues[currentLanguage][currentDay3Dialogue]); } }); } function startDay3Maze() { gameState = "game"; isDay3 = true; currentDay3State = "maze"; // Hide dialogue elements kid.visible = false; dialogueBox.visible = false; continueText.visible = false; acceptFriendButton.visible = false; // Initialize Day 3 maze with different assets initializeDay3Maze(); } function initializeDay3Maze() { MAZE_WIDTH = Math.floor(1800 / CELL_SIZE); MAZE_HEIGHT = Math.floor(2582 / CELL_SIZE); // Generate maze (same logic as Day 1 but different assets) maze = []; for (var y = 0; y < MAZE_HEIGHT; y++) { maze[y] = []; for (var x = 0; x < MAZE_WIDTH; x++) { if (x === 0 || y === 0 || x === MAZE_WIDTH - 1 || y === MAZE_HEIGHT - 1) { maze[y][x] = 1; } else if (x % 8 >= 2 && x % 8 <= 5 && y % 8 >= 2 && y % 8 <= 5 && Math.random() < 0.6) { maze[y][x] = 1; } else if (y % 6 === 2 && x % 8 >= 1 && x % 8 <= 6 && Math.random() < 0.5) { maze[y][x] = 1; } else if (x % 6 === 2 && y % 8 >= 1 && y % 8 <= 6 && Math.random() < 0.5) { maze[y][x] = 1; } else if (x % 4 === 0 && y % 4 === 0 && Math.random() < 0.3) { maze[y][x] = 1; } else { maze[y][x] = 0; } } } // Clear starting and ending areas for (var sy = 1; sy <= 4; sy++) { for (var sx = 1; sx <= 4; sx++) { maze[sy][sx] = 0; } } for (var ey = MAZE_HEIGHT - 5; ey < MAZE_HEIGHT - 1; ey++) { for (var ex = MAZE_WIDTH - 5; ex < MAZE_WIDTH - 1; ex++) { maze[ey][ex] = 0; } } // Create guaranteed paths for (var py = 3; py < MAZE_HEIGHT - 1; py += 6) { for (var px = 1; px < MAZE_WIDTH - 1; px++) { maze[py][px] = 0; } } for (var px = 3; px < MAZE_WIDTH - 1; px += 6) { for (var py = 1; py < MAZE_HEIGHT - 1; py++) { maze[py][px] = 0; } } // Create maze visuals with different assets mazeContainer = game.addChild(new Container()); mazeContainer.y = 150; for (var y = 0; y < MAZE_HEIGHT; y++) { for (var x = 0; x < MAZE_WIDTH; x++) { var cellX = x * CELL_SIZE; var cellY = y * CELL_SIZE; if (maze[y][x] === 1) { // Use different wall asset for Day 3 var wall = LK.getAsset('roca', { x: cellX, y: cellY, scaleX: 0.64, scaleY: 0.64 }); mazeContainer.addChild(wall); } else { // Use different floor asset for Day 3 var floor = LK.getAsset('bosque', { x: cellX, y: cellY, scaleX: 0.64, scaleY: 0.426 }); mazeContainer.addChild(floor); } } } // Create player with different asset for Day 3 player = game.addChild(new Player()); var playerStartX = CELL_SIZE + CELL_SIZE / 2; var playerStartY = CELL_SIZE + CELL_SIZE / 2; player.x = playerStartX; player.y = playerStartY + 150; // Initialize eyes array and counter eyes = []; eyesCollected = 0; totalPills = requiredEyes; // Eyes counter eyesCounterText.visible = true; eyesCounterText.setText('OJOS RECOLECTADOS ' + eyesCollected + '/15'); // Spawn 15 eyes for (var i = 0; i < requiredEyes; i++) { var eyePos = getRandomWalkablePosition(); while (Math.abs(eyePos.x - CELL_SIZE / 2) < 128 && Math.abs(eyePos.y - CELL_SIZE / 2) < 128) { eyePos = getRandomWalkablePosition(); } var eye = game.addChild(new Eye()); eye.x = eyePos.x; eye.y = eyePos.y + 150; eyes.push(eye); } } function showDay3Ending() { currentDay3State = "ending"; // Hide game elements if (mazeContainer) mazeContainer.visible = false; if (player) player.visible = false; eyesCounterText.visible = false; for (var i = 0; i < eyes.length; i++) { eyes[i].visible = false; } // Show ending text game.setBackgroundColor(0x000000); endingText.visible = true; endingText.setText(day3EndingText[currentLanguage]); endDayButton.visible = true; } function returnToMenuDay4() { gameState = "menu"; day4Unlocked = true; // Reset all Day 3 variables isDay3 = false; currentDay3Dialogue = 0; currentDay3State = "intro"; showAcceptFriendButton = false; eyesCollected = 0; // Show menu elements titleText.visible = true; playButton.visible = true; playDay2Button.visible = false; languageButton.visible = true; spanishButton.visible = false; englishButton.visible = false; updateLanguageTexts(); // Hide all Day 3 elements kid.visible = false; kid.alpha = 0; endingText.visible = false; endDayButton.visible = false; continueDay3Button.visible = false; acceptFriendButton.visible = false; eyesCounterText.visible = false; dialogueBox.visible = false; continueText.visible = false; if (mazeContainer) mazeContainer.visible = false; if (player) player.visible = false; } function returnToMenu() { gameState = "menu"; day2Unlocked = true; // Reset all variables currentDialogue = 0; currentEndingDialogue = 0; showYesButton = false; showGivePillsButton = false; pillAssetShown = false; abriendoSoundPlayed = false; // Show menu elements titleText.visible = true; playButton.visible = true; playDay2Button.visible = false; languageButton.visible = true; spanishButton.visible = false; englishButton.visible = false; updateLanguageTexts(); // Hide all other elements pinkcraiyon.visible = false; pinkcraiyon.alpha = 0; pillAsset.visible = false; pillAsset.alpha = 0; puertaRoja.visible = false; puertaRoja.alpha = 0; if (mazeContainer) mazeContainer.visible = false; if (player) player.visible = false; if (counterText) counterText.visible = false; } function initializeGame() { MAZE_WIDTH = Math.floor(1800 / CELL_SIZE); // Make maze smaller MAZE_HEIGHT = Math.floor(2582 / CELL_SIZE); // Reach bottom of screen (2732 - 150 offset) // Simple maze generation that ensures connectivity with longer walls maze = []; for (var y = 0; y < MAZE_HEIGHT; y++) { maze[y] = []; for (var x = 0; x < MAZE_WIDTH; x++) { // Create outer walls if (x === 0 || y === 0 || x === MAZE_WIDTH - 1 || y === MAZE_HEIGHT - 1) { maze[y][x] = 1; // wall } // Create longer L-shaped wall patterns (extended from 2-3 to 2-5 for longer walls) else if (x % 8 >= 2 && x % 8 <= 5 && y % 8 >= 2 && y % 8 <= 5 && Math.random() < 0.6) { maze[y][x] = 1; // Extended L-shaped walls } // Create longer horizontal wall segments else if (y % 6 === 2 && x % 8 >= 1 && x % 8 <= 6 && Math.random() < 0.5) { maze[y][x] = 1; // longer horizontal walls } // Create longer vertical wall segments else if (x % 6 === 2 && y % 8 >= 1 && y % 8 <= 6 && Math.random() < 0.5) { maze[y][x] = 1; // longer vertical walls } // Add some random walls but keep paths open else if (x % 4 === 0 && y % 4 === 0 && Math.random() < 0.3) { maze[y][x] = 1; // sparse additional walls } else { maze[y][x] = 0; // floor } } } // Ensure starting position and surrounding area is clear (larger area) for (var sy = 1; sy <= 4; sy++) { for (var sx = 1; sx <= 4; sx++) { maze[sy][sx] = 0; } } // Ensure exit area is clear (larger area) for (var ey = MAZE_HEIGHT - 5; ey < MAZE_HEIGHT - 1; ey++) { for (var ex = MAZE_WIDTH - 5; ex < MAZE_WIDTH - 1; ex++) { maze[ey][ex] = 0; } } // Create guaranteed horizontal paths every 6 rows for (var py = 3; py < MAZE_HEIGHT - 1; py += 6) { for (var px = 1; px < MAZE_WIDTH - 1; px++) { maze[py][px] = 0; } } // Create guaranteed vertical paths every 6 columns for (var px = 3; px < MAZE_WIDTH - 1; px += 6) { for (var py = 1; py < MAZE_HEIGHT - 1; py++) { maze[py][px] = 0; } } // Create maze visuals mazeContainer = game.addChild(new Container()); mazeContainer.y = 150; // Move maze down to avoid pause button for (var y = 0; y < MAZE_HEIGHT; y++) { for (var x = 0; x < MAZE_WIDTH; x++) { var cellX = x * CELL_SIZE; var cellY = y * CELL_SIZE; if (maze[y][x] === 1) { // Wall var wall = LK.getAsset('wall', { x: cellX, y: cellY }); mazeContainer.addChild(wall); } else { // Floor var floor = LK.getAsset('floor', { x: cellX, y: cellY }); mazeContainer.addChild(floor); } } } // Create door inside maze at bottom-right walkable area door = LK.getAsset('door', { x: (MAZE_WIDTH - 3) * CELL_SIZE, y: (MAZE_HEIGHT - 3) * CELL_SIZE, anchorX: 0, anchorY: 0 }); mazeContainer.addChild(door); // Create player at guaranteed walkable position player = game.addChild(new Player()); // Find first walkable position starting from top-left var playerStartX = CELL_SIZE + CELL_SIZE / 2; // Grid position 1,1 center var playerStartY = CELL_SIZE + CELL_SIZE / 2; // Grid position 1,1 center player.x = playerStartX; player.y = playerStartY + 150; // Adjust for maze container offset // Pills array and counter pills = []; pillsCollected = 0; totalPills = 10; // UI Counter counterText = new Text2(texts[currentLanguage].pills + ' 0/10', { size: 80, fill: 0xFFFFFF }); counterText.anchor.set(0.5, 0); LK.gui.top.addChild(counterText); // Spawn initial pills for (var i = 0; i < totalPills; i++) { var pillPos = getRandomWalkablePosition(); // Make sure pill is not too close to player start while (Math.abs(pillPos.x - CELL_SIZE / 2) < 128 && Math.abs(pillPos.y - CELL_SIZE / 2) < 128) { pillPos = getRandomWalkablePosition(); } var pill = game.addChild(new Pill()); pill.x = pillPos.x; pill.y = pillPos.y + 150; // Adjust for maze container offset pills.push(pill); } } // Game update loop game.update = function () { if (gameState === "forest") { // Keep forest background completely dark (no lighting effect on background) if (bosque && bosque.visible) { bosque.tint = 0x000000; } // Update rock visibility based on distance from mouse for (var i = 0; i < forestRocks.length; i++) { var rock = forestRocks[i]; if (rock) { var dx = mouseX - rock.x; var dy = mouseY - rock.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance < lightRadius) { // Inside light radius - make visible var brightness = 1 - distance / lightRadius; rock.tint = interpolateColor(0x000000, 0xffffff, brightness); rock.alpha = 1; } else { // Outside light radius - make dark rock.tint = 0x000000; rock.alpha = 1; } } } // Update worm visibility for (var i = 0; i < forestWorms.length; i++) { var worm = forestWorms[i]; if (worm) { var dx = mouseX - worm.x; var dy = mouseY - worm.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance < lightRadius) { var brightness = 1 - distance / lightRadius; worm.tint = interpolateColor(0x000000, 0xffffff, brightness); } else { worm.tint = 0x000000; } } } return; } if (gameState !== "game" || !player) return; if (isDay3 && eyes) { // Check eye collection for Day 3 for (var i = eyes.length - 1; i >= 0; i--) { var eye = eyes[i]; if (!eye.collected && player.intersects(eye)) { eye.collect(); eyesCollected++; // Update counter eyesCounterText.setText('OJOS RECOLECTADOS ' + eyesCollected + '/15'); // Remove from array eyes.splice(i, 1); } } // Check if all eyes collected if (eyesCollected >= requiredEyes) { showDay3Ending(); return; } } else if (pills) { // Check pill collection for Day 1 for (var i = pills.length - 1; i >= 0; i--) { var pill = pills[i]; if (!pill.collected && player.intersects(pill)) { pill.collect(); pillsCollected++; // Update counter counterText.setText(texts[currentLanguage].pills + ' ' + pillsCollected + '/' + totalPills); // Remove from array pills.splice(i, 1); } } // Check door collision only after collecting all pills if (pillsCollected >= totalPills) { var doorBounds = { x: (MAZE_WIDTH - 3) * CELL_SIZE, y: (MAZE_HEIGHT - 3) * CELL_SIZE + 150, width: CELL_SIZE, height: CELL_SIZE }; if (player.x >= doorBounds.x && player.x <= doorBounds.x + doorBounds.width && player.y >= doorBounds.y && player.y <= doorBounds.y + doorBounds.height) { startEndingDialogue(); return; } } } // Helper function to interpolate between two colors function interpolateColor(color1, color2, factor) { var r1 = color1 >> 16 & 0xFF; var g1 = color1 >> 8 & 0xFF; var b1 = color1 & 0xFF; var r2 = color2 >> 16 & 0xFF; var g2 = color2 >> 8 & 0xFF; var b2 = color2 & 0xFF; var r = Math.floor(r1 + factor * (r2 - r1)); var g = Math.floor(g1 + factor * (g2 - g1)); var b = Math.floor(b1 + factor * (b2 - b1)); return r << 16 | g << 8 | b; } };
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
var Eye = Container.expand(function () {
var self = Container.call(this);
var eyeGraphics = self.attachAsset('ojo', {
anchorX: 0.5,
anchorY: 0.5
});
self.collected = false;
self.collect = function () {
if (self.collected) return;
self.collected = true;
self.visible = false;
LK.getSound('collect').play();
};
return self;
});
var Pill = Container.expand(function () {
var self = Container.call(this);
var pillGraphics = self.attachAsset('pill', {
anchorX: 0.5,
anchorY: 0.5
});
self.collected = false;
self.collect = function () {
if (self.collected) return;
self.collected = true;
self.visible = false;
LK.getSound('collect').play();
};
return self;
});
var Player = Container.expand(function () {
var self = Container.call(this);
var playerGraphics = self.attachAsset('player', {
anchorX: 0.5,
anchorY: 0.5
});
self.targetX = 0;
self.targetY = 0;
self.isMoving = false;
self.moveToTarget = function (targetX, targetY) {
if (self.isMoving) return;
self.targetX = targetX;
self.targetY = targetY;
self.isMoving = true;
tween(self, {
x: targetX,
y: targetY
}, {
duration: 500,
easing: tween.easeOut,
onFinish: function onFinish() {
self.isMoving = false;
}
});
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000
});
/****
* Game Code
****/
// Language system
var currentLanguage = storage.language || 'spanish';
var texts = {
spanish: {
play: 'JUGAR',
playDay2: 'JUGAR DÍA 2',
playDay3: 'JUGAR DÍA 3',
playDay4: 'JUGAR DÍA 4',
language: 'LENGUAJE',
spanish: 'ESPAÑOL',
english: 'INGLES',
pills: 'PASTILLAS',
worms: 'LOMBRICES',
"continue": 'Haz CLICK en cualquier lugar para continuar',
yes: 'SI',
givePills: 'DAR PASTILLAS',
acceptForest: 'ACEPTAR IR AL BOSQUE',
giveWorms: 'DAR LOMBRICES',
endDay: 'presiona AQUÍ para terminar el día'
},
english: {
play: 'PLAY',
playDay2: 'PLAY DAY 2',
playDay3: 'PLAY DAY 3',
playDay4: 'PLAY DAY 4',
language: 'LANGUAGE',
spanish: 'SPANISH',
english: 'ENGLISH',
pills: 'PILLS',
worms: 'WORMS',
"continue": 'Click anywhere to continue',
yes: 'YES',
givePills: 'GIVE PILLS',
acceptForest: 'ACCEPT GO TO FOREST',
giveWorms: 'GIVE WORMS',
endDay: 'press HERE to end the day'
}
};
// Game state management
var gameState = "menu"; // "menu", "dialogue", "game", "ending", "language"
var currentDialogue = 0;
var dialogueTexts = {
spanish: ["Ahhh… qué sorpresa… un pequeño perdido en este lugar sin alma.\nMmm… qué olor más extraño tienes… ya sé de dónde vienes.", "¿Quieres salir, verdad? ¿Quieres encontrar la puerta que te lleve lejos de aquí? Je, je, je… Yo sé dónde está.\nSí… yo siempre lo sé.", "Pero nada es gratis, pequeño. Yo también necesito algo… unas píldoras. Mis dulces, mis tesoros…\nLas perdí, y sin ellas me siento… vacía. ¿Me ayudarás?", "oh..", "Eso está mejor… sabía que no me dirías que no, pequeño.\nMis píldoras… están dentro de la mansión que se levanta allá… la de cinco pisos que araña el cielo.", "No tengas miedo… no necesitas recorrerla toda.\nMis píldoras están en el primer piso, todas escondidas como pequeños ratones traviesos.", "Son diez en total. Diez. Ni una menos… ni una más.\nCuando las tengas todas… busca la puerta roja. Solo por ahí podrás salir…\nsi es que todavía quieres hacerlo.", "Ve, pequeño… la mansión te espera. Y yo… yo estaré observando."],
english: ["Ahhh... what a surprise... a little one lost in this soulless place.\nMmm... what a strange smell you have... I know where you come from.", "You want to leave, right? You want to find the door that takes you away from here? Heh, heh, heh... I know where it is.\nYes... I always know.", "But nothing is free, little one. I also need something... some pills. My sweets, my treasures...\nI lost them, and without them I feel... empty. Will you help me?", "oh..", "That's better... I knew you wouldn't say no to me, little one.\nMy pills... are inside the mansion that rises there... the five-story one that scrapes the sky.", "Don't be afraid... you don't need to go through it all.\nMy pills are on the first floor, all hidden like little mischievous mice.", "There are ten in total. Ten. Not one less... not one more.\nWhen you have them all... look for the red door. Only through there can you leave... if you still want to.", "Go, little one... the mansion awaits you. And I... I will be watching."]
};
var endingDialogueTexts = {
spanish: ["Ahhh… has vuelto, pequeño. Y veo que... sí... sí... puedo sentirlas.\n Mis dulces tesoros están contigo, ¿verdad?", "Dámelas... por favor... necesito sentir su dulzura en mis manos otra vez.", "Sí... sí... aquí están todas. Una... dos... tres... ¡Diez! Mis preciosas... cómo las extrañé...", "Gracias, pequeño... gracias por devolverme lo que más amo.\n Me siento... completa otra vez. El vacío se llena, la oscuridad se calma...", "Pero... pero hay algo que debo decirte. Algo que me duele confesar...", "Yo... yo te mentí, pequeño. La puerta roja... no te llevará a casa.\n No puedo decirte cómo salir de aquí porque... porque Ella nos observa.", "La Vigía del Umbral... siempre está mirando, siempre está escuchando. Si te dijera la verdad sobre la salida... \nsi te mostrara el camino real... Ella lo sabría. Y entonces... entonces nos castigaría a ambos.", "Perdóname, pequeño... perdóname por engañarte. Pero necesitaba mis píldoras... \ny tú... tú necesitabas una razón para seguir adelante, para no rendirte en este lugar maldito.", "La puerta roja... solo es el comienzo de otro laberinto. Pero tal vez...\n tal vez si eres lo suficientemente astuto... encontrarás tu propio camino.", "Ve ahora... antes de que Ella se dé cuenta de que hemos hablado demasiado.\n Y recuerda... en este lugar, la verdad es un lujo que pocos pueden permitirse.", "Adiós, pequeño valiente... que la suerte te acompañe en la oscuridad que te espera."],
english: ["Ahhh... you've returned, little one. And I see that... yes... yes... I can feel them.\n My sweet treasures are with you, aren't you?", "Give them to me... please... I need to feel their sweetness in my hands again.", "Yes... yes... here they all are. One... two... three... Ten! My precious ones... how I missed them...", "Thank you, little one... thank you for returning what I love most.\n I feel... complete again. The void is filled, the darkness calms...", "But... but there's something I must tell you. Something that hurts me to confess...", "I... I lied to you, little one. The red door... won't take you home.\n I can't tell you how to get out of here because... because She watches us.", "The Watcher of the Threshold... always looking, always listening. If I told you the truth about the exit... \nif I showed you the real way... She would know. And then... then she would punish us both.", "Forgive me, little one... forgive me for deceiving you. But I needed my pills... \nand you... you needed a reason to keep going, to not give up in this cursed place.", "The red door... is only the beginning of another labyrinth. But maybe...\n maybe if you're clever enough... you'll find your own way.", "Go now... before She realizes we've talked too much.\n And remember... in this place, truth is a luxury few can afford.", "Goodbye, brave little one... may luck accompany you in the darkness that awaits."]
};
// Day 2 dialogue texts
var day2DialogueTexts = {
spanish: ["¡Ah! ¡No... no te acerques más! ¡Espera... espera...! \nTú... tú eres... ¿eres real? ¿No eres una de... una de esas cosas que rondan por aquí?", "Por favor... por favor no me lastimes...\n yo... yo solo estaba escondido aquí... como siempre...", "Espera... te... te reconozco. Sí... sí, te vi. Te vi cruzar por esa puerta...\n esa maldita puerta que lleva años cerrada. Años y años...", "Fuiste... fuiste el primero en pasar por ahí en... en casi dos años.\n Dos largos y terribles años desde que alguien se atrevió a cruzarla.", "Caíste inconsciente... te... te vi caer como un saco al suelo. \nEstuviste ahí todo el día... y toda la noche también. Yo... yo quería ayudarte pero...\n pero tenía miedo. Siempre tengo miedo...", "Pensé... pensé que morirías ahí. Como los otros.\n Pero... pero aquí estás. De pie. Respirando.", "Escucha... escucha, por favor. Yo... yo necesito tu ayuda.\n Sé que... sé que acabas de despertar pero... pero no tengo a nadie más.", "Necesito... necesito ir al bosque. \nAl bosque oscuro que está más allá de los árboles retorcidos. \nHay... hay lombrices allí. Las necesito para... para sobrevivir.", "Pero yo... yo no puedo ir solo. Tengo demasiado miedo.\n Las sombras... las criaturas... los sonidos que hace el bosque por las noches...", "Por favor... por favor, ¿podrías ir tú?\n Solo... solo necesito unas cuantas lombrices. No muchas.\n Solo las suficientes para... para no morir de hambre.", "Yo... yo te esperaré aquí. Escondido. Siempre escondido.\n Si... si las traes, te... te daré algo a cambio. Algo que podría ayudarte en este lugar terrible.", "Por favor... di que sí. No... no me hagas ir solo al bosque. \nNo cuando las criaturas están más activas..."],
english: ["Ah! No... don't come any closer! Wait... wait...! You... you are... are you real? You're not one of... one of those things that roam around here?", "Please... please don't hurt me... I... I was just hiding here... as always...", "Wait... I... I recognize you. Yes... yes, I saw you. I saw you cross through that door... that damn door that's been closed for years. Years and years...", "You were... you were the first to pass through there in... in almost two years. Two long and terrible years since someone dared to cross it.", "You fell unconscious... I... I saw you fall like a sack to the ground. You were there all day... and all night too. I... I wanted to help you but... but I was afraid. I'm always afraid...", "I thought... I thought you would die there. Like the others. But... but here you are. Standing. Breathing.", "Listen... listen, please. I... I need your help. I know that... I know you just woke up but... but I have no one else.", "I need... I need to go to the forest. To the dark forest beyond the twisted trees. There are... there are worms there. I need them to... to survive.", "But I... I can't go alone. I'm too afraid. The shadows... the creatures... the sounds the forest makes at night...", "Please... please, could you go? Just... just need a few worms. Not many. Just enough to... to not die of hunger.", "I... I will wait here. Hidden. Always hidden. If... if you bring them, I... I will give you something in return. Something that could help you in this terrible place.", "Please... say yes. Don't... don't make me go alone to the forest. Not when the creatures are more active..."]
};
var day2PostAcceptTexts = {
spanish: ["¿De... de verdad? ¿De verdad dijiste que sí? Yo... yo no puedo creerlo.\n Nadie... nadie nunca me ayuda aquí.", "Gracias... gracias, extraño valiente. \nEres... eres más corajudo de lo que yo jamás seré.", "Escucha... escucha bien. El bosque está... está hacia el norte.\n Verás un sendero... un sendero que se adentra entre los árboles negros.\n Pero... pero ten cuidado.", "Las lombrices... están bajo los troncos caídos. Bajo las piedras húmedas. Busca... \nbusca en los lugares más oscuros y mojados. Ahí es donde se esconden.", "Solo... solo necesito cinco. Cinco lombrices grandes. \nPero... pero si puedes traer más... más sería mejor. \nNunca se sabe... nunca se sabe cuándo volveré a conseguir comida.", "Y por favor... por favor ten mucho cuidado con los Susurradores.\n Son... son criaturas que viven entre los árboles. \nParecen niños... pero no lo son. Sus voces... \nsus voces te llamarán por tu nombre aunque nunca se los hayas dicho.", "Si... si los escuchas, no les hagas caso. \nNo importa lo que digan... no importa si lloran o suplican. \nSolo... solo busca las lombrices y vuelve rápido.", "Yo... yo estaré aquí, temblando como siempre. \nContando cada segundo hasta que regreses. \nSi... si no vuelves antes del anochecer... sabré que... \nque las criaturas te atraparon.", "Pero... pero confío en ti. \nEres el primero en dos años que cruzó esa puerta y sobrevivió.\n Tienes... tienes algo especial.", "Ve ahora... ve antes de que pierda el valor\n y te suplique que no vayas. Mi estómago... \nmi estómago no puede esperar más.", "Y recuerda... cinco lombrices como mínimo.\n Solo... solo eso y podrás irte. \nTe... te prometo que te daré algo útil a cambio."],
english: ["Really? Did you really say yes? I... I can't believe it.\n Nobody... nobody ever helps me here.", "Thank you... thank you, brave stranger. \nYou are... you are braver than I could ever be.", "Listen... listen well. The forest is... is to the north.\n You'll see a path... a path that goes into the black trees.\n But... but be careful.", "The worms... are under fallen logs. Under wet stones. Look... \nlook in the darkest and wettest places. That's where they hide.", "Just... just need five. Five big worms. But... but if you can bring more... \nmore would be better. You never know... you never know when I'll get food again.", "And please... please be very careful with the Whisperers. They are... they are creatures that live among the trees. \nThey look like children... but they're not. Their voices... their voices will call you by name even though you never told them.", "If... if you hear them, ignore them. No matter what they say... no matter if they cry or beg. \nJust... just look for the worms and come back quickly.", "I... I will be here, trembling as always. Counting every second until you return. \nIf... if you don't come back before nightfall... I'll know that... that the creatures got you.", "But... but I trust you. You're the first in two years to cross that door and survive.\n You have... you have something special.", "Go now... go before I lose courage and beg you not to go. My stomach... \nmy stomach can't wait any longer.", "And remember... five worms minimum. Just... just that and you can go. \nI... I promise I'll give you something useful in return."]
};
var day2ReturnTexts = {
spanish: ["¡Ah! ¡Has... has vuelto! Yo... yo estaba tan asustado.\nPensé... pensé que no regresarías nunca.", "¿Las... las conseguiste? Por favor... por favor dime que las conseguiste.\nHe estado temblando aquí todo este tiempo... imaginando lo peor.", "¿Cinco? ¿De verdad trajiste cinco? Yo... yo no puedo creerlo.\nNadie... nadie había hecho algo así por mí en tanto tiempo.", "Por favor... por favor dámelas. Mi estómago...\nlleva días vacío. Siento que... que me voy a desmayar del hambre."],
english: ["Ah! You... you're back! I... I was so scared. \nI thought... I thought you would never return.", "Did you... did you get them? Please... please tell me you got them.\nI've been trembling here all this time... imagining the worst.", "Five? Did you really bring five? I... I can't believe it. \nNobody... nobody had done something like this for me in so long.", "Please... please give them to me. My stomach...\nhas been empty for days. I feel like... like I'm going to faint from hunger."]
};
var day2PostGiveTexts = {
spanish: ["Sí... sí... aquí están. Una... dos... tres... cuatro... ¡cinco!\nTodas gordas y jugosas. Perfecto... perfecto.", "Gracias... gracias, extraño bondadoso. No sabes...\nno sabes lo que esto significa para alguien como yo.\nAlguien que siempre tiene miedo... que siempre se esconde.", "Te... te prometí algo a cambio, ¿verdad? Sí... sí, lo prometí.\nY yo... yo siempre cumplo mis promesas, aunque tiemble al hacerlo.", "Toma esto... es... es una linterna. Pero no es una linterna común.\nEsta... esta puede ahuyentar a las criaturas pequeñas. Las sombras menores huyen de su luz.", "No... no funcionará contra las cosas grandes y terribles,\npero... pero te ayudará en la oscuridad.\nTe mantendrá a salvo de los susurros y de las cosas que se arrastran.", "Y... y hay algo más que debo decirte.\nAlgo que vi mientras estabas en el bosque...", "Vi a La Vigía del Umbral... paseándose por aquí.\nEstaba... estaba buscando algo. O a alguien. Creo... creo que sabe que estás aquí.", "Ten cuidado... ten mucho cuidado. Cuando Ella busca a alguien...\nsignifica que algo va a cambiar. Y los cambios aquí... nunca son buenos.", "Ahora... ahora debo esconderme otra vez.\nComer mis lombrices en silencio y esperar... siempre esperar.", "por cierto, me llamo Havran.", "Gracias otra vez, valiente extraño.\nQue... que la suerte te proteja de lo que viene."],
english: ["Yes... yes... here they are. One... two... three... four... five!\nAll fat and juicy. Perfect... perfect.", "Thank you... thank you, kind stranger. You don't know...\nyou don't know what this means to someone like me. \nSomeone who's always afraid... who always hides.", "I... I promised you something in return, right? Yes... yes, I promised.\nAnd I... I always keep my promises, even if I tremble doing it.", "Take this... it's... it's a flashlight. But it's not a common flashlight. \nThis... this can scare away small creatures. Minor shadows flee from its light.", "No... it won't work against big and terrible things,\nbut... but it will help you in the darkness. \nIt will keep you safe from whispers and crawling things.", "And... and there's something else I must tell you. \nSomething I saw while you were in the forest...", "I saw The Watcher of the Threshold... walking around here.\nShe was... she was looking for something. Or someone. I think... I think she knows you're here.", "Be careful... be very careful. When She looks for someone...\nit means something is going to change. And changes here... are never good.", "Now... now I must hide again.\nEat my worms in silence and wait... always wait.", "by the way, my name is Havran.", "Thank you again, brave stranger. \nMay... may luck protect you from what's coming."]
};
var day2EndText = {
spanish: "Te quedaste allí, en el frío suelo de ese extraño lugar.\nNo había manta ni refugio, solo la dureza de la piedra bajo tu cuerpo cansado.\nIntentaste moverte un poco, buscando una posición menos dura,\npero la incomodidad era inevitable.\nRespiraste hondo, intentando engañar al frío que se filtraba por cada rincón,\ny aunque sabías que ese no era un sitio para dormir, los párpados pesaban demasiado.\nTe abrazaste a ti mismo, buscaste un poco de calor en tu propia soledad, y poco a poco fuiste cediendo.\nEl silencio te envolvió, y la penumbra pareció observar cómo,\nvencido por el cansancio, cerrabas los ojos en aquel lugar desconocido,\nconfiando en que el amanecer traería algo distinto… Si es que siquiera existía un amanecer.",
english: "You stayed there, on the cold ground of that strange place. \nThere was no blanket or shelter, just the hardness of stone under your tired body.\nYou tried to move a little, looking for a less hard position,\n but discomfort was inevitable.\nYou breathed deeply, trying to fool the cold that seeped through every corner,\n and although you knew that wasn't a place to sleep, your eyelids were too heavy.\nYou hugged yourself, looked for a little warmth in your own solitude, and little by little you gave in.\n Silence enveloped you, and the gloom seemed to watch how,\n overcome by fatigue, you closed your eyes in that unknown place, \ntrusting that dawn would bring something different… If dawn even existed."
};
// Day 3 intro text
var day3IntroText = {
spanish: "Despertaste al día siguiente… pero la noche seguía allí, intacta, como si el tiempo se hubiera negado a avanzar.\nNo había amanecer, no había pájaros, solo la misma penumbra quieta que te había visto dormir.\nTe incorporaste lentamente, con el cuerpo entumecido por el frío del suelo.\nDecidiste caminar, mover las piernas para no quedarte atrapado en la inmovilidad de ese lugar extraño.\nEn un momento apareció una silueta. No era hostil, no parecía una amenaza…\nal contrario, tenía esa mirada que reconoce la soledad en otro.\nTe encontraste con un nuevo amigo.",
english: "You woke up the next day... but the night was still there, intact, as if time had refused to move forward.\nThere was no dawn, no birds, only the same quiet gloom that had watched you sleep.\nYou sat up slowly, your body numb from the cold ground.\nYou decided to walk, move your legs so you wouldn't get trapped in the immobility of that strange place.\nAt one moment a silhouette appeared. It wasn't hostile, it didn't seem like a threat...\non the contrary, it had that look that recognizes loneliness in another.\nYou met a new friend."
};
// Day 3 kid dialogue texts
var day3KidDialogues = {
spanish: ["… ¿quieres ser mi amigo?", "Entonces, desde ahora, tú serás *mi nuevo amigo*.", "El sol ha muerto… por eso aquí nunca amanece. Solo queda la noche. Pero podemos traerlo de vuelta.\nLos pedazos del sol se dispersaron en seis mundos…\ny uno de ellos está aquí, en este lugar al que llamas mundo dos.", "Pero antes… debo saber si eres capaz.\nTu... Mi nuevo amigo... tendrás que superar una prueba.", "Estarás dentro de un laberinto, encontrarás quince ojos extraídos de bebes fallecidos,\nbebes que alguna vez soñaron con ver el amanecer pero la vida les tenia preparado otro destino.\nSolo reuniéndolos todos podrás demostrar que eres digno de continuar.", "Cuando tengas los quince, yo mismo te guiaré al mundo tres… Mi nuevo amigo."],
english: ["… do you want to be my friend?", "Then, from now on, you will be *my new friend*.", "The sun has died... that's why it never dawns here. Only night remains. But we can bring it back.\nThe pieces of the sun scattered in six worlds...\nand one of them is here, in this place you call world two.", "But first... I must know if you are capable.\nYou... My new friend... will have to overcome a test.", "You will be inside a labyrinth, you will find fifteen eyes extracted from deceased babies,\nbabies who once dreamed of seeing the dawn but life had another destiny prepared for them.\nOnly by gathering them all can you prove that you are worthy to continue.", "When you have all fifteen, I myself will guide you to world three... My new friend."]
};
// Day 3 ending text
var day3EndingText = {
spanish: "Cuando por fin el último estuvo en tus manos, el silencio se hizo absoluto.\nEl aire dejó de moverse. El suelo, ese mismo que había soportado tus pasos inseguros,\ncomenzó a desvanecerse como arena negra arrastrada por un viento invisible.\nSentiste que caías, que todo tu cuerpo se entregaba a un abismo sin fin.\nFue entonces cuando una voz, desconocida y profunda,\nhabló desde todas partes y desde ninguna:\n\n\"Has superado la prueba. Eres más fuerte de lo que parecía…\nmi felicitación es tu pase hacia lo que sigue.\"\n\nLas palabras retumbaron en tu mente, y aunque sonaban como un premio, no traían alivio,\nsino un escalofrío inevitable. La oscuridad te envolvió por completo,\ny con ella llegó la certeza de que el viaje aún no había hecho más que empezar.\n\nAhora temes al mundo al que serás arrojado.\nNo sabes qué encontrarás al abrir los ojos otra vez: si criaturas que nunca has visto,\nsi un paisaje imposible, o si algo aún peor, aguardando tu llegada.\nLo único seguro es que el próximo mundo ya te espera…\ny que no tendrás opción más que caminar en él.",
english: "When the last one was finally in your hands, silence became absolute.\nThe air stopped moving. The ground, the same one that had supported your uncertain steps,\nbegan to fade like black sand carried by an invisible wind.\nYou felt yourself falling, your whole body surrendering to an endless abyss.\nIt was then when a voice, unknown and deep,\nspoke from everywhere and from nowhere:\n\n\"You have passed the test. You are stronger than you seemed...\nmy congratulations are your pass to what follows.\"\n\nThe words echoed in your mind, and although they sounded like a prize, they brought no relief,\nbut an inevitable chill. Darkness enveloped you completely,\nand with it came the certainty that the journey had only just begun.\n\nNow you fear the world you will be thrown into.\nYou don't know what you'll find when you open your eyes again: if creatures you've never seen,\nif an impossible landscape, or if something even worse, awaiting your arrival.\nThe only certainty is that the next world is already waiting for you...\nand that you will have no choice but to walk in it."
};
var currentEndingDialogue = 0;
var showYesButton = false;
var showGivePillsButton = false;
var pillAssetShown = false;
var day2Unlocked = false;
var day3Unlocked = false;
var day4Unlocked = false;
var abriendoSoundPlayed = false;
var currentDay2Dialogue = 0;
var showAcceptForestButton = false;
var showGiveWormsButton = false;
var isDay2 = false;
var isDay3 = false;
var inForest = false;
var wormsCollected = 0;
var requiredWorms = 5;
var forestRocks = [];
var forestWorms = [];
var lightRadius = 150;
var currentDay2State = "dialogue"; // "dialogue", "forest", "return", "final"
var currentDay3State = "intro"; // "intro", "dialogue", "maze", "ending"
var currentDay3Dialogue = 0;
var showAcceptFriendButton = false;
var eyesCollected = 0;
var requiredEyes = 15;
var eyes = [];
var CELL_SIZE = 64;
// Mouse position tracking for forest lighting
var mouseX = 0;
var mouseY = 0;
// Menu UI Elements
var titleText = LK.getAsset('TITULO', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 600,
scaleX: 8,
scaleY: 8
});
game.addChild(titleText);
var playButton = new Text2(texts[currentLanguage].play, {
size: 80,
fill: 0x4a90e2
});
playButton.anchor.set(0.5, 0.5);
playButton.x = 1024;
playButton.y = 1000;
game.addChild(playButton);
// Day 2 play button
var playDay2Button = new Text2(texts[currentLanguage].playDay2, {
size: 80,
fill: 0x4a90e2
});
playDay2Button.anchor.set(0.5, 0.5);
playDay2Button.x = 1024;
playDay2Button.y = 1000;
playDay2Button.visible = false;
game.addChild(playDay2Button);
var languageButton = new Text2(texts[currentLanguage].language, {
size: 60,
fill: 0x4a90e2
});
languageButton.anchor.set(0.5, 0.5);
languageButton.x = 1024;
languageButton.y = 1150;
game.addChild(languageButton);
// Language selection buttons (initially hidden)
var spanishButton = new Text2(texts[currentLanguage].spanish, {
size: 60,
fill: 0x4a90e2
});
spanishButton.anchor.set(0.5, 0.5);
spanishButton.x = 1024;
spanishButton.y = 1250;
spanishButton.visible = false;
game.addChild(spanishButton);
var englishButton = new Text2(texts[currentLanguage].english, {
size: 60,
fill: 0x4a90e2
});
englishButton.anchor.set(0.5, 0.5);
englishButton.x = 1024;
englishButton.y = 1350;
englishButton.visible = false;
game.addChild(englishButton);
// Character sprite (initially hidden)
var pinkcraiyon = LK.getAsset('Pinkcraiyon', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 800,
scaleX: 2,
scaleY: 2
});
pinkcraiyon.alpha = 0;
game.addChild(pinkcraiyon);
// Havran character sprite (initially hidden)
var havran = LK.getAsset('Havran', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 800,
scaleX: 4,
scaleY: 4
});
havran.alpha = 0;
game.addChild(havran);
// Forest background (initially hidden)
var bosque = LK.getAsset('bosque', {
anchorX: 0,
anchorY: 0,
x: 0,
y: 0,
scaleX: 20.48,
scaleY: 18.24
});
bosque.alpha = 0;
game.addChild(bosque);
// Lantern asset (initially hidden)
var linterna = LK.getAsset('linterna', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 800,
scaleX: 8,
scaleY: 8
});
linterna.alpha = 0;
game.addChild(linterna);
// Kid character sprite (initially hidden)
var kid = LK.getAsset('kid', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 800,
scaleX: 8,
scaleY: 8
});
kid.alpha = 0;
game.addChild(kid);
// Dialogue UI
var dialogueBox = new Text2('', {
size: 35,
fill: 0xffffff
});
dialogueBox.anchor.set(0.5, 0.5);
dialogueBox.x = 1024;
dialogueBox.y = 1800;
dialogueBox.visible = false;
game.addChild(dialogueBox);
var continueText = new Text2(texts[currentLanguage]["continue"], {
size: 28,
fill: 0xcccccc
});
continueText.anchor.set(0.5, 0.5);
continueText.x = 1024;
continueText.y = 2200;
continueText.visible = false;
game.addChild(continueText);
var yesButton = new Text2(texts[currentLanguage].yes, {
size: 60,
fill: 0x4a90e2
});
yesButton.anchor.set(0.5, 0.5);
yesButton.x = 1024;
yesButton.y = 2000;
yesButton.visible = false;
game.addChild(yesButton);
var givePillsButton = new Text2(texts[currentLanguage].givePills, {
size: 60,
fill: 0x4a90e2
});
givePillsButton.anchor.set(0.5, 0.5);
givePillsButton.x = 1024;
givePillsButton.y = 2000;
givePillsButton.visible = false;
game.addChild(givePillsButton);
var acceptForestButton = new Text2(texts[currentLanguage].acceptForest, {
size: 50,
fill: 0x4a90e2
});
acceptForestButton.anchor.set(0.5, 0.5);
acceptForestButton.x = 1024;
acceptForestButton.y = 2000;
acceptForestButton.visible = false;
game.addChild(acceptForestButton);
var giveWormsButton = new Text2(texts[currentLanguage].giveWorms, {
size: 60,
fill: 0x4a90e2
});
giveWormsButton.anchor.set(0.5, 0.5);
giveWormsButton.x = 1024;
giveWormsButton.y = 2000;
giveWormsButton.visible = false;
game.addChild(giveWormsButton);
var endDayButton = new Text2(texts[currentLanguage].endDay, {
size: 50,
fill: 0x4a90e2
});
endDayButton.anchor.set(0.5, 0.5);
endDayButton.x = 1024;
endDayButton.y = 2400;
endDayButton.visible = false;
game.addChild(endDayButton);
var acceptFriendButton = new Text2('ACEPTAR SER SU AMIGO', {
size: 50,
fill: 0x4a90e2
});
acceptFriendButton.anchor.set(0.5, 0.5);
acceptFriendButton.x = 1024;
acceptFriendButton.y = 2000;
acceptFriendButton.visible = false;
game.addChild(acceptFriendButton);
var continueDay3Button = new Text2('presiona AQUÍ para continuar', {
size: 50,
fill: 0x4a90e2
});
continueDay3Button.anchor.set(0.5, 0.5);
continueDay3Button.x = 1024;
continueDay3Button.y = 2400;
continueDay3Button.visible = false;
game.addChild(continueDay3Button);
var eyesCounterText = new Text2('', {
size: 80,
fill: 0xFFFFFF
});
eyesCounterText.anchor.set(0.5, 0);
eyesCounterText.visible = false;
LK.gui.top.addChild(eyesCounterText);
var wormsCounterText = new Text2('', {
size: 80,
fill: 0xFFFFFF
});
wormsCounterText.anchor.set(0.5, 0);
wormsCounterText.visible = false;
LK.gui.top.addChild(wormsCounterText);
var endingText = new Text2('', {
size: 35,
fill: 0xffffff
});
endingText.anchor.set(0.5, 0.5);
endingText.x = 1024;
endingText.y = 1366;
endingText.visible = false;
game.addChild(endingText);
// Pill asset for ending sequence
var pillAsset = LK.getAsset('pill', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 800,
scaleX: 15,
scaleY: 15
});
pillAsset.alpha = 0;
game.addChild(pillAsset);
// Red door asset for final sequence
var puertaRoja = LK.getAsset('puertaroja', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1366,
scaleX: 0.5,
scaleY: 0.5
});
puertaRoja.alpha = 0;
game.addChild(puertaRoja);
// Game variables (will be initialized when starting game)
var MAZE_WIDTH, MAZE_HEIGHT, maze, mazeContainer, player, pills, pillsCollected, totalPills, counterText, door;
// Function to update all UI texts with current language
function updateLanguageTexts() {
if (day4Unlocked) {
playButton.setText(texts[currentLanguage].playDay4);
playButton.visible = true;
playDay2Button.visible = false;
} else if (day3Unlocked) {
playButton.setText(texts[currentLanguage].playDay3);
playButton.visible = true;
playDay2Button.visible = false;
} else if (day2Unlocked) {
playButton.visible = false;
playDay2Button.setText(texts[currentLanguage].playDay2);
playDay2Button.visible = true;
} else {
playButton.setText(texts[currentLanguage].play);
playButton.visible = true;
playDay2Button.visible = false;
}
languageButton.setText(texts[currentLanguage].language);
spanishButton.setText(texts[currentLanguage].spanish);
englishButton.setText(texts[currentLanguage].english);
continueText.setText(texts[currentLanguage]["continue"]);
yesButton.setText(texts[currentLanguage].yes);
givePillsButton.setText(texts[currentLanguage].givePills);
acceptForestButton.setText(texts[currentLanguage].acceptForest);
giveWormsButton.setText(texts[currentLanguage].giveWorms);
endDayButton.setText(texts[currentLanguage].endDay);
if (counterText) {
counterText.setText(texts[currentLanguage].pills + ' ' + pillsCollected + '/' + totalPills);
}
if (wormsCounterText && inForest) {
wormsCounterText.setText(texts[currentLanguage].worms + ' ' + wormsCollected + '/' + requiredWorms);
}
if (eyesCounterText && isDay3 && gameState === "game") {
eyesCounterText.setText('OJOS RECOLECTADOS ' + eyesCollected + '/15');
}
}
// Function to check if a position is walkable
function isWalkable(x, y) {
var gridX = Math.floor(x / CELL_SIZE);
var gridY = Math.floor(y / CELL_SIZE);
if (gridX < 0 || gridX >= MAZE_WIDTH || gridY < 0 || gridY >= MAZE_HEIGHT) {
return false;
}
return maze[gridY][gridX] === 0;
}
// Function to check if path between two points is clear
function hasPathTo(fromX, fromY, toX, toY) {
var fromGridX = Math.floor(fromX / CELL_SIZE);
var fromGridY = Math.floor(fromY / CELL_SIZE);
var toGridX = Math.floor(toX / CELL_SIZE);
var toGridY = Math.floor(toY / CELL_SIZE);
// Simple line-of-sight check
var dx = Math.abs(toGridX - fromGridX);
var dy = Math.abs(toGridY - fromGridY);
var stepX = fromGridX < toGridX ? 1 : -1;
var stepY = fromGridY < toGridY ? 1 : -1;
var err = dx - dy;
var currentX = fromGridX;
var currentY = fromGridY;
while (true) {
if (currentX < 0 || currentX >= MAZE_WIDTH || currentY < 0 || currentY >= MAZE_HEIGHT) {
return false;
}
if (maze[currentY][currentX] === 1) {
return false;
}
if (currentX === toGridX && currentY === toGridY) {
return true;
}
var e2 = 2 * err;
if (e2 > -dy) {
err -= dy;
currentX += stepX;
}
if (e2 < dx) {
err += dx;
currentY += stepY;
}
}
}
// Function to get random walkable position
function getRandomWalkablePosition() {
var attempts = 0;
while (attempts < 100) {
var x = Math.floor(Math.random() * MAZE_WIDTH);
var y = Math.floor(Math.random() * MAZE_HEIGHT);
if (maze[y][x] === 0) {
return {
x: x * CELL_SIZE + CELL_SIZE / 2,
y: y * CELL_SIZE + CELL_SIZE / 2
};
}
attempts++;
}
// Fallback to player starting position
return {
x: CELL_SIZE / 2,
y: CELL_SIZE / 2
};
}
// Spawn initial pills
for (var i = 0; i < totalPills; i++) {
var pillPos = getRandomWalkablePosition();
// Make sure pill is not too close to player start
while (Math.abs(pillPos.x - CELL_SIZE / 2) < 128 && Math.abs(pillPos.y - CELL_SIZE / 2) < 128) {
pillPos = getRandomWalkablePosition();
}
var pill = game.addChild(new Pill());
pill.x = pillPos.x;
pill.y = pillPos.y + 150; // Adjust for maze container offset
pills.push(pill);
}
// Game move handler for mouse tracking
game.move = function (x, y, obj) {
mouseX = x;
mouseY = y;
};
// Game click handler
game.down = function (x, y, obj) {
if (gameState === "menu") {
// Check if play button was clicked
if (playButton.visible && x >= playButton.x - 100 && x <= playButton.x + 100 && y >= playButton.y - 50 && y <= playButton.y + 50) {
if (day3Unlocked) {
startDay3();
} else {
startDialogue();
}
}
// Check if play Day 2 button was clicked
else if (playDay2Button.visible && x >= playDay2Button.x - 100 && x <= playDay2Button.x + 100 && y >= playDay2Button.y - 50 && y <= playDay2Button.y + 50) {
startDay2Dialogue();
}
// Check if language button was clicked
else if (x >= languageButton.x - 120 && x <= languageButton.x + 120 && y >= languageButton.y - 50 && y <= languageButton.y + 50) {
gameState = "language";
spanishButton.visible = true;
englishButton.visible = true;
}
} else if (gameState === "day3") {
if (currentDay3State === "intro") {
// Check if continue button was clicked
if (continueDay3Button.visible && x >= continueDay3Button.x - 150 && x <= continueDay3Button.x + 150 && y >= continueDay3Button.y - 30 && y <= continueDay3Button.y + 30) {
startDay3Dialogue();
}
} else if (currentDay3State === "dialogue") {
if (showAcceptFriendButton && acceptFriendButton.visible) {
// Check if accept friend button was clicked
if (x >= acceptFriendButton.x - 150 && x <= acceptFriendButton.x + 150 && y >= acceptFriendButton.y - 30 && y <= acceptFriendButton.y + 30) {
showAcceptFriendButton = false;
acceptFriendButton.visible = false;
continueText.visible = true;
currentDay3Dialogue++;
if (currentDay3Dialogue < day3KidDialogues[currentLanguage].length) {
dialogueBox.setText(day3KidDialogues[currentLanguage][currentDay3Dialogue]);
}
}
} else {
// Continue dialogue
currentDay3Dialogue++;
if (currentDay3Dialogue === 1) {
// Show accept friend button after first dialogue
showAcceptFriendButton = true;
acceptFriendButton.visible = true;
continueText.visible = false;
} else if (currentDay3Dialogue >= day3KidDialogues[currentLanguage].length) {
// Start the maze game
startDay3Maze();
} else {
dialogueBox.setText(day3KidDialogues[currentLanguage][currentDay3Dialogue]);
}
}
} else if (currentDay3State === "ending") {
// Check if end day button was clicked
if (endDayButton.visible && x >= endDayButton.x - 150 && x <= endDayButton.x + 150 && y >= endDayButton.y - 30 && y <= endDayButton.y + 30) {
returnToMenuDay4();
}
}
} else if (gameState === "day2") {
if (showAcceptForestButton && acceptForestButton.visible) {
// Check if accept forest button was clicked
if (x >= acceptForestButton.x - 150 && x <= acceptForestButton.x + 150 && y >= acceptForestButton.y - 30 && y <= acceptForestButton.y + 30) {
showAcceptForestButton = false;
acceptForestButton.visible = false;
continueText.visible = true;
currentDay2State = "postAccept";
currentDay2Dialogue = 0;
dialogueBox.setText(day2PostAcceptTexts[currentLanguage][currentDay2Dialogue]);
}
} else if (showGiveWormsButton && giveWormsButton.visible) {
// Check if give worms button was clicked
if (x >= giveWormsButton.x - 120 && x <= giveWormsButton.x + 120 && y >= giveWormsButton.y - 30 && y <= giveWormsButton.y + 30) {
showGiveWormsButton = false;
giveWormsButton.visible = false;
continueText.visible = true;
currentDay2State = "final";
currentDay2Dialogue = 0;
dialogueBox.setText(day2PostGiveTexts[currentLanguage][currentDay2Dialogue]);
}
} else if (endDayButton.visible) {
// Check if end day button was clicked
if (x >= endDayButton.x - 150 && x <= endDayButton.x + 150 && y >= endDayButton.y - 30 && y <= endDayButton.y + 30) {
returnToMenuDay3();
}
} else {
// Continue Day 2 dialogue
if (currentDay2State === "dialogue") {
currentDay2Dialogue++;
if (currentDay2Dialogue === day2DialogueTexts[currentLanguage].length) {
// Show accept forest button
showAcceptForestButton = true;
acceptForestButton.visible = true;
continueText.visible = false;
currentDay2Dialogue = 0;
} else {
dialogueBox.setText(day2DialogueTexts[currentLanguage][currentDay2Dialogue]);
}
} else if (currentDay2State === "postAccept") {
currentDay2Dialogue++;
if (currentDay2Dialogue >= day2PostAcceptTexts[currentLanguage].length) {
// Start forest sequence
startForestSequence();
} else {
dialogueBox.setText(day2PostAcceptTexts[currentLanguage][currentDay2Dialogue]);
}
} else if (currentDay2State === "return") {
currentDay2Dialogue++;
if (currentDay2Dialogue === day2ReturnTexts[currentLanguage].length) {
// Show give worms button
showGiveWormsButton = true;
giveWormsButton.visible = true;
continueText.visible = false;
currentDay2Dialogue = 0;
} else {
dialogueBox.setText(day2ReturnTexts[currentLanguage][currentDay2Dialogue]);
}
} else if (currentDay2State === "final") {
currentDay2Dialogue++;
if (currentDay2Dialogue === 3) {
// Show lantern
showLantern();
dialogueBox.setText(day2PostGiveTexts[currentLanguage][currentDay2Dialogue]);
} else if (currentDay2Dialogue === 5) {
// Hide lantern, show Havran again
hideLantern();
dialogueBox.setText(day2PostGiveTexts[currentLanguage][currentDay2Dialogue]);
} else if (currentDay2Dialogue >= day2PostGiveTexts[currentLanguage].length) {
// Show ending text and button
showDay2Ending();
} else {
dialogueBox.setText(day2PostGiveTexts[currentLanguage][currentDay2Dialogue]);
}
}
}
} else if (gameState === "forest") {
// Handle forest rock clicking
handleForestClick(x, y);
} else if (gameState === "language") {
// Check if Spanish button was clicked
if (x >= spanishButton.x - 100 && x <= spanishButton.x + 100 && y >= spanishButton.y - 50 && y <= spanishButton.y + 50) {
currentLanguage = 'spanish';
storage.language = currentLanguage;
gameState = "menu";
spanishButton.visible = false;
englishButton.visible = false;
updateLanguageTexts();
}
// Check if English button was clicked
else if (x >= englishButton.x - 100 && x <= englishButton.x + 100 && y >= englishButton.y - 50 && y <= englishButton.y + 50) {
currentLanguage = 'english';
storage.language = currentLanguage;
gameState = "menu";
spanishButton.visible = false;
englishButton.visible = false;
updateLanguageTexts();
}
} else if (gameState === "dialogue") {
if (showYesButton && yesButton.visible) {
// Check if yes button was clicked
if (x >= yesButton.x - 50 && x <= yesButton.x + 50 && y >= yesButton.y - 30 && y <= yesButton.y + 30) {
showYesButton = false;
yesButton.visible = false;
continueText.visible = true;
currentDialogue++;
if (currentDialogue < dialogueTexts[currentLanguage].length) {
dialogueBox.setText(dialogueTexts[currentLanguage][currentDialogue]);
}
}
} else {
// Continue dialogue
currentDialogue++;
if (currentDialogue === 3) {
// Show YES button after third dialogue
showYesButton = true;
yesButton.visible = true;
continueText.visible = false;
} else if (currentDialogue >= dialogueTexts[currentLanguage].length) {
// Start the game
startGame();
} else {
dialogueBox.setText(dialogueTexts[currentLanguage][currentDialogue]);
}
}
} else if (gameState === "ending") {
if (showGivePillsButton && givePillsButton.visible) {
// Check if give pills button was clicked
if (x >= givePillsButton.x - 120 && x <= givePillsButton.x + 120 && y >= givePillsButton.y - 30 && y <= givePillsButton.y + 30) {
showGivePillsButton = false;
givePillsButton.visible = false;
continueText.visible = true;
currentEndingDialogue++;
dialogueBox.setText(endingDialogueTexts[currentLanguage][currentEndingDialogue]);
}
} else {
// Continue ending dialogue
currentEndingDialogue++;
if (currentEndingDialogue === 2) {
// Show give pills button after second dialogue
showGivePillsButton = true;
givePillsButton.visible = true;
continueText.visible = false;
} else if (currentEndingDialogue === 3) {
dialogueBox.setText(endingDialogueTexts[currentLanguage][currentEndingDialogue]);
} else if (currentEndingDialogue >= endingDialogueTexts[currentLanguage].length) {
// End sequence with door animation
startEndingSequence();
} else {
dialogueBox.setText(endingDialogueTexts[currentLanguage][currentEndingDialogue]);
}
}
} else if (gameState === "game") {
if (player.isMoving) return;
// Adjust for maze container offset
var adjustedY = y - 150;
var adjustedPlayerY = player.y - 150;
// Check if target position is walkable and path is clear
if (isWalkable(x, adjustedY) && hasPathTo(player.x, adjustedPlayerY, x, adjustedY)) {
// Snap to grid center
var gridX = Math.floor(x / CELL_SIZE);
var gridY = Math.floor(adjustedY / CELL_SIZE);
var targetX = gridX * CELL_SIZE + CELL_SIZE / 2;
var targetY = gridY * CELL_SIZE + CELL_SIZE / 2 + 150; // Add offset back
player.moveToTarget(targetX, targetY);
}
}
};
function startDialogue() {
gameState = "dialogue";
titleText.visible = false;
playButton.visible = false;
languageButton.visible = false;
// Fade in Pinkcraiyon
tween(pinkcraiyon, {
alpha: 1
}, {
duration: 1000,
easing: tween.easeOut,
onFinish: function onFinish() {
// Show first dialogue
dialogueBox.visible = true;
continueText.visible = true;
dialogueBox.setText(dialogueTexts[currentLanguage][currentDialogue]);
}
});
}
function startGame() {
gameState = "game";
// Hide dialogue elements
pinkcraiyon.visible = false;
dialogueBox.visible = false;
continueText.visible = false;
initializeGame();
}
function startEndingDialogue() {
gameState = "ending";
currentEndingDialogue = 0;
// Hide game elements
if (mazeContainer) mazeContainer.visible = false;
if (player) player.visible = false;
if (counterText) counterText.visible = false;
// Hide all pills
for (var i = 0; i < pills.length; i++) {
pills[i].visible = false;
}
// Show dialogue elements
game.setBackgroundColor(0x000000);
dialogueBox.visible = true;
continueText.visible = true;
// Fade in Pinkcraiyon
tween(pinkcraiyon, {
alpha: 1
}, {
duration: 1000,
easing: tween.easeOut,
onFinish: function onFinish() {
pinkcraiyon.visible = true;
dialogueBox.setText(endingDialogueTexts[currentLanguage][currentEndingDialogue]);
}
});
}
function startEndingSequence() {
// Hide dialogue elements first
dialogueBox.visible = false;
continueText.visible = false;
// Fade out Pinkcraiyon
tween(pinkcraiyon, {
alpha: 0
}, {
duration: 1000,
onFinish: function onFinish() {
// After Pinkcraiyon fades out, show and animate puerta roja
puertaRoja.visible = true;
puertaRoja.scaleX = 0.5;
puertaRoja.scaleY = 0.5;
tween(puertaRoja, {
alpha: 1,
scaleX: 8,
scaleY: 8
}, {
duration: 12000,
easing: tween.easeOut,
onFinish: function onFinish() {
// Play opening sound only once
if (!abriendoSoundPlayed) {
LK.getSound('abriendo').play();
abriendoSoundPlayed = true;
}
// Wait for sound to finish, then fade out door and show black background
LK.setTimeout(function () {
tween(puertaRoja, {
alpha: 0
}, {
duration: 1000,
onFinish: function onFinish() {
// After door fades out and black background is shown, return to menu
returnToMenu();
}
});
}, 3000); // Wait 3 seconds for sound to finish
}
});
}
});
}
function startDay2Dialogue() {
gameState = "day2";
isDay2 = true;
currentDay2State = "dialogue";
currentDay2Dialogue = 0;
titleText.visible = false;
playButton.visible = false;
playDay2Button.visible = false;
languageButton.visible = false;
// Fade in Havran
tween(havran, {
alpha: 1
}, {
duration: 1000,
easing: tween.easeOut,
onFinish: function onFinish() {
// Show first dialogue
dialogueBox.visible = true;
continueText.visible = true;
dialogueBox.setText(day2DialogueTexts[currentLanguage][currentDay2Dialogue]);
}
});
}
function startForestSequence() {
currentDay2State = "forest";
gameState = "forest";
inForest = true;
wormsCollected = 0;
// Hide dialogue elements
havran.visible = false;
dialogueBox.visible = false;
continueText.visible = false;
// Show forest background darkened
bosque.visible = true;
bosque.alpha = 1;
bosque.tint = 0x000000; // Make it completely dark
// Show worms counter
wormsCounterText.visible = true;
wormsCounterText.setText(texts[currentLanguage].worms + ' ' + wormsCollected + '/' + requiredWorms);
// Spawn initial rocks
spawnForestRocks();
}
function spawnForestRocks() {
// Clear existing rocks
for (var i = 0; i < forestRocks.length; i++) {
if (forestRocks[i]) {
forestRocks[i].destroy();
}
}
forestRocks = [];
// Spawn 5-8 random rocks
var numRocks = 5 + Math.floor(Math.random() * 4);
for (var i = 0; i < numRocks; i++) {
var rock = LK.getAsset('roca', {
anchorX: 0.5,
anchorY: 0.5,
x: 200 + Math.random() * 1648,
y: 200 + Math.random() * 2332,
scaleX: 2,
scaleY: 2
});
rock.tint = 0x000000; // Start completely dark
game.addChild(rock);
forestRocks.push(rock);
}
}
function handleForestClick(x, y) {
// Check if clicked on any visible rock
for (var i = 0; i < forestRocks.length; i++) {
var rock = forestRocks[i];
if (rock && rock.visible) {
var dx = x - rock.x;
var dy = y - rock.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance < 50) {
// Rock hit radius
// Fade out rock
tween(rock, {
alpha: 0
}, {
duration: 500,
onFinish: function onFinish() {
// 50% chance to spawn worm
if (Math.random() < 0.5) {
spawnWorm(rock.x, rock.y);
}
rock.destroy();
}
});
// Remove from array
forestRocks.splice(i, 1);
// Spawn new rock after delay
LK.setTimeout(function () {
if (inForest && wormsCollected < requiredWorms) {
var newRock = LK.getAsset('roca', {
anchorX: 0.5,
anchorY: 0.5,
x: 200 + Math.random() * 1648,
y: 200 + Math.random() * 2332,
scaleX: 2,
scaleY: 2
});
newRock.tint = 0x000000;
game.addChild(newRock);
forestRocks.push(newRock);
}
}, 2000);
break;
}
}
}
}
function spawnWorm(x, y) {
var worm = LK.getAsset('lombriz', {
anchorX: 0.5,
anchorY: 0.5,
x: x,
y: y,
scaleX: 2,
scaleY: 2
});
worm.tint = 0x000000; // Start dark, will be lit by light effect
game.addChild(worm);
forestWorms.push(worm);
wormsCollected++;
wormsCounterText.setText(texts[currentLanguage].worms + ' ' + wormsCollected + '/' + requiredWorms);
// Auto-fade worm after 2 seconds
LK.setTimeout(function () {
if (worm) {
tween(worm, {
alpha: 0
}, {
duration: 500,
onFinish: function onFinish() {
worm.destroy();
// Remove from array
var index = forestWorms.indexOf(worm);
if (index > -1) {
forestWorms.splice(index, 1);
}
}
});
}
}, 2000);
// Check if collected enough worms
if (wormsCollected >= requiredWorms) {
LK.setTimeout(function () {
endForestSequence();
}, 1000);
}
}
function endForestSequence() {
inForest = false;
gameState = "day2";
currentDay2State = "return";
currentDay2Dialogue = 0;
// Hide forest elements
bosque.visible = false;
wormsCounterText.visible = false;
// Clear rocks and worms
for (var i = 0; i < forestRocks.length; i++) {
if (forestRocks[i]) {
forestRocks[i].destroy();
}
}
for (var i = 0; i < forestWorms.length; i++) {
if (forestWorms[i]) {
forestWorms[i].destroy();
}
}
forestRocks = [];
forestWorms = [];
// Show Havran again and start return dialogue
game.setBackgroundColor(0x000000);
tween(havran, {
alpha: 1
}, {
duration: 1000,
easing: tween.easeOut,
onFinish: function onFinish() {
havran.visible = true;
dialogueBox.visible = true;
continueText.visible = true;
dialogueBox.setText(day2ReturnTexts[currentLanguage][currentDay2Dialogue]);
}
});
}
function showLantern() {
havran.visible = false;
tween(havran, {
alpha: 0
}, {
duration: 500,
onFinish: function onFinish() {
linterna.visible = true;
tween(linterna, {
alpha: 1
}, {
duration: 1000
});
}
});
}
function hideLantern() {
tween(linterna, {
alpha: 0
}, {
duration: 500,
onFinish: function onFinish() {
linterna.visible = false;
havran.visible = true;
tween(havran, {
alpha: 1
}, {
duration: 1000
});
}
});
}
function showDay2Ending() {
// Hide dialogue elements
havran.visible = false;
dialogueBox.visible = false;
continueText.visible = false;
// Show ending text
endingText.visible = true;
endingText.setText(day2EndText[currentLanguage]);
endDayButton.visible = true;
}
function returnToMenuDay3() {
gameState = "menu";
day3Unlocked = true;
// Reset all Day 2 variables
isDay2 = false;
currentDay2Dialogue = 0;
currentDay2State = "dialogue";
showAcceptForestButton = false;
showGiveWormsButton = false;
wormsCollected = 0;
inForest = false;
// Show menu elements
titleText.visible = true;
playButton.visible = true;
playDay2Button.visible = false;
languageButton.visible = true;
spanishButton.visible = false;
englishButton.visible = false;
updateLanguageTexts();
// Hide all Day 2 elements
havran.visible = false;
havran.alpha = 0;
bosque.visible = false;
linterna.visible = false;
linterna.alpha = 0;
endingText.visible = false;
endDayButton.visible = false;
acceptForestButton.visible = false;
giveWormsButton.visible = false;
wormsCounterText.visible = false;
dialogueBox.visible = false;
continueText.visible = false;
}
function startDay3() {
gameState = "day3";
isDay3 = true;
currentDay3State = "intro";
titleText.visible = false;
playButton.visible = false;
playDay2Button.visible = false;
languageButton.visible = false;
// Show intro text
endingText.visible = true;
endingText.setText(day3IntroText[currentLanguage]);
continueDay3Button.visible = true;
}
function startDay3Dialogue() {
currentDay3State = "dialogue";
currentDay3Dialogue = 0;
// Hide intro elements
endingText.visible = false;
continueDay3Button.visible = false;
// Fade in Kid
tween(kid, {
alpha: 1
}, {
duration: 1000,
easing: tween.easeOut,
onFinish: function onFinish() {
// Show first dialogue
dialogueBox.visible = true;
continueText.visible = true;
dialogueBox.setText(day3KidDialogues[currentLanguage][currentDay3Dialogue]);
}
});
}
function startDay3Maze() {
gameState = "game";
isDay3 = true;
currentDay3State = "maze";
// Hide dialogue elements
kid.visible = false;
dialogueBox.visible = false;
continueText.visible = false;
acceptFriendButton.visible = false;
// Initialize Day 3 maze with different assets
initializeDay3Maze();
}
function initializeDay3Maze() {
MAZE_WIDTH = Math.floor(1800 / CELL_SIZE);
MAZE_HEIGHT = Math.floor(2582 / CELL_SIZE);
// Generate maze (same logic as Day 1 but different assets)
maze = [];
for (var y = 0; y < MAZE_HEIGHT; y++) {
maze[y] = [];
for (var x = 0; x < MAZE_WIDTH; x++) {
if (x === 0 || y === 0 || x === MAZE_WIDTH - 1 || y === MAZE_HEIGHT - 1) {
maze[y][x] = 1;
} else if (x % 8 >= 2 && x % 8 <= 5 && y % 8 >= 2 && y % 8 <= 5 && Math.random() < 0.6) {
maze[y][x] = 1;
} else if (y % 6 === 2 && x % 8 >= 1 && x % 8 <= 6 && Math.random() < 0.5) {
maze[y][x] = 1;
} else if (x % 6 === 2 && y % 8 >= 1 && y % 8 <= 6 && Math.random() < 0.5) {
maze[y][x] = 1;
} else if (x % 4 === 0 && y % 4 === 0 && Math.random() < 0.3) {
maze[y][x] = 1;
} else {
maze[y][x] = 0;
}
}
}
// Clear starting and ending areas
for (var sy = 1; sy <= 4; sy++) {
for (var sx = 1; sx <= 4; sx++) {
maze[sy][sx] = 0;
}
}
for (var ey = MAZE_HEIGHT - 5; ey < MAZE_HEIGHT - 1; ey++) {
for (var ex = MAZE_WIDTH - 5; ex < MAZE_WIDTH - 1; ex++) {
maze[ey][ex] = 0;
}
}
// Create guaranteed paths
for (var py = 3; py < MAZE_HEIGHT - 1; py += 6) {
for (var px = 1; px < MAZE_WIDTH - 1; px++) {
maze[py][px] = 0;
}
}
for (var px = 3; px < MAZE_WIDTH - 1; px += 6) {
for (var py = 1; py < MAZE_HEIGHT - 1; py++) {
maze[py][px] = 0;
}
}
// Create maze visuals with different assets
mazeContainer = game.addChild(new Container());
mazeContainer.y = 150;
for (var y = 0; y < MAZE_HEIGHT; y++) {
for (var x = 0; x < MAZE_WIDTH; x++) {
var cellX = x * CELL_SIZE;
var cellY = y * CELL_SIZE;
if (maze[y][x] === 1) {
// Use different wall asset for Day 3
var wall = LK.getAsset('roca', {
x: cellX,
y: cellY,
scaleX: 0.64,
scaleY: 0.64
});
mazeContainer.addChild(wall);
} else {
// Use different floor asset for Day 3
var floor = LK.getAsset('bosque', {
x: cellX,
y: cellY,
scaleX: 0.64,
scaleY: 0.426
});
mazeContainer.addChild(floor);
}
}
}
// Create player with different asset for Day 3
player = game.addChild(new Player());
var playerStartX = CELL_SIZE + CELL_SIZE / 2;
var playerStartY = CELL_SIZE + CELL_SIZE / 2;
player.x = playerStartX;
player.y = playerStartY + 150;
// Initialize eyes array and counter
eyes = [];
eyesCollected = 0;
totalPills = requiredEyes;
// Eyes counter
eyesCounterText.visible = true;
eyesCounterText.setText('OJOS RECOLECTADOS ' + eyesCollected + '/15');
// Spawn 15 eyes
for (var i = 0; i < requiredEyes; i++) {
var eyePos = getRandomWalkablePosition();
while (Math.abs(eyePos.x - CELL_SIZE / 2) < 128 && Math.abs(eyePos.y - CELL_SIZE / 2) < 128) {
eyePos = getRandomWalkablePosition();
}
var eye = game.addChild(new Eye());
eye.x = eyePos.x;
eye.y = eyePos.y + 150;
eyes.push(eye);
}
}
function showDay3Ending() {
currentDay3State = "ending";
// Hide game elements
if (mazeContainer) mazeContainer.visible = false;
if (player) player.visible = false;
eyesCounterText.visible = false;
for (var i = 0; i < eyes.length; i++) {
eyes[i].visible = false;
}
// Show ending text
game.setBackgroundColor(0x000000);
endingText.visible = true;
endingText.setText(day3EndingText[currentLanguage]);
endDayButton.visible = true;
}
function returnToMenuDay4() {
gameState = "menu";
day4Unlocked = true;
// Reset all Day 3 variables
isDay3 = false;
currentDay3Dialogue = 0;
currentDay3State = "intro";
showAcceptFriendButton = false;
eyesCollected = 0;
// Show menu elements
titleText.visible = true;
playButton.visible = true;
playDay2Button.visible = false;
languageButton.visible = true;
spanishButton.visible = false;
englishButton.visible = false;
updateLanguageTexts();
// Hide all Day 3 elements
kid.visible = false;
kid.alpha = 0;
endingText.visible = false;
endDayButton.visible = false;
continueDay3Button.visible = false;
acceptFriendButton.visible = false;
eyesCounterText.visible = false;
dialogueBox.visible = false;
continueText.visible = false;
if (mazeContainer) mazeContainer.visible = false;
if (player) player.visible = false;
}
function returnToMenu() {
gameState = "menu";
day2Unlocked = true;
// Reset all variables
currentDialogue = 0;
currentEndingDialogue = 0;
showYesButton = false;
showGivePillsButton = false;
pillAssetShown = false;
abriendoSoundPlayed = false;
// Show menu elements
titleText.visible = true;
playButton.visible = true;
playDay2Button.visible = false;
languageButton.visible = true;
spanishButton.visible = false;
englishButton.visible = false;
updateLanguageTexts();
// Hide all other elements
pinkcraiyon.visible = false;
pinkcraiyon.alpha = 0;
pillAsset.visible = false;
pillAsset.alpha = 0;
puertaRoja.visible = false;
puertaRoja.alpha = 0;
if (mazeContainer) mazeContainer.visible = false;
if (player) player.visible = false;
if (counterText) counterText.visible = false;
}
function initializeGame() {
MAZE_WIDTH = Math.floor(1800 / CELL_SIZE); // Make maze smaller
MAZE_HEIGHT = Math.floor(2582 / CELL_SIZE); // Reach bottom of screen (2732 - 150 offset)
// Simple maze generation that ensures connectivity with longer walls
maze = [];
for (var y = 0; y < MAZE_HEIGHT; y++) {
maze[y] = [];
for (var x = 0; x < MAZE_WIDTH; x++) {
// Create outer walls
if (x === 0 || y === 0 || x === MAZE_WIDTH - 1 || y === MAZE_HEIGHT - 1) {
maze[y][x] = 1; // wall
}
// Create longer L-shaped wall patterns (extended from 2-3 to 2-5 for longer walls)
else if (x % 8 >= 2 && x % 8 <= 5 && y % 8 >= 2 && y % 8 <= 5 && Math.random() < 0.6) {
maze[y][x] = 1; // Extended L-shaped walls
}
// Create longer horizontal wall segments
else if (y % 6 === 2 && x % 8 >= 1 && x % 8 <= 6 && Math.random() < 0.5) {
maze[y][x] = 1; // longer horizontal walls
}
// Create longer vertical wall segments
else if (x % 6 === 2 && y % 8 >= 1 && y % 8 <= 6 && Math.random() < 0.5) {
maze[y][x] = 1; // longer vertical walls
}
// Add some random walls but keep paths open
else if (x % 4 === 0 && y % 4 === 0 && Math.random() < 0.3) {
maze[y][x] = 1; // sparse additional walls
} else {
maze[y][x] = 0; // floor
}
}
}
// Ensure starting position and surrounding area is clear (larger area)
for (var sy = 1; sy <= 4; sy++) {
for (var sx = 1; sx <= 4; sx++) {
maze[sy][sx] = 0;
}
}
// Ensure exit area is clear (larger area)
for (var ey = MAZE_HEIGHT - 5; ey < MAZE_HEIGHT - 1; ey++) {
for (var ex = MAZE_WIDTH - 5; ex < MAZE_WIDTH - 1; ex++) {
maze[ey][ex] = 0;
}
}
// Create guaranteed horizontal paths every 6 rows
for (var py = 3; py < MAZE_HEIGHT - 1; py += 6) {
for (var px = 1; px < MAZE_WIDTH - 1; px++) {
maze[py][px] = 0;
}
}
// Create guaranteed vertical paths every 6 columns
for (var px = 3; px < MAZE_WIDTH - 1; px += 6) {
for (var py = 1; py < MAZE_HEIGHT - 1; py++) {
maze[py][px] = 0;
}
}
// Create maze visuals
mazeContainer = game.addChild(new Container());
mazeContainer.y = 150; // Move maze down to avoid pause button
for (var y = 0; y < MAZE_HEIGHT; y++) {
for (var x = 0; x < MAZE_WIDTH; x++) {
var cellX = x * CELL_SIZE;
var cellY = y * CELL_SIZE;
if (maze[y][x] === 1) {
// Wall
var wall = LK.getAsset('wall', {
x: cellX,
y: cellY
});
mazeContainer.addChild(wall);
} else {
// Floor
var floor = LK.getAsset('floor', {
x: cellX,
y: cellY
});
mazeContainer.addChild(floor);
}
}
}
// Create door inside maze at bottom-right walkable area
door = LK.getAsset('door', {
x: (MAZE_WIDTH - 3) * CELL_SIZE,
y: (MAZE_HEIGHT - 3) * CELL_SIZE,
anchorX: 0,
anchorY: 0
});
mazeContainer.addChild(door);
// Create player at guaranteed walkable position
player = game.addChild(new Player());
// Find first walkable position starting from top-left
var playerStartX = CELL_SIZE + CELL_SIZE / 2; // Grid position 1,1 center
var playerStartY = CELL_SIZE + CELL_SIZE / 2; // Grid position 1,1 center
player.x = playerStartX;
player.y = playerStartY + 150; // Adjust for maze container offset
// Pills array and counter
pills = [];
pillsCollected = 0;
totalPills = 10;
// UI Counter
counterText = new Text2(texts[currentLanguage].pills + ' 0/10', {
size: 80,
fill: 0xFFFFFF
});
counterText.anchor.set(0.5, 0);
LK.gui.top.addChild(counterText);
// Spawn initial pills
for (var i = 0; i < totalPills; i++) {
var pillPos = getRandomWalkablePosition();
// Make sure pill is not too close to player start
while (Math.abs(pillPos.x - CELL_SIZE / 2) < 128 && Math.abs(pillPos.y - CELL_SIZE / 2) < 128) {
pillPos = getRandomWalkablePosition();
}
var pill = game.addChild(new Pill());
pill.x = pillPos.x;
pill.y = pillPos.y + 150; // Adjust for maze container offset
pills.push(pill);
}
}
// Game update loop
game.update = function () {
if (gameState === "forest") {
// Keep forest background completely dark (no lighting effect on background)
if (bosque && bosque.visible) {
bosque.tint = 0x000000;
}
// Update rock visibility based on distance from mouse
for (var i = 0; i < forestRocks.length; i++) {
var rock = forestRocks[i];
if (rock) {
var dx = mouseX - rock.x;
var dy = mouseY - rock.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance < lightRadius) {
// Inside light radius - make visible
var brightness = 1 - distance / lightRadius;
rock.tint = interpolateColor(0x000000, 0xffffff, brightness);
rock.alpha = 1;
} else {
// Outside light radius - make dark
rock.tint = 0x000000;
rock.alpha = 1;
}
}
}
// Update worm visibility
for (var i = 0; i < forestWorms.length; i++) {
var worm = forestWorms[i];
if (worm) {
var dx = mouseX - worm.x;
var dy = mouseY - worm.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance < lightRadius) {
var brightness = 1 - distance / lightRadius;
worm.tint = interpolateColor(0x000000, 0xffffff, brightness);
} else {
worm.tint = 0x000000;
}
}
}
return;
}
if (gameState !== "game" || !player) return;
if (isDay3 && eyes) {
// Check eye collection for Day 3
for (var i = eyes.length - 1; i >= 0; i--) {
var eye = eyes[i];
if (!eye.collected && player.intersects(eye)) {
eye.collect();
eyesCollected++;
// Update counter
eyesCounterText.setText('OJOS RECOLECTADOS ' + eyesCollected + '/15');
// Remove from array
eyes.splice(i, 1);
}
}
// Check if all eyes collected
if (eyesCollected >= requiredEyes) {
showDay3Ending();
return;
}
} else if (pills) {
// Check pill collection for Day 1
for (var i = pills.length - 1; i >= 0; i--) {
var pill = pills[i];
if (!pill.collected && player.intersects(pill)) {
pill.collect();
pillsCollected++;
// Update counter
counterText.setText(texts[currentLanguage].pills + ' ' + pillsCollected + '/' + totalPills);
// Remove from array
pills.splice(i, 1);
}
}
// Check door collision only after collecting all pills
if (pillsCollected >= totalPills) {
var doorBounds = {
x: (MAZE_WIDTH - 3) * CELL_SIZE,
y: (MAZE_HEIGHT - 3) * CELL_SIZE + 150,
width: CELL_SIZE,
height: CELL_SIZE
};
if (player.x >= doorBounds.x && player.x <= doorBounds.x + doorBounds.width && player.y >= doorBounds.y && player.y <= doorBounds.y + doorBounds.height) {
startEndingDialogue();
return;
}
}
}
// Helper function to interpolate between two colors
function interpolateColor(color1, color2, factor) {
var r1 = color1 >> 16 & 0xFF;
var g1 = color1 >> 8 & 0xFF;
var b1 = color1 & 0xFF;
var r2 = color2 >> 16 & 0xFF;
var g2 = color2 >> 8 & 0xFF;
var b2 = color2 & 0xFF;
var r = Math.floor(r1 + factor * (r2 - r1));
var g = Math.floor(g1 + factor * (g2 - g1));
var b = Math.floor(b1 + factor * (b2 - b1));
return r << 16 | g << 8 | b;
}
};