User prompt
que al darle a jugar que el boton lenguaje desaparezca al mismo tiempo que los demas
User prompt
has que abajo de el botón jugar este el botón LENGUAJE y al presionarlo que nos aparezcan dos opciones: arriba que diga ESPAÑOL y que abajo diga INGLES que dependiendo de cual de los 2 presionemos las palabras del juego estarán en español o ingles. ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
despues de llegar a la puerta del laberinto y escapar se muestra el fondo negro y poco a poco se ve el asset Pinkcraiyon y dice los siguientes dialogos (los cuales para mostrar el siguiente hay que hacer click en cualquier lugar de la pantalla): Pinkcraiyon: "Ahhh... has vuelto, pequeño. Y veo que... sí... sí... puedo sentirlas. Mis dulces tesoros están contigo, ¿verdad?" Pinkcraiyon: "Dámelas... por favor... necesito sentir su dulzura en mis manos otra vez." ahora se muestra un boton que dice "DAR PASTILLAS" y al presionarlo se muestran los siguientes dialogos: despues de precionar el boton se muestra los siguientes dialogos: Pinkcraiyon: "Sí... sí... aquí están todas. Una... dos... tres... ¡Diez! Mis preciosas... cómo las extrañé..." Pinkcraiyon: "Gracias, pequeño... gracias por devolverme lo que más amo. Me siento... completa otra vez. El vacío se llena, la oscuridad se calma..." Pinkcraiyon: "Pero... pero hay algo que debo decirte. Algo que me duele confesar..." Pinkcraiyon: "Yo... yo te mentí, pequeño. La puerta roja... no te llevará a casa. No puedo decirte cómo salir de aquí porque... porque Ella nos observa." Pinkcraiyon: "La Vigía del Umbral... siempre está mirando, siempre está escuchando. Si te dijera la verdad sobre la salida... si te mostrara el camino real... Ella lo sabría. Y entonces... entonces nos castigaría a ambos." Pinkcraiyon: "Perdóname, pequeño... perdóname por engañarte. Pero necesitaba mis píldoras... y tú... tú necesitabas una razón para seguir adelante, para no rendirte en este lugar maldito." Pinkcraiyon: "La puerta roja... solo es el comienzo de otro laberinto. Pero tal vez... tal vez si eres lo suficientemente astuto... encontrarás tu propio camino." Pinkcraiyon: "Ve ahora... antes de que Ella se dé cuenta de que hemos hablado demasiado. Y recuerda... en este lugar, la verdad es un lujo que pocos pueden permitirse." Pinkcraiyon: "Adiós, pequeño valiente... que la suerte te acompañe en la oscuridad que te espera." osea borra el hecho de que se vea el asset pill es estos dialogos ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
el sonido "abriendo" solo se escucha una vez y cuando se muestra el asset pill despues del dialogo de pinkcraiyon despues de ese dialogo se deja de mostrar y se vuelve a mostrar el asset de pinkcraiyon ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
despues de llegar a la puerta del laberinto y escapar se muestra el fondo negro y poco a poco se ve el asset Pinkcraiyon y dice los siguientes dialogos (los cuales para mostrar el siguiente hay que hacer click en cualquier lugar de la pantalla): Pinkcraiyon: "Ahhh... has vuelto, pequeño. Y veo que... sí... sí... puedo sentirlas. Mis dulces tesoros están contigo, ¿verdad?" Pinkcraiyon: "Dámelas... por favor... necesito sentir su dulzura en mis manos otra vez." ahora se muestra un boton que dice "DAR PASTILLAS" y al presionarlo se muestran los siguientes dialogos: despues de precionar el boton ahora se oscurece al asset Pinkcraiyon y en su lugar cambia al asset pill (ahora del mismo tamaño que el asset Pinkcraiyon) antes de mostrar el siguiente dialogo: Pinkcraiyon: "Sí... sí... aquí están todas. Una... dos... tres... ¡Diez! Mis preciosas... cómo las extrañé..." ahora el asset pill se oscurece y se vuelve a mostrar el asset Pinkcraiyon Pinkcraiyon: "Gracias, pequeño... gracias por devolverme lo que más amo. Me siento... completa otra vez. El vacío se llena, la oscuridad se calma..." Pinkcraiyon: "Pero... pero hay algo que debo decirte. Algo que me duele confesar..." Pinkcraiyon: "Yo... yo te mentí, pequeño. La puerta roja... no te llevará a casa. No puedo decirte cómo salir de aquí porque... porque Ella nos observa." Pinkcraiyon: "La Vigía del Umbral... siempre está mirando, siempre está escuchando. Si te dijera la verdad sobre la salida... si te mostrara el camino real... Ella lo sabría. Y entonces... entonces nos castigaría a ambos." Pinkcraiyon: "Perdóname, pequeño... perdóname por engañarte. Pero necesitaba mis píldoras... y tú... tú necesitabas una razón para seguir adelante, para no rendirte en este lugar maldito." Pinkcraiyon: "La puerta roja... solo es el comienzo de otro laberinto. Pero tal vez... tal vez si eres lo suficientemente astuto... encontrarás tu propio camino." Pinkcraiyon: "Ve ahora... antes de que Ella se dé cuenta de que hemos hablado demasiado. Y recuerda... en este lugar, la verdad es un lujo que pocos pueden permitirse." Pinkcraiyon: "Adiós, pequeño valiente... que la suerte te acompañe en la oscuridad que te espera." ahora se oscurece poco a poco el asset Pinkcraiyon hasta que ya no se ve y se muestra poco a poco el asset "puertaroja" y se muestra pequeña hasta que se va haciendo mas grande (en una animacion de 12 segundos) y despues se escucha el sonido "abriendo" mientras el asset de la puerta oscurece y se muestra un fondo negro y cuando termina de audio "abriendo" cuando se termina ese audio el fondo negro se va y cambia para el menu y ahora se vuelve a mostrar el menu pero en lugar de decir "JUGAR" en su lugar ahora dice "JUGAR DÍA 2" ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
despues de llegar a la puerta del laberinto y escapar se muestra el fondo negro y poco a poco se ve el asset Pinkcraiyon y dice los siguientes dialogos (los cuales para mostrar el siguiente hay que hacer click en cualquier lugar de la pantalla): Pinkcraiyon: "Ahhh... has vuelto, pequeño. Y veo que... sí... sí... puedo sentirlas. Mis dulces tesoros están contigo, ¿verdad?" Pinkcraiyon: "Dámelas... por favor... necesito sentir su dulzura en mis manos otra vez." ahora se muestra un boton que dice "DAR PASTILLAS" y al presionarlo se muestran los siguientes dialogos: despues de precionar el boton ahora se oscurece al asset Pinkcraiyon y en su lugar cambia al asset pill (ahora del mismo tamaño que el asset Pinkcraiyon) antes de mostrar el siguiente dialogo: Pinkcraiyon: "Sí... sí... aquí están todas. Una... dos... tres... ¡Diez! Mis preciosas... cómo las extrañé..." despues de el dialogo anterior se oscurece el asset pill y se vuelve a mostrar el asset Pinkcraiyon y dice los siguientes dialogos: Pinkcraiyon: "Gracias, pequeño... gracias por devolverme lo que más amo. Me siento... completa otra vez. El vacío se llena, la oscuridad se calma..." Pinkcraiyon: "Pero... pero hay algo que debo decirte. Algo que me duele confesar..." Pinkcraiyon: "Yo... yo te mentí, pequeño. La puerta roja... no te llevará a casa. No puedo decirte cómo salir de aquí porque... porque Ella nos observa." Pinkcraiyon: "La Vigía del Umbral... siempre está mirando, siempre está escuchando. Si te dijera la verdad sobre la salida... si te mostrara el camino real... Ella lo sabría. Y entonces... entonces nos castigaría a ambos." Pinkcraiyon: "Perdóname, pequeño... perdóname por engañarte. Pero necesitaba mis píldoras... y tú... tú necesitabas una razón para seguir adelante, para no rendirte en este lugar maldito." Pinkcraiyon: "La puerta roja... solo es el comienzo de otro laberinto. Pero tal vez... tal vez si eres lo suficientemente astuto... encontrarás tu propio camino." Pinkcraiyon: "Ve ahora... antes de que Ella se dé cuenta de que hemos hablado demasiado. Y recuerda... en este lugar, la verdad es un lujo que pocos pueden permitirse." Pinkcraiyon: "Adiós, pequeño valiente... que la suerte te acompañe en la oscuridad que te espera." ahora se oscurece poco a poco el asset Pinkcraiyon y se muestra poco a poco el asset "puertaroja" y se muestra pequeña hasta que se va haciendo mas grande (en una animacion de 12 segundos) y despues se escucha el sonido "abriendo" mientras el asset de la puerta oscurece y ahora se vuelve a mostrar el menu pero en lugar de decir "JUGAR" en su lugar ahora dice "JUGAR DÍA 2" HAS QUE AL INICIO DEL JUEGO Y DURANTE EL TRANSCURSO del mismo en lugar de que haya un texto que dice "STRANGE CREATURES" que en su lugar este el asset: "TITULO" ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
cuando presionamos este botón que dice "SI". Después de presionarlo se muestran los siguientes diálogos: Pinkcraiyon: “Eso está mejor... sabía que no me dirías que no, pequeño. Mis píldoras... están dentro de la mansión que se levanta allá... la de cinco pisos que araña el cielo.” Pinkcraiyon: “No tengas miedo... no necesitas recorrerla toda. Mis píldoras están en el primer piso, todas escondidas como pequeños ratones traviesos.” Pinkcraiyon: “Son diez en total. Diez. Ni una menos... ni una más. Cuando las tengas todas... busca la puerta roja. Solo por ahí podrás salir... si es que todavía quieres hacerlo.” Pinkcraiyon: “Ve, pequeño... la mansión te espera. Y yo... yo estaré observando.” Y ahora pasamos al laberinto (que fue el que ya programamos) ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Initial prompt
Viste el fondo donde aparece el asset "pinkcraiyon" y los dialogos? Pues que ese fondo en lugar de ser gris sea completamente negro.
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ 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 ****/ // Game state management var gameState = "menu"; // "menu", "dialogue", "game", "ending" var currentDialogue = 0; var dialogueTexts = ["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?", "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… si es que todavía quieres hacerlo.", "Ve, pequeño… la mansión te espera. Y yo… yo estaré observando."]; var endingDialogueTexts = ["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."]; var currentEndingDialogue = 0; var showYesButton = false; var showGivePillsButton = false; var pillAssetShown = false; var day2Unlocked = false; var abriendoSoundPlayed = false; var CELL_SIZE = 64; // 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('JUGAR', { size: 80, fill: 0x4a90e2 }); playButton.anchor.set(0.5, 0.5); playButton.x = 1024; playButton.y = 1000; game.addChild(playButton); // 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); // 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('Haz CLICK en cualquier lugar para continuar', { 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('SI', { 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('DAR PASTILLAS', { size: 60, fill: 0x4a90e2 }); givePillsButton.anchor.set(0.5, 0.5); givePillsButton.x = 1024; givePillsButton.y = 2000; givePillsButton.visible = false; game.addChild(givePillsButton); // 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 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 click handler game.down = function (x, y, obj) { if (gameState === "menu") { // Check if play button was clicked if (x >= playButton.x - 100 && x <= playButton.x + 100 && y >= playButton.y - 50 && y <= playButton.y + 50) { startDialogue(); } } 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.length) { dialogueBox.setText(dialogueTexts[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.length) { // Start the game startGame(); } else { dialogueBox.setText(dialogueTexts[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[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[currentEndingDialogue]); } else if (currentEndingDialogue >= endingDialogueTexts.length) { // End sequence with door animation startEndingSequence(); } else { dialogueBox.setText(endingDialogueTexts[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; // 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[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[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 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; playButton.setText(day2Unlocked ? 'JUGAR DÍA 2' : 'JUGAR'); // 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('PASTILLAS 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 !== "game" || !player || !pills) return; // Check pill collection 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('PASTILLAS ' + 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; } } };
===================================================================
--- original.js
+++ change.js
@@ -277,24 +277,10 @@
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;
- // Fade out Pinkcraiyon and fade in pill asset
- tween(pinkcraiyon, {
- alpha: 0
- }, {
- duration: 500
- });
- tween(pillAsset, {
- alpha: 1
- }, {
- duration: 500,
- onFinish: function onFinish() {
- pillAssetShown = true;
- currentEndingDialogue++;
- dialogueBox.setText(endingDialogueTexts[currentEndingDialogue]);
- }
- });
+ currentEndingDialogue++;
+ dialogueBox.setText(endingDialogueTexts[currentEndingDialogue]);
}
} else {
// Continue ending dialogue
currentEndingDialogue++;
@@ -303,27 +289,9 @@
showGivePillsButton = true;
givePillsButton.visible = true;
continueText.visible = false;
} else if (currentEndingDialogue === 3) {
- // After dialogue 3 with pill asset, fade out pill and show Pinkcraiyon
- if (pillAssetShown) {
- tween(pillAsset, {
- alpha: 0
- }, {
- duration: 500
- });
- tween(pinkcraiyon, {
- alpha: 1
- }, {
- duration: 500,
- onFinish: function onFinish() {
- pillAssetShown = false;
- dialogueBox.setText(endingDialogueTexts[currentEndingDialogue]);
- }
- });
- } else {
- dialogueBox.setText(endingDialogueTexts[currentEndingDialogue]);
- }
+ dialogueBox.setText(endingDialogueTexts[currentEndingDialogue]);
} else if (currentEndingDialogue >= endingDialogueTexts.length) {
// End sequence with door animation
startEndingSequence();
} else {