User prompt
el el menu que suene el sonido: "menumusical" y que cuando termine al instante comienze a sonar, que solo se detenga cuando presionemos play
User prompt
cuando recolectemos una pastafrola que suene el sonido: "pastafrolasound"
User prompt
no se escucha la musica, arreglalo.
User prompt
en el menú principal reproduce la música: "menumusic" al instante que termine que vuelva a reproducirse desde un inicio, y que la música termine cuando entramos a jugar al nivel y que vuelva a reproducirse cuando se muestre el menú.
User prompt
el laberinto y en si todo el nivel aparece un una parte pequeña de la pantalla, cambia eso, que este en pantalla completa y las únicas partes libres de la pantalla (el fondo marrón) sean donde decia cuantas pastafrolas agarramos, cuantas panteras derrotamos, el tiempo, y los mensajes escritos.
User prompt
cuando terminemos el nivel y nos muestre el tiempo restante, que este se detenga (que no siga la cuenta regresiva, que solo muestre el tiempo que nos sobro) ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'TypeError: Cannot set properties of undefined (setting 'fill')' in or related to this line: 'timeRemainingText.style.fill = 0xFFFFFF;' Line Number: 1286
User prompt
quiero que generes una mecánica nueva, cuando comencemos en nivel tengamos 2 minutos para finalizarlo. esto se muestre con un contador de tiempo en la parte de arriba de la pantalla, y que si no terminamos el nivel a tiempo, que salga una pantalla de derrota: "PERDISTE!" "mejor la próxima vez" cuando logremos terminar el nivel que en la pantalla de victoria también salga el tiempo que nos sobro. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
olvidalo, elimina el loop de las pastafrolas.
User prompt
que el loop de las pastafrola no comienze ni termine, que sea un loop que solo se acaba cuando se deja de mostrar el menú, y que el asset pastafrola en este loop se e muy pequeño, has que su tamaño sea mas grande ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
que el loop de las pastafrola no comienze ni termine, que sea un loop que solo se acaba cuando se deja de mostrar el menú, y que el asset pastafrola en este loop se e muy pequeño, has que su tamaño sea mas grande ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
-en los botones del menú inicial tienen detrás la textura: "wall" , me gastaría que la textura sea mas larga para que abarque la palabra completa y no deje letras por fuera de cada bloque. -en el menú inicial quiero que haya un patrón con el asset: "pastafrola" que este se repita muchas veces en la pantalla y que el patrón se mueva yendo de la esquina izquierda superior de la pantalla hasta la esquina posterior derecha y que siga como un bucle sin fin, (que el patrón sea un poquito desvanecido) en mi opinión seria en buen añadido al menú principal. (que este patrón esté de fondo, osea que no intervenga en el funcionamiento de los botones ni nada del juego, que sea solo estético) ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
cuando termines el nivel y salga la pantalla de victoria, que inmediatamente se oculten los contadores de panteras y pastafrolas
User prompt
crea un nuevo boton en el menu de inicio llamado: "tutorial" este mismo (cuando lo presionemos) que nos muestre el siguiente texto (en el idioma que hayamos seleccionado): "para moverte presiona el lugar donde quieras ir, para ganar derrota a los enemigos lanzándoles pastafrolas, recoléctalas pasando sobre ellas, y lánzaselas presionando al enemigo que quieras atacar! tienes un contador que te indican cuantas pastafrolas tienes recolectadas." ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
el asset: titulo, que sea un poco mas grande, y que tenga una animación de agrandarse un poquito y achicarse otro poquito y que se repita como un bucle en el cual se agranda y se achica para luego agrandarse y repetir el ciclo. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
cuando terminamos el nivel y volvemos al menú principal los assets se buguean y parpadean, arréglalo por favor.
User prompt
añade un boton (en el menu principal) llamado lenguaje, al presionarlo que nos de a elegir entre español y ingles, y dependiendo del que seleccionemos, todos los textos que apareceran en pantalla seran de el idioma seleccionado. ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
cuando terminemos el nivel que se nos muestre una pantalla de: "CONGRATULATIONS, YOU WON!". y luego vuelva al menu principal, si.
User prompt
cuando completamos el nivel que volvamos al menu principal
User prompt
dodne apunta el icono del asset: mouse, esta al revez, corrigelo ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
el asset: "mouse" esta mirado de abajo, quiero que dependiendo de a donde vaya, la imagen apunte a ese lado. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
en el menu de inicio en vez de que aparezca el texto: laberito, que en lugar de eso aparezca el asset: titulo
User prompt
que haya una pantalla de inicio con un boton llamado: "JUGAR" y al presionarlo que comienze el juego.
User prompt
cuando derrotemos alas panteras que aparezca un mensaje que diga que tenemos que tener en nuestro inventario 10 pastafrolas, si no las tenemos no podemos ganar,
User prompt
despues de derrotar a las panteras que aparezca un mensaje ue diga que tenemos que tener 10 pastafrolas en nuestro inventario, solo despues de obtener las 10 se abrirla la puerta, y podremos completar el nivel.
/**** * Classes ****/ var Door = Container.expand(function () { var self = Container.call(this); var doorGraphics = self.attachAsset('door', { anchorX: 0.5, anchorY: 0.5 }); self.locked = true; self.update = function () { if (self.locked && panterasDefeated >= 2 && mouse.pastafrolas >= 10) { self.locked = false; doorGraphics.tint = 0x90EE90; // Light green when unlocked } if (!self.locked && self.intersects(mouse)) { LK.showYouWin(); } }; return self; }); // Game constants var Mouse = Container.expand(function () { var self = Container.call(this); var mouseGraphics = self.attachAsset('mouse', { anchorX: 0.5, anchorY: 0.5 }); self.isMoving = false; self.targetX = 0; self.targetY = 0; self.speed = 8; self.pastafrolas = 0; self.moveTo = function (x, y) { var adjustedY = y - MAZE_OFFSET_Y; var gridX = Math.floor(x / CELL_SIZE); var gridY = Math.floor(adjustedY / CELL_SIZE); if (isWalkable(gridX, gridY)) { self.targetX = x; self.targetY = y; self.isMoving = true; } }; self.update = function () { if (self.isMoving) { var dx = self.targetX - self.x; var dy = self.targetY - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance < self.speed) { self.x = self.targetX; self.y = self.targetY; self.isMoving = false; } else { var newX = self.x + dx / distance * self.speed; var newY = self.y + dy / distance * self.speed; var adjustedY = newY - MAZE_OFFSET_Y; var gridX = Math.floor(newX / CELL_SIZE); var gridY = Math.floor(adjustedY / CELL_SIZE); // Check collision during movement if (isWalkable(gridX, gridY)) { self.x = newX; self.y = newY; } else { // Stop movement if hitting wall self.isMoving = false; } } } }; return self; }); var Pantera = Container.expand(function () { var self = Container.call(this); var panteraGraphics = self.attachAsset('pantera', { anchorX: 0.5, anchorY: 0.5 }); self.health = 100; self.maxHealth = 100; self.defeated = false; self.takeDamage = function (damage) { if (!self.defeated) { self.health -= damage; LK.getSound('hit').play(); if (self.health <= 0) { self.health = 0; self.defeated = true; self.visible = false; panterasDefeated++; // Spawn new pastafrola when pantera is defeated spawnPastafrola(); } // Visual feedback LK.effects.flashObject(self, 0xFF0000, 300); } }; self.down = function (x, y, obj) { if (!self.defeated && mouse.pastafrolas > 0) { mouse.pastafrolas--; self.takeDamage(20); LK.getSound('attack').play(); updateUI(); } }; return self; }); var Pastafrola = Container.expand(function () { var self = Container.call(this); var pastaGraphics = self.attachAsset('pastafrola', { anchorX: 0.5, anchorY: 0.5 }); self.collected = false; self.update = function () { if (!self.collected && self.intersects(mouse)) { self.collected = true; mouse.pastafrolas++; pastafrolarCollas++; LK.getSound('collect').play(); self.visible = false; updateUI(); } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x8B4513 }); /**** * Game Code ****/ // Game constants var CELL_SIZE = 80; var MAZE_WIDTH = 20; var MAZE_HEIGHT = 22; var MAZE_OFFSET_Y = 200; // Vertical offset to move maze down // Game variables var mouse; var door; var pastafrolas = []; var panteras = []; var pastafrolarCollas = 0; var panterasDefeated = 0; var lastPanterasDefeated = 0; // Track last pantera count to detect changes // UI elements var pastafrolarText; var panteraText; var instructionText; var notificationText; // Simple maze layout (1 = wall, 0 = walkable) var mazeData = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], [1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1], [1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1], [1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1], [1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1], [1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1], [1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1], [1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1], [1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1], [1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1], [1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], [1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]; function isWalkable(gridX, gridY) { if (gridX < 0 || gridX >= MAZE_WIDTH || gridY < 0 || gridY >= MAZE_HEIGHT) { return false; } return mazeData[gridY][gridX] === 0; } var barriers = []; // Global array to track barriers function canAccessArea(gridX, gridY) { // Define restricted areas that unlock as panteras are defeated var restrictedAreas = [{ minX: 0, maxX: 6, minY: 0, maxY: 8, requiredDefeats: 0 }, // Starting area { minX: 7, maxX: 13, minY: 0, maxY: 8, requiredDefeats: 1 }, // Second area { minX: 14, maxX: 19, minY: 0, maxY: 8, requiredDefeats: 2 }, // Third area { minX: 0, maxX: 6, minY: 9, maxY: 17, requiredDefeats: 2 }, // Fourth area { minX: 7, maxX: 13, minY: 9, maxY: 17, requiredDefeats: 3 }, // Fifth area { minX: 14, maxX: 19, minY: 9, maxY: 17, requiredDefeats: 4 }, // Sixth area { minX: 0, maxX: 19, minY: 18, maxY: 26, requiredDefeats: 5 } // Final area ]; for (var i = 0; i < restrictedAreas.length; i++) { var area = restrictedAreas[i]; if (gridX >= area.minX && gridX <= area.maxX && gridY >= area.minY && gridY <= area.maxY) { if (panterasDefeated < area.requiredDefeats) { showNotification('Derrota al enemigo de esta zona para continuar'); return false; } return true; } } return true; // Default allow access } function createBarriers() { // Create barriers at area boundaries var barrierPositions = [ // Vertical barrier between areas 1 and 2 { x: 6, y: 1 }, { x: 6, y: 2 }, { x: 6, y: 3 }, { x: 6, y: 4 }, { x: 6, y: 5 }, { x: 6, y: 6 }, { x: 6, y: 7 }, // Vertical barrier between areas 2 and 3 { x: 13, y: 1 }, { x: 13, y: 2 }, { x: 13, y: 3 }, { x: 13, y: 4 }, { x: 13, y: 5 }, { x: 13, y: 6 }, { x: 13, y: 7 }, // Horizontal barrier between upper and middle sections { x: 1, y: 8 }, { x: 2, y: 8 }, { x: 3, y: 8 }, { x: 4, y: 8 }, { x: 5, y: 8 }, { x: 7, y: 8 }, { x: 8, y: 8 }, { x: 9, y: 8 }, { x: 10, y: 8 }, { x: 11, y: 8 }, { x: 12, y: 8 }, { x: 14, y: 8 }, { x: 15, y: 8 }, { x: 16, y: 8 }, { x: 17, y: 8 }, { x: 18, y: 8 }, // Vertical barriers in middle section { x: 6, y: 10 }, { x: 6, y: 11 }, { x: 6, y: 13 }, { x: 6, y: 14 }, { x: 6, y: 15 }, { x: 6, y: 16 }, { x: 13, y: 10 }, { x: 13, y: 11 }, { x: 13, y: 13 }, { x: 13, y: 14 }, { x: 13, y: 15 }, { x: 13, y: 16 }, // Horizontal barrier between middle and bottom sections { x: 1, y: 17 }, { x: 2, y: 17 }, { x: 3, y: 17 }, { x: 4, y: 17 }, { x: 5, y: 17 }, { x: 6, y: 17 }, { x: 7, y: 17 }, { x: 8, y: 17 }, { x: 9, y: 17 }, { x: 10, y: 17 }, { x: 11, y: 17 }, { x: 12, y: 17 }, { x: 13, y: 17 }, { x: 14, y: 17 }, { x: 15, y: 17 }, { x: 16, y: 17 }, { x: 17, y: 17 }, { x: 18, y: 17 }]; for (var i = 0; i < barrierPositions.length; i++) { var pos = barrierPositions[i]; if (isWalkable(pos.x, pos.y)) { var barrier = LK.getAsset('barrier', { anchorX: 0.5, anchorY: 0.5, x: pos.x * CELL_SIZE + CELL_SIZE / 2, y: pos.y * CELL_SIZE + CELL_SIZE / 2 + MAZE_OFFSET_Y, alpha: 0.7 }); barriers.push(barrier); game.addChild(barrier); } } } function updateBarrierVisibility() { // Hide barriers in unlocked areas for (var i = 0; i < barriers.length; i++) { var barrier = barriers[i]; var gridX = Math.floor((barrier.x - CELL_SIZE / 2) / CELL_SIZE); var gridY = Math.floor((barrier.y - CELL_SIZE / 2 - MAZE_OFFSET_Y) / CELL_SIZE); // Check if this barrier should be visible based on area access var shouldShow = !canAccessAreaSilent(gridX, gridY); barrier.visible = shouldShow; } } function canAccessAreaSilent(gridX, gridY) { // Same as canAccessArea but without showing notification var restrictedAreas = [{ minX: 0, maxX: 6, minY: 0, maxY: 8, requiredDefeats: 0 }, { minX: 7, maxX: 13, minY: 0, maxY: 8, requiredDefeats: 1 }, { minX: 14, maxX: 19, minY: 0, maxY: 8, requiredDefeats: 2 }, { minX: 0, maxX: 6, minY: 9, maxY: 17, requiredDefeats: 2 }, { minX: 7, maxX: 13, minY: 9, maxY: 17, requiredDefeats: 3 }, { minX: 14, maxX: 19, minY: 9, maxY: 17, requiredDefeats: 4 }, { minX: 0, maxX: 19, minY: 18, maxY: 26, requiredDefeats: 5 }]; for (var i = 0; i < restrictedAreas.length; i++) { var area = restrictedAreas[i]; if (gridX >= area.minX && gridX <= area.maxX && gridY >= area.minY && gridY <= area.maxY) { return panterasDefeated >= area.requiredDefeats; } } return true; } 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 (isWalkable(x, y)) { return { x: x * CELL_SIZE + CELL_SIZE / 2, y: y * CELL_SIZE + CELL_SIZE / 2 + MAZE_OFFSET_Y }; } attempts++; } return { x: 150, y: 150 + MAZE_OFFSET_Y }; // Fallback position } function getRandomWalkablePositionIncludingRestricted() { var attempts = 0; while (attempts < 100) { var x = Math.floor(Math.random() * MAZE_WIDTH); var y = Math.floor(Math.random() * MAZE_HEIGHT); // Allow spawning in any walkable area, including restricted ones if (isWalkable(x, y)) { return { x: x * CELL_SIZE + CELL_SIZE / 2, y: y * CELL_SIZE + CELL_SIZE / 2 + MAZE_OFFSET_Y }; } attempts++; } return { x: 150, y: 150 + MAZE_OFFSET_Y }; // Fallback position } function spawnPastafrola() { var position = getRandomWalkablePositionIncludingRestricted(); var pastafrola = new Pastafrola(); pastafrola.x = position.x; pastafrola.y = position.y; pastafrolas.push(pastafrola); game.addChild(pastafrola); } function showNotification(message) { if (notificationText) { notificationText.setText(message); notificationText.visible = true; LK.setTimeout(function () { if (notificationText) { notificationText.visible = false; } }, 2000); } } function updateUI() { pastafrolarText.setText('Pastafrolas: ' + mouse.pastafrolas); panteraText.setText('Panteras: ' + panterasDefeated + '/2'); if (panterasDefeated < 2) { instructionText.setText('Defeat all panteras first! (' + panterasDefeated + '/2)'); } else if (mouse.pastafrolas < 10) { instructionText.setText('Necesitas 10 pastafrolas en tu inventario! (' + mouse.pastafrolas + '/10)'); } else { instructionText.setText('All objectives complete! Head to the green door!'); } } // Build the maze for (var y = 0; y < MAZE_HEIGHT; y++) { for (var x = 0; x < MAZE_WIDTH; x++) { if (y < mazeData.length && mazeData[y][x] === 1) { var wall = LK.getAsset('wall', { anchorX: 0.5, anchorY: 0.5, x: x * CELL_SIZE + CELL_SIZE / 2, y: y * CELL_SIZE + CELL_SIZE / 2 + MAZE_OFFSET_Y }); game.addChild(wall); } else if (y < mazeData.length) { var floor = LK.getAsset('floor', { anchorX: 0.5, anchorY: 0.5, x: x * CELL_SIZE + CELL_SIZE / 2, y: y * CELL_SIZE + CELL_SIZE / 2 + MAZE_OFFSET_Y }); game.addChild(floor); } } } // Create mouse mouse = new Mouse(); mouse.x = 150; mouse.y = 150 + MAZE_OFFSET_Y; game.addChild(mouse); // Create door at the bottom right door = new Door(); door.x = 18 * CELL_SIZE + CELL_SIZE / 2; door.y = (MAZE_HEIGHT - 2) * CELL_SIZE + CELL_SIZE / 2 + MAZE_OFFSET_Y; game.addChild(door); // Spawn initial pastafrolas for (var i = 0; i < 20; i++) { spawnPastafrola(); } // Spawn 2 panteras in strategic positions var panteraPositions = [{ x: 5, y: 5 }, { x: 15, y: 8 }]; for (var i = 0; i < panteraPositions.length; i++) { var pos = panteraPositions[i]; if (isWalkable(pos.x, pos.y)) { var pantera = new Pantera(); pantera.x = pos.x * CELL_SIZE + CELL_SIZE / 2; pantera.y = pos.y * CELL_SIZE + CELL_SIZE / 2 + MAZE_OFFSET_Y; panteras.push(pantera); game.addChild(pantera); } } // Setup UI - all elements in top area to avoid click interference pastafrolarText = new Text2('Pastafrolas: 0', { size: 60, fill: 0xFFFFFF }); pastafrolarText.anchor.set(0.5, 0); pastafrolarText.y = 0; // At very top LK.gui.top.addChild(pastafrolarText); // Add panteras defeated text below pastafrolas text var panteraText = new Text2('Panteras: 0/2', { size: 50, fill: 0xFFFFFF }); panteraText.anchor.set(0.5, 0); panteraText.y = 70; // Below pastafrola text LK.gui.top.addChild(panteraText); instructionText = new Text2('Click to move. Collect pastafrolas and defeat panteras!', { size: 40, fill: 0xFFFFFF }); instructionText.anchor.set(0.5, 0); instructionText.y = 130; // Below pantera text LK.gui.top.addChild(instructionText); notificationText = new Text2('', { size: 45, fill: 0xFF4444 }); notificationText.anchor.set(0.5, 1); notificationText.visible = false; LK.gui.bottom.addChild(notificationText); // Barriers removed - no movement restrictions updateUI(); // Game controls game.down = function (x, y, obj) { mouse.moveTo(x, y); }; // Main game loop game.update = function () { // Check if we just defeated all panteras (transition from not all defeated to all defeated) if (lastPanterasDefeated < 2 && panterasDefeated >= 2) { showNotification('¡Todas las panteras derrotadas! Necesitas tener 10 pastafrolas en tu inventario para abrir la puerta'); } lastPanterasDefeated = panterasDefeated; // Update mouse mouse.update(); // Update pastafrolas for (var i = 0; i < pastafrolas.length; i++) { pastafrolas[i].update(); } // Update panteras for (var i = 0; i < panteras.length; i++) { if (!panteras[i].defeated) { // Simple AI: panteras don't move but can be clicked for combat } } // Update door door.update(); // Barrier visibility removed - no restrictions // Spawn more pastafrolas if needed and not all collected if (pastafrolarCollas < 10 && pastafrolas.filter(function (p) { return !p.collected; }).length < 15) { if (Math.random() < 0.05) { // 5% chance per frame spawnPastafrola(); } } };
===================================================================
--- original.js
+++ change.js
@@ -8,9 +8,9 @@
anchorY: 0.5
});
self.locked = true;
self.update = function () {
- if (self.locked && panterasDefeated >= 2 && pastafrolarCollas >= 10) {
+ if (self.locked && panterasDefeated >= 2 && mouse.pastafrolas >= 10) {
self.locked = false;
doorGraphics.tint = 0x90EE90; // Light green when unlocked
}
if (!self.locked && self.intersects(mouse)) {
@@ -563,10 +563,10 @@
pastafrolarText.setText('Pastafrolas: ' + mouse.pastafrolas);
panteraText.setText('Panteras: ' + panterasDefeated + '/2');
if (panterasDefeated < 2) {
instructionText.setText('Defeat all panteras first! (' + panterasDefeated + '/2)');
- } else if (pastafrolarCollas < 10) {
- instructionText.setText('Now collect 10 pastafrolas! (' + pastafrolarCollas + '/10)');
+ } else if (mouse.pastafrolas < 10) {
+ instructionText.setText('Necesitas 10 pastafrolas en tu inventario! (' + mouse.pastafrolas + '/10)');
} else {
instructionText.setText('All objectives complete! Head to the green door!');
}
}
@@ -663,9 +663,9 @@
// Main game loop
game.update = function () {
// Check if we just defeated all panteras (transition from not all defeated to all defeated)
if (lastPanterasDefeated < 2 && panterasDefeated >= 2) {
- showNotification('¡Todas las panteras derrotadas! Ahora necesitas 10 pastafrolas en tu inventario');
+ showNotification('¡Todas las panteras derrotadas! Necesitas tener 10 pastafrolas en tu inventario para abrir la puerta');
}
lastPanterasDefeated = panterasDefeated;
// Update mouse
mouse.update();