Code edit (2 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
create a sound called Sound_Win and play it when app 11 is pressed
User prompt
instead of spawning between 1 and 2 bugs in level 6, spawn between 1 and 3. update all parts of the code that deal with spawning bugs
User prompt
unlock app 6 at the start of the game
User prompt
unlock app 6 at the start of the ga,e
User prompt
make it so level 6 spawn between 1-3 bugs instead of 1-2
User prompt
lock alls apps between app 5 and 12, and also app 2, at the start of the game
User prompt
create a new sound named Sound_Recorder and play it when pressing app 5
User prompt
make the glitch in level 10 vibrate. it needs to constantly shake while it's on screen
User prompt
make the glitch in level 10 vibrate
User prompt
start with all app unlocked at the start of the game
User prompt
create a new sound named Sound_Folder and play it when pressing app 8
User prompt
create a new sound named Sound_Photo and play it when pressing app 10
User prompt
create a new sound named Sound_Virus and play it when pressing app 6
User prompt
create a new sound named Sound_Cube and play it when pressing app 9
User prompt
create a new sound named Sound_Sudoku and play it when pressing app 7
User prompt
create a new sound named Sound_Galaxoid and play it when pressing app 3
User prompt
create a new sound named Sound_Lock and play it when pressing app 4
Code edit (1 edits merged)
Please save this source code
User prompt
instead of creating a glitch every 3 seconds, pick a random value between a range so it can be between 1 second and 3 seconds or any value in between ↪💡 Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1, @upit/tween.v1
User prompt
the glitches appear but they only appear once. you need to generate one once every 3 seconds
User prompt
have the glitch asset appear inside level 1 every once in a while using a tween animation. it appears on the screen, stays for 2 seconds as it's flickering the goes away. show multiple glitches at various intervals and they can have various rotations ↪💡 Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1, @upit/tween.v1
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1", { highestScore: 0 }); /**** * Classes ****/ var BackButton = Container.expand(function () { var self = Container.call(this); var buttonGraphics = self.attachAsset('Button_Back', { anchorX: 0.5, anchorY: 0.5 }); self.down = function (x, y, obj) { LK.getSound('Back').play(); // Play 'Back' sound effect for (var i = 0; i < levels.length; i++) { levels[i].visible = false; } if (levels[2]) { levels[2].shuffleAndReassignSettings(); // Shuffle settings on Back button press var settings = levels[2].settingsContainer.children.filter(function (child) { return child instanceof Text2 && child.text !== "Show Hidden Files"; }); var shuffledStates = shuffleArray([true, true, true, false, false, false]); settings.forEach(function (setting, index) { setting.toggleIcon = LK.getAsset(shuffledStates[index] ? 'Toggle_ON' : 'Toggle_OFF', { anchorX: 0.5, anchorY: 0.5, x: toggleIconX, y: setting.y }); levels[2].settingsContainer.addChild(setting.toggleIcon); }); } for (var j = 0; j < levelButtons.length; j++) { levelButtons[j].visible = j < 2 || hiddenAppsVisible; if (levelButtons[j].visible) { levelButtons[j].scale.set(0.1, 0.1); tween(levelButtons[j].scale, { x: 1, y: 1 }, { duration: 500, easing: tween.easeOut }); } levels[0].visible = true; level0Animation.resetAnimation(); level0Animation.playAnimation(); } //{0.1} if (levels[6]) { var gridContainer = levels[6].children.find(function (child) { return child instanceof GridContainer; }); if (gridContainer) { gridContainer.resetGrid(); } } // Reset level 4 display to 0000 if (levels[4]) { var displayText = levels[4].children.find(function (child) { return child instanceof Text2; }); if (displayText) { displayText.setText('0000'); inputSequence = [0, 0, 0, 0]; // Reset input sequence to match the display playerSequence = []; // Clear player sequence // Ensure no residual data is reused inputSequence.length = 0; playerSequence.length = 0; } } levels[0].visible = true; // Removed battery percentage reset to make timer independent of the game tween.stop(tutorialFace); tween.stop(tutorialTextBox); tutorialFace.y = tutorialFaceStartPosition; tutorialTextBox.y = tutorialTextBoxStartPosition; isAnimating = false; }; }); var Button = Container.expand(function (levelNumber, assetId) { var self = Container.call(this); if (!assetId) { console.error("Asset ID is undefined for levelNumber:", levelNumber); return; } var buttonGraphics = self.attachAsset(assetId, { anchorX: 0.5, anchorY: 0.5 }); // Add unique name under each app button var appNameText = new Text2(buttonStates['button_' + levelNumber] ? "Locked" : appNames[levelNumber - 1], { size: 50, fill: 0xFFFFFF, stroke: 0x000000, // Add black outline strokeThickness: 13 // Further increase outline thickness }); appNameText.anchor.set(0.5, 0); appNameText.y = buttonGraphics.height / 2 + 20; // Position below the button self.addChild(appNameText); self.down = function (x, y, obj) { for (var i = 0; i < levels.length; i++) { levels[i].visible = false; } if (levelNumber === 1) { LK.getSound('Voice_Message').play(); // Play 'Voice_Message' sound when App 1 is clicked } //{16.1} if (levelNumber === 3) { LK.getSound('Sound_Galaxoid').play(); // Play 'Sound_Galaxoid' sound when App 3 is clicked } if (levelNumber === 4) { LK.getSound('Sound_Lock').play(); // Play 'Sound_Lock' sound when App 4 is clicked//{16.1} } //{16.2} if (levelNumber === 5) { LK.getSound('Sound_Recorder').play(); // Play 'Sound_Recorder' sound when App 5 is clicked } if (levelNumber === 7) { LK.getSound('Sound_Sudoku').play(); // Play 'Sound_Sudoku' sound when App 7 is clicked } if (levelNumber === 6) { LK.getSound('Sound_Virus').play(); // Play 'Sound_Virus' sound when App 6 is clicked } if (levelNumber === 8) { LK.getSound('Sound_Folder').play(); // Play 'Sound_Folder' sound when App 8 is clicked } if (levelNumber === 9) { LK.getSound('Sound_Cube').play(); // Play 'Sound_Cube' sound when App 9 is clicked//{1a.1} } //{1a.2} if (levelNumber === 10) { LK.getSound('Sound_Photo').play(); // Play 'Sound_Photo' sound when App 10 is clicked } for (var j = 0; j < levelButtons.length; j++) { levelButtons[j].visible = false; // Ensure all app buttons are hidden when entering a level } // hiddenAppsVisible state should not be reset when entering a level levels[levelNumber].visible = true; if (levelNumber === 11) { LK.getSound('Sound_Win').play(); // Play 'Sound_Win' sound when App 11 is clicked uiBar.visible = false; // Hide the top UI bar when app 11 is clicked // Stop battery from draining game.update = function () {}; // Lock battery percentage in place var finalScore = Math.floor(batteryPercentage); var highestScore = storage.highestScore || 0; //{17.1} if (finalScore > highestScore) { //{17.2} storage.highestScore = finalScore; //{17.3} levels[levelNumber].batteryPercentageText.setText(finalScore + "%"); // Update the displayed best score//{17.4} } else { //{17.5} levels[levelNumber].batteryPercentageText.setText(highestScore + "%"); // Display the stored highest score if it's greater//{17.6} } //{17.7} } if (levelNumber === 9 && isCubeCorrect) { var level9 = levels[levelNumber]; //{L.1} level9.removeChild(level9.cubeCorrupt); //{L.2} level9.removeChild(level9.cubeCorrupt2); //{L.3} level9.addChild(level9.cubeCorrect); //{L.4} if (!levels[8].documentGrid.hasReplaced) { levels[8].documentGrid.replaceRandomFileWith10111(); // Call the method to change a random file name in level 8 console.log("File updated to '10111':", levels[8].documentGrid.children.find(function (file) { return file.children[0].text === "10111"; }).children[0].text); } } //{L.5} // Trigger tutorial animation if entering levels 1-8 if (levelNumber >= 1 && levelNumber <= 10) { tween.stop(tutorialFace); tween.stop(tutorialTextBox); tutorialFace.y = tutorialFaceStartPosition; tutorialTextBox.y = tutorialTextBoxStartPosition; isAnimating = false; levels[levelNumber]._animateTutorialAssets(); } }; }); var Cube = Container.expand(function (type) { var self = Container.call(this); var assetId = type === 'correct' ? 'Cube_Correct' : type === 'corrupt' ? 'Cube_Corrupt' : 'Cube_Corrupt_2'; var cubeGraphics = self.attachAsset(assetId, { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 - 200, scaleX: 0.8, // Shrink width by 20% scaleY: 0.8 // Shrink height by 20% }); }); var DocumentGrid = Container.expand(function () { var self = Container.call(this); self.hasReplaced = false; // Initialize flag to track if replacement has occurred self.replaceRandomFileWith10111 = function () { if (self.hasReplaced) { return; // Ensure replacement occurs only once } // Filter files that do not have the name "10111" var non10111Files = self.children.filter(function (file) { return file.children[0].text !== "10111"; }); shuffleArray(non10111Files); // Shuffle to ensure randomness if (non10111Files.length > 0) { // Randomly select one file from the filtered list var randomIndex = Math.floor(Math.random() * non10111Files.length); var selectedFile = non10111Files[randomIndex]; // Update the number property and visual text to "10111" if (selectedFile.children.length > 0 && selectedFile.children[0] instanceof Text2) { selectedFile.children[0].setText("10111"); selectedFile.unlocked = true; // Set unlock flag to true selectedFile.fileName = "10111"; // Update the file's name property console.log("File '10111' unlocked:", selectedFile.unlocked); // Log to confirm unlocked property tween(selectedFile, { tint: 0xFFFF00 }, { duration: 500, easing: tween.easeInOut, onFinish: function onFinish() { tween(selectedFile, { tint: 0xFFFFFF }, { duration: 500, easing: tween.easeInOut }); } }); } } self.hasReplaced = true; // Set flag to prevent further replacements console.log("File updated to '10111':", selectedFile.children[0].text); }; var gridSize = 5; // Updated grid size to 5x5 var fileSize = 200; // Assuming each file asset is 200x200 var gapSize = 100; // Adjusted gap size between files var gridOffsetX = 2048 / 2 - (gridSize * fileSize + (gridSize - 1) * gapSize) / 2; var gridOffsetY = 2732 / 2 - (gridSize * fileSize + (gridSize - 1) * gapSize) / 2; // Generate unique 5-digit binary names var binaryNames = []; for (var i = 0; i < 32; i++) { var binaryName = i.toString(2).padStart(5, '0'); if (binaryName !== "10111") { binaryNames.push(binaryName); } } shuffleArray(binaryNames); // Shuffle to randomize order var selectedNames = binaryNames.slice(0, 25); // Select first 25 names for (var row = 0; row < gridSize; row++) { for (var col = 0; col < gridSize; col++) { var file = LK.getAsset('File', { anchorX: 0.5, anchorY: 0.5, x: gridOffsetX + col * (fileSize + gapSize), y: gridOffsetY + row * (fileSize + gapSize) }); // Add binary name under each file var fileName = new Text2(selectedNames[row * gridSize + col], { size: 50, fill: 0x000000 }); fileName.anchor.set(0.5, 0); fileName.y = fileSize / 2 + 20; // Position below the file with more space file.addChildAt(fileName, 0); // Ensure Text2 is the first child file.fileName = fileName.text; // Initialize fileName property file.soundPlayed = false; // Initialize soundPlayed flag to false // Generate and store a unique random code for each file file.randomCode = generateRandomScrambledText(); fileCodes[fileName.text] = file.randomCode; file.interactive = true; // Enable interactivity file.down = function (x, y, obj) { var _this5 = this; console.log("File clicked:", this.children[0].text); LK.getSound('File').play(); // Play 'File' sound when a file is clicked // Pass the file reference to the handler handleFileClick(this); if (this.children[0].text === "10111") { console.log("Handling file click for: 10111"); } // Add tween animation to simulate button press tween(this.scale, { x: 0.9, y: 0.9 }, { // Shrink to 0.8 of original size duration: 50, // Duration of 100ms easing: tween.easeInOut, // Smooth transition onFinish: function onFinish() { tween(_this5.scale, { x: 1, y: 1 }, { // Return to original size duration: 50, // Duration of 100ms easing: tween.easeInOut // Smooth transition }); } }); }; self.addChild(file); } } }); var GridContainer = Container.expand(function (gridSize) { var self = Container.call(this); self.updateBugs = function () { var cellSize = 250; var gridOffsetX = 2048 / 2 - self.gridManager.gridSize * cellSize / 2; var gridOffsetY = 2732 / 2 - self.gridManager.gridSize * cellSize / 2; var grid = self.gridManager.getGrid(); for (var r = 0; r < gridSize; r++) { for (var c = 0; c < gridSize; c++) { if (grid[r][c].cellType === 'Cell_Bug') { var bugCell = LK.getAsset('Cell_Bug', { anchorX: 0.5, anchorY: 0.5, x: gridOffsetX + c * cellSize, y: gridOffsetY + r * cellSize }); self.addChild(bugCell); bugCell.interactive = false; if (grid[r][c].asset) { grid[r][c].asset.interactive = false; // Disable interaction on the original cell } } } } // Check if there are any possible moves left var possibleMoveExists = false; for (var r = 0; r < gridSize; r++) { for (var c = 0; c < gridSize; c++) { if (grid[r][c].cellType === 'Cell_Empty' && isAdjacentToOccupied(r, c)) { var readyCell = LK.getAsset('Cell_Ready', { anchorX: 0.5, anchorY: 0.5, x: gridOffsetX + c * cellSize, y: gridOffsetY + r * cellSize, scaleX: 0.5, // Start with a smaller scale scaleY: 0.5 // Start with a smaller scale }); self.addChild(readyCell); tween(readyCell, { scaleX: 1, // Enlarge to normal size scaleY: 1 // Enlarge to normal size }, { duration: 300, // Duration of the animation easing: tween.easeOut // Easing function for smooth transition }); grid[r][c].asset = readyCell; // Update grid data with new asset possibleMoveExists = true; } } } // If no possible moves, play 'Wrong' sound and reset grid after 1 second if (!possibleMoveExists) { LK.getSound('Wrong').play(); LK.setTimeout(function () { self.resetGrid(); }, 1000); } }; self.bfs = function (start, goal, grid, gridSize) { var queue = [start]; var visited = []; visited.push(start.row + ',' + start.col); var directions = [{ row: -1, col: 0 }, // Up { row: 1, col: 0 }, // Down { row: 0, col: -1 }, // Left { row: 0, col: 1 } // Right ]; while (queue.length > 0) { var current = queue.shift(); if (current.row === goal.row && current.col === goal.col) { LK.setTimeout(function () { self.resetGrid(); // Trigger grid reset upon success }, 1000); connectionsMade++; // Increment the connection counter updateLEDState(connectionsMade - 1, true); // Light up the corresponding LED LK.getSound('Win_Level').play(); // Play 'Win_Level' sound return true; } for (var i = 0; i < directions.length; i++) { var newRow = current.row + directions[i].row; var newCol = current.col + directions[i].col; if (newRow >= 0 && newRow < gridSize && newCol >= 0 && newCol < gridSize) { var neighbor = grid[newRow][newCol]; if (neighbor && neighbor.cellType === 'Cell_Occupied' && visited.indexOf(newRow + ',' + newCol) === -1) { queue.push({ row: newRow, col: newCol }); visited.push(newRow + ',' + newCol); } } } } return false; }; self.gridManager = new GridManager(gridSize); var grid = self.gridManager.getGrid(); var startCell = self.gridManager.getStartCell(); var goalCell = self.gridManager.getGoalCell(); var gridInteractionEnabled = true; // Flag to control grid interaction var cellSize = 250; var gridOffsetX = 2048 / 2 - self.gridManager.gridSize * cellSize / 2; var gridOffsetY = 2732 / 2 - self.gridManager.gridSize * cellSize / 2; function isAdjacentToOccupied(row, col) { var directions = [{ row: -1, col: 0 }, // Up { row: 1, col: 0 }, // Down { row: 0, col: -1 }, // Left { row: 0, col: 1 } // Right ]; for (var i = 0; i < directions.length; i++) { var newRow = row + directions[i].row; var newCol = col + directions[i].col; if (newRow >= 0 && newRow < gridSize && newCol >= 0 && newCol < gridSize) { var adjacentCell = grid[newRow][newCol]; if (adjacentCell && adjacentCell.cellType === 'Cell_Occupied') { return true; } } } return false; } for (var row = 0; row < self.gridManager.gridSize; row++) { for (var col = 0; col < self.gridManager.gridSize; col++) { var cellType = grid[row][col].cellType; var cell = LK.getAsset(cellType, { anchorX: 0.5, anchorY: 0.5, x: gridOffsetX + col * cellSize, y: gridOffsetY + row * cellSize }); // Store a reference to the cell asset in the grid data self.gridManager.grid[row][col].asset = cell; cell.down = function (row, col) { return function (x, y, obj) { var currentCellType = grid[row][col].cellType; // Access current cellType dynamically if (gridInteractionEnabled && currentCellType === 'Cell_Empty' && isAdjacentToOccupied(row, col)) { var newType = 'Cell_Occupied'; var newCell = LK.getAsset(newType, { anchorX: 0.5, anchorY: 0.5, x: cell.x, y: cell.y, scaleX: 1.25, // Start with a larger scale scaleY: 1.25 // Start with a larger scale }); self.removeChild(cell); self.addChild(newCell); tween(newCell, { scaleX: 1, scaleY: 1 }, {}); // Animate to normal size cell = newCell; // Update grid state grid[row][col] = { cellType: newType }; // Check if a path exists from start to goal after placing a tile if (self.bfs(startCell, goalCell, grid, self.gridManager.gridSize)) { console.log("Path exists from Start to Goal"); LK.getSound('Win_Level').play(); } else { console.log("No path exists from Start to Goal"); // Trigger Bug Placement System self.gridManager.placeRandomBugs(Math.floor(Math.random() * 3) + 1); // Use self.gridManager to place bugs self.updateBugs(); // Update the visual representation of bugs gridInteractionEnabled = true; // Ensure interaction remains enabled for subsequent taps } } }; }(cell, cellType, row, col); self.addChild(cell); } } // Method to reset the grid to its default state self.resetGrid = function () { self.gridManager = new GridManager(gridSize); grid = self.gridManager.getGrid(); startCell = self.gridManager.getStartCell(); goalCell = self.gridManager.getGoalCell(); gridInteractionEnabled = true; self.removeChildren(); for (var row = 0; row < self.gridManager.gridSize; row++) { for (var col = 0; col < self.gridManager.gridSize; col++) { var cellType = grid[row][col].cellType; var cell = LK.getAsset(cellType, { anchorX: 0.5, anchorY: 0.5, x: gridOffsetX + col * cellSize, y: gridOffsetY + row * cellSize }); // Store a reference to the cell asset in the grid data self.gridManager.grid[row][col].asset = cell; cell.down = function (cell, cellType, row, col) { return function (x, y, obj) { if (gridInteractionEnabled && cellType === 'Cell_Empty' && isAdjacentToOccupied(row, col)) { var newType = 'Cell_Occupied'; var newCell = LK.getAsset(newType, { anchorX: 0.5, anchorY: 0.5, x: cell.x, y: cell.y, scaleX: 1.25, // Start with a larger scale scaleY: 1.25 // Start with a larger scale }); self.removeChild(cell); self.addChild(newCell); tween(newCell, { scaleX: 1, scaleY: 1 }, { duration: 300, easing: tween.easeOut }); // Animate to normal size cell = newCell; cellType = newType; grid[row][col] = { cellType: newType }; if (self.bfs(startCell, goalCell, grid, self.gridManager.gridSize)) { console.log("Path exists from Start to Goal"); LK.getSound('Win_Level').play(); } else { console.log("No path exists from Start to Goal"); self.gridManager.placeRandomBugs(Math.floor(Math.random() * 3) + 1); self.updateBugs(); } } }; }(cell, cellType, row, col); self.addChild(cell); if (cellType === 'Cell_Empty' && isAdjacentToOccupied(row, col)) { var readyCell = LK.getAsset('Cell_Ready', { anchorX: 0.5, anchorY: 0.5, x: gridOffsetX + col * cellSize, y: gridOffsetY + row * cellSize }); self.addChild(readyCell); grid[row][col].asset = readyCell; } } } }; }); var Key = Container.expand(function () { var self = Container.call(this); var keyGraphics = self.attachAsset('Key', { anchorX: 0.5, anchorY: 0.5 }); // Ensure the key is fully opaque keyGraphics.alpha = 1.0; // Attach Button_Back to increase hitbox var buttonBackGraphics = self.attachAsset('Button_Back', { anchorX: 0.5, anchorY: 0.5 }); buttonBackGraphics.alpha = 0.0; // Make it invisible but interactive buttonBackGraphics.interactive = true; buttonBackGraphics.down = function (x, y, obj) { self.isDragging = true; self.startDragX = x - self.x; // Store initial offset self.startDragY = y - self.y; }; buttonBackGraphics.move = function (x, y, obj) { if (self.isDragging) { self.x = Math.max(0, Math.min(2048, x - self.startDragX)); self.y = Math.max(0, Math.min(2732, y - self.startDragY)); } }; buttonBackGraphics.up = function (x, y, obj) { self.isDragging = false; self.x = x - self.startDragX; // Ensure the key stays at the drop position self.y = y - self.startDragY; // Check for collision with lock var lock = self.parent.children.find(function (child) { return child instanceof Lock; }); if (lock && self.intersects(lock)) { // Play unlock sound LK.getSound('Win_Big').play(); // Consolidate unlock logic for App 2 and App 3 unlockApp(2); // Unlock App 2 unlockApp(3); // Unlock App 3 // Destroy the key after it contacts the lock self.destroy(); } }; self.addChild(buttonBackGraphics); self.addChild(keyGraphics); // Ensure keyGraphics is added after buttonBackGraphics }); var Level = Container.expand(function (levelNumber) { var self = Container.call(this); if (levelNumber === 6) { var levelBackground = self.attachAsset('level6', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); self.addChild(levelBackground); var gridContainer = new GridContainer(7); gridContainer.x += 150; // Move grid 150 pixels to the right gridContainer.y += 100; // Move grid 100 pixels lower self.addChild(gridContainer); // Add three LED assets to visualize progression var ledContainer = new Container(); ledContainer.id = 'ledContainer'; // Unique identifier for targeting var ledSpacing = 250; // Spacing between LEDs for (var i = 0; i < 3; i++) { var led = LK.getAsset('LED', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 - 540 - ledSpacing + i * ledSpacing, y: 2732 / 2 + 1130, alpha: 0.1 // Initially unlit }); ledContainer.addChild(led); } self.addChild(ledContainer); // Add Retry button (existing code) retryButton = LK.getAsset('Retry', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 + 550, y: 2732 / 2 + 1150 }); retryButton.down = function (x, y, obj) { console.log("Retry button pressed"); var gridContainer = self.children.find(function (child) { return child instanceof GridContainer; }); if (gridContainer) { gridContainer.resetGrid(); LK.getSound('Restart').play(); // Play 'Restart' sound when Retry button is pressed } retryButton.visible = false; retryButton.interactive = false; bugSpawnCount = 0; // Reset any other necessary level-specific states here }; retryButton.visible = false; retryButton.interactive = false; self.addChild(retryButton); } else { var levelBackground = self.attachAsset('level' + levelNumber, { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: levelNumber === 12 ? 2732 / 2 - 200 : levelNumber === 2 ? 2732 / 2 + 100 : 2732 / 2 }); } if (levelNumber === 2) { var getRandomSettings = function getRandomSettings() { var shuffledNames = shuffleArray(settingNames); var uniqueSettings = shuffledNames.slice(0, 6); // Select 6 unique settings return uniqueSettings; }; var settingsContainer = new Container(); self.settingsContainer = settingsContainer; // Store the settings container for Level 2 var settingNames = ["Quantum Refresh", "Anti Gravity", "Pixel Align", "Time Travel", "Darkness Equalizer", "Vibration Sync", "Decryption Module", "Thought Input", "Pocket Cleaner", "Self Destruct", "Cosmic Booster", "Universe Toggle", "Gravity Adjust", "Noise Reduction", "Display Mode", "Thermal Balance", "Fragment Control", "Invisible Mode", "Neural Link", "Speed Boost", "Reality Sync", "Dimensional Stabilizer", "Energy Harvest", "Photon Boost", "Shift Detector", "Wormhole Locator", "Shadow Mode", "Seal Generator", "Language Translator", "Particle Analyzer", "Ping Tester", "Ether Link", "Black Hole", "Space Recalibrator", "Cryo Switch", "Crypto Enhancer", "Flare Shield", "Hyper Router", "Matter Scanner", "Bandwidth Mode", "Magnetic Field", "Multiverse Map", "Trigger Debugger", "Encryption Lock", "Void Integrator", "Vision Filter", "Sync Adjuster", "Data Equalizer", "Astro Assister", "Anomaly Detector", "Noise Cancelation", "Plasma Flow"]; var randomSettings = getRandomSettings(); var shuffledStates = shuffleArray([true, true, true, false, false, false]); // Shuffle states to randomly assign 3 on and 3 off var settings = [{ text: 'Show Hidden Apps', isOn: false, action: function action() { hiddenAppsVisible = this.isOn; levelButtons.forEach(function (button, index) { if (index >= 2 && levels[0].visible) { button.visible = hiddenAppsVisible; } }); } }, { text: randomSettings[0], isOn: shuffledStates[0], action: function action() {/* Add action for setting 1 */} }, { text: randomSettings[1], isOn: shuffledStates[1], action: function action() {/* Add action for setting 2 */} }, { text: randomSettings[2], isOn: shuffledStates[2], action: function action() {/* Add action for setting 3 */} }, { text: randomSettings[3], isOn: shuffledStates[3], action: function action() {/* Add action for setting 4 */} }, { text: randomSettings[4], isOn: shuffledStates[4], action: function action() {/* Add action for setting 5 */} }, { text: randomSettings[5], isOn: shuffledStates[5], action: function action() {/* Add action for setting 6 */} }]; settings.forEach(function (setting, index) { var toggleIcon = LK.getAsset(setting.isOn ? 'Toggle_ON' : 'Toggle_OFF', { anchorX: 0.5, anchorY: 0.5, x: toggleIconX, // Use global variable for toggle icon x-coordinate y: 2732 / 2 - 700 + index * 200 }); settingsContainer.addChild(toggleIcon); var settingText = new Text2(setting.text, { size: 100, fill: 0x000000 }); settingText.anchor.set(0, 0.5); settingText.x = 550; // Moved 100 pixels to the left settingText.y = 2732 / 2 - 700 + index * 200; // Position each setting 150 pixels apart settingsContainer.addChild(settingText); settingText.toggleIcon = toggleIcon; // Link toggle icon to setting text settingText.down = function (x, y, obj) { var _this6 = this; settingsContainer.removeChild(this.toggleIcon); // Remove the old toggle icon this.toggleIcon = LK.getAsset(setting.isOn ? 'Toggle_ON' : 'Toggle_OFF', { // Re-attach the new toggle icon anchorX: 0.5, anchorY: 0.5, x: toggleIconX, // Use global variable for toggle icon x-coordinate y: this.y // Align toggle icon y with text y }); settingsContainer.addChild(this.toggleIcon); setting.isOn = !setting.isOn; // Toggle the state setting.action(); // Ensure action is called after toggling the state if (setting.text === 'Show Hidden Apps' && setting.isOn) { LK.setTimeout(function () { setting.isOn = false; setting.action(); // Ensure action is called when auto-toggling off settingsContainer.removeChild(settingText.toggleIcon); settingText.toggleIcon = LK.getAsset('Toggle_OFF', { anchorX: 0.5, anchorY: 0.5, x: toggleIconX, y: settingText.y }); settingsContainer.addChild(settingText.toggleIcon); LK.getSound('Hide').play(); // Play 'Hide' sound when auto toggle triggers }, Math.floor(Math.random() * 3000) + 10000); // Randomize between 5 and 20 seconds } settingsContainer.removeChild(this.toggleIcon); // Remove the old toggle icon this.toggleIcon = LK.getAsset(setting.isOn ? 'Toggle_ON' : 'Toggle_OFF', { // Re-attach the new toggle icon anchorX: 0.5, anchorY: 0.5, x: toggleIconX, // Use global variable for toggle icon x-coordinate y: this.y // Align toggle icon y with text y }); settingsContainer.addChild(this.toggleIcon); LK.getSound('Click').play(); // Play the 'Click' sound when a new bug spawns bugSpawnCount++; // Increment bug spawn counter if (bugSpawnCount >= 6) { retryButton.visible = true; // Make retry button visible retryButton.interactive = true; // Enable interaction } // Add tween effect to setting text tween(this.scale, { x: 0.9, y: 0.9 }, { duration: 100, easing: tween.easeInOut, onFinish: function onFinish() { tween(_this6.scale, { x: 1, y: 1 }, { duration: 100, easing: tween.easeInOut }); } }); }; }); self.addChild(settingsContainer); self.shuffleAndReassignSettings = function () { var settings = self.settingsContainer.children.reduce(function (acc, child) { if (child instanceof Text2) { acc.push({ text: child, toggle: child.toggleIcon }); } return acc; }, []); var shuffledSettings = shuffleArray(settings); shuffledSettings.forEach(function (setting, index) { setting.text.y = 2732 / 2 - 700 + index * 200; // Reassign y position based on new index setting.toggle.y = 2732 / 2 - 700 + index * 200; // Reassign toggle y position to match text self.settingsContainer.addChild(setting.text); // Re-add text to container to update order self.settingsContainer.addChild(setting.toggle); // Re-add toggle to container to update order }); }; self.shuffleAndReassignSettings(); // Shuffle settings on Level 2 initialization } else if (levelNumber === 10) { var _vibrateGlitch = function vibrateGlitch() { tween(glitch, { x: glitch.x + 5 }, { duration: 50, easing: tween.easeInOut, onFinish: function onFinish() { tween(glitch, { x: glitch.x - 5 }, { duration: 50, easing: tween.easeInOut, onFinish: _vibrateGlitch }); } }); }; // Start the vibration effect levelBackground = self.attachAsset('level10', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); // Add Glitch asset to the center of level 10 var glitch = LK.getAsset('Glitch', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 - 95, y: 2732 / 2 - 110 }); self.addChild(glitch); // Create a vibration effect for the glitch _vibrateGlitch(); levelBackground.down = function (x, y, obj) { if (glitch.alpha > 0) { glitch.alpha -= 0.02; } }; } else if (levelNumber === 3) { var gameButtons = []; var buttonPressManager = new ButtonPressManager(6, 'Win_Level'); var tapsToDeduct = Math.floor(Math.random() * 10) + 4; // Randomize between 3 and 9 taps // Add click event to level3 asset to deplete battery by 1% levelBackground.down = function (x, y, obj) { buttonsPressed++; // Increment the tap count if (buttonsPressed >= tapsToDeduct) { batteryPercentage = Math.max(0, batteryPercentage - 1); // Deplete battery by 1% LK.getSound('Wrong').play(); // Play 'Wrong' sound when level3 asset is clicked batteryTxt.setText(Math.floor(batteryPercentage) + '%'); // Update battery text display // Add blink effect to battery text var batteryBlink = new BatteryBlink(batteryTxt); batteryBlink.start(); buttonsPressed = 0; // Reset the tap count tapsToDeduct = Math.floor(Math.random() * 3) + 3; // Randomize the next tap count } }; var buttonSize = 150; var horizontalGap = 90; // Horizontal gap between buttons var verticalGap = 60; // Decrease vertical gap between buttons var gridOffsetX = 2048 / 2 - buttonSize * 1.5 - horizontalGap * 1.5 + 630; var gridOffsetY = 2732 / 2 - buttonSize - verticalGap * 0.5 + 590; for (var row = 0; row < 2; row++) { for (var col = 0; col < 3; col++) { var button = LK.getAsset('Game_Button', { anchorX: 0.5, anchorY: 0.5, x: gridOffsetX + col * (buttonSize + horizontalGap), y: gridOffsetY + row * (buttonSize + verticalGap), alpha: 1.0 }); button.down = function () { tween(this, { alpha: 0 }, { duration: 500, easing: tween.easeInOut }); buttonPressManager.buttonPressed(); }; self.addChild(button); } } } else if (levelNumber === 4) { var handleKeypadPress = function handleKeypadPress(number) { if (number === 3 && !isDigit3Enabled || number === 1 && !isDigit1Enabled || number === 9 && !isDigit9Enabled) { return; // Ignore if '3', '1', or '9' is pressed and not enabled } inputSequence.push(number); // Add the new number to the end if (inputSequence.length > 4) { inputSequence.shift(); // Keep only the last 4 entries } displayText.setText(inputSequence.join('').padStart(4, '0')); // Update display with current sequence }; var gameButtons = []; var buttonArray = []; // Array to hold the two buttons // Create two buttons using the 'Button_Rectangle' asset for (var i = 0; i < 2; i++) { var button = LK.getAsset('button_rectangle', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 + i * 784 - 400, // Position buttons with a gap y: 2732 / 2 + 770, // Position above the keypad alpha: 0 }); buttonArray.push(button); self.addChild(button); // Add event listener for the Clear button if (i === 0) { // Assuming the first button is the Clear button button.down = function () { var _this2 = this; LK.getSound('Click').play(); // Play the 'Click' sound tween(this, { alpha: 1 }, { // Tween to make button fully visible duration: 100, // Duration for the blink effect easing: tween.easeInOut, onFinish: function onFinish() { tween(_this2, { alpha: 0 }, { // Tween to make button invisible again duration: 100, easing: tween.easeInOut }); } }); inputSequence = [0, 0, 0, 0]; // Reset input sequence displayText.setText('0000'); // Update display to "0000" }; } else if (i === 1) { // Assuming the second button is the Enter button button.down = function () { var _this3 = this; LK.getSound('Click').play(); // Play the 'Click' sound tween(this, { alpha: 1 }, { // Tween to make button fully visible duration: 100, // Duration for the blink effect easing: tween.easeInOut, onFinish: function onFinish() { tween(_this3, { alpha: 0 }, { // Tween to make button invisible again duration: 100, easing: tween.easeInOut }); } }); var currentInput = inputSequence.join(''); var validCodes = ['3885', '1011', '74#9']; // Predefined valid codes if (validCodes.includes(currentInput)) { console.log('Valid code entered:', currentInput); LK.getSound('Win_Big').play(); // Play 'Win_Big' sound when the correct sequence is entered if (currentInput === '3885') { unlockApp(7); // Unlock App 10 } else if (currentInput === '1011') { unlockApp(5); // Unlock App 5 unlockApp(9); // Unlock App 9 } else if (currentInput === '74#9') { unlockApp(6); // Unlock App 6 } } else { console.log('Invalid code:', currentInput); LK.getSound('Wrong').play(); // Play 'Wrong' sound when the combination is incorrect batteryPercentage = Math.max(0, batteryPercentage - 5); // Deplete battery by 5% per wrong code batteryTxt.setText(Math.floor(batteryPercentage) + '%'); // Update battery text display // Add blink effect to battery text var batteryBlink = new BatteryBlink(batteryTxt); batteryBlink.start(); } inputSequence = [0, 0, 0, 0]; // Reset input sequence displayText.setText('0000'); // Update display to "0000" }; } } // Function to handle keypad button presses var buttonSize = 150; var horizontalGap = 220; // Horizontal gap between buttons var verticalGap = 130; // Increase vertical gap between buttons var gridOffsetX = 2048 / 2 - buttonSize * 1.5 - horizontalGap * 1.5 + 190; var gridOffsetY = 2732 / 2 - buttonSize * 1.5 - verticalGap * 1.5 + 60; // Create a digital display for the 4-digit input var displayText = new Text2('0000', { size: 200, fill: 0xFFFFFF }); displayText.anchor.set(0.5, 0.5); displayText.x = 2048 / 2; displayText.y = gridOffsetY - 370; // Move 200 pixels higher above the keypad self.addChild(displayText); for (var row = 0; row < 4; row++) { for (var col = 0; col < 3; col++) { var button = LK.getAsset('Generic_Button', { anchorX: 0.5, anchorY: 0.5, x: gridOffsetX + col * (buttonSize + horizontalGap), y: gridOffsetY + row * (buttonSize + verticalGap), alpha: 0 }); gameButtons.push(button); button.down = function (row, col) { return function () { var _this = this; var number = numberMapping[row * 3 + col + 1]; // Get the number associated with the button handleKeypadPress(number); // Use the new function to handle keypad press LK.getSound('Click').play(); // Play the 'Click' sound tween(this, { alpha: 1 }, { // Tween to make button fully visible duration: 50, // Fast blink effect easing: tween.easeInOut, onFinish: function onFinish() { tween(_this, { alpha: 0 }, { // Tween to fade back to invisible duration: 50, easing: tween.easeInOut }); } }); }; }(row, col); var numberMapping = { 1: 1, 2: 2, 3: 3, 4: 7, 5: 5, 6: 6, 7: 4, 8: 8, 9: 0, 10: '#', 11: 9, 12: '*' }; // Removed dialNumber to hide values from the buttons on the keypad self.addChild(button); } } } else if (levelNumber === 5) { levelBackground = self.attachAsset('level5', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); // Create a 2x2 grid of Joystick_Button assets var joystickButtons = []; var buttonSounds = ['Call_1', 'Call_2', 'Call_3', 'Call_4']; var buttonSize = 300; var buttonGap = 400; // Increase the gap between buttons by 100 pixels var gridOffsetX = 2048 / 2 - buttonSize - buttonGap + 340; var gridOffsetY = 2732 / 2 - buttonSize - buttonGap + 370; for (var row = 0; row < 2; row++) { for (var col = 0; col < 2; col++) { var button = LK.getAsset('Generic_Button', { anchorX: 0.5, anchorY: 0.5, x: gridOffsetX + col * (buttonSize + buttonGap), y: gridOffsetY + row * (buttonSize + buttonGap), scaleX: 3.2, scaleY: 3.2, alpha: 0.0 // Set button alpha to 55% }); joystickButtons.push(button); button.down = function (buttonIndex) { var currentButton = button; // Capture the current button return function (x, y, obj) { LK.getSound(buttonSounds[buttonIndex]).play(); tween(currentButton, { alpha: 1 }, { duration: 50, easing: tween.easeInOut, onFinish: function onFinish() { tween(currentButton, { alpha: 0 }, { duration: 50, easing: tween.easeInOut }); } }); // Disable all buttons joystickButtons.forEach(function (btn) { btn.interactive = false; }); // Re-enable all buttons after 3 seconds LK.setTimeout(function () { joystickButtons.forEach(function (btn) { btn.interactive = true; }); }, 3000); }; }(row * 2 + col); self.addChild(button); } } } else if (levelNumber === 7) { var shiftSudokuGrid = function shiftSudokuGrid(grid) { var shiftX = Math.floor(Math.random() * 3) + 2; // Random shift between 2 and 4 var shiftY = Math.floor(Math.random() * 3) + 2; // Random shift between 2 and 4 // Shift rows for (var i = 0; i < grid.length; i++) { grid[i] = grid[i].slice(shiftX).concat(grid[i].slice(0, shiftX)); } // Shift columns for (var j = 0; j < grid[0].length; j++) { var column = []; for (var k = 0; k < grid.length; k++) { column.push(grid[k][j]); } column = column.slice(shiftY).concat(column.slice(0, shiftY)); for (var l = 0; l < grid.length; l++) { grid[l][j] = column[l]; } } }; // Shift the Sudoku grid at the start of the level var sudokuGrid = []; var gridSize = 6; var tileSize = 260; // Increase tile size to create a gap between tiles var gridOffsetX = 2048 / 2 - gridSize * tileSize / 2 + 150; var gridOffsetY = 2732 / 2 - gridSize * tileSize / 2 - 100; // Pre-generated valid Sudoku solution var sudokuSolution = [[4, 1, 5, 2, 6, 3], [2, 3, 6, 5, 4, 1], [1, 4, 3, 6, 2, 5], [6, 5, 2, 3, 1, 4], [3, 2, 4, 1, 5, 6], [5, 6, 1, 4, 3, 2]]; // Function to shift numbers in the Sudoku grid shiftSudokuGrid(sudokuSolution); // Create the Sudoku grid for (var row = 0; row < gridSize; row++) { sudokuGrid[row] = []; for (var col = 0; col < gridSize; col++) { var tileContainer = new Container(); tileContainer.x = gridOffsetX + col * tileSize; tileContainer.y = gridOffsetY + row * tileSize; var tileGraphic = tileContainer.attachAsset('Tile', { anchorX: 0.5, anchorY: 0.5 }); tileContainer.number = sudokuSolution[row][col]; tileContainer.row = row; // Set the row property tileContainer.col = col; // Set the col property var tileText = new Text2(tileContainer.number.toString(), { size: 100, fill: 0x000000 }); tileText.anchor.set(0.5, 0.5); tileContainer.addChild(tileText); tileContainer.text = tileText; // Ensure text is accessible sudokuGrid[row][col] = tileContainer; self.addChild(tileContainer); } } // Randomly hide 12 tiles var hiddenTiles = []; while (hiddenTiles.length < 12) { var randomRow = Math.floor(Math.random() * gridSize); var randomCol = Math.floor(Math.random() * gridSize); var tile = sudokuGrid[randomRow][randomCol]; if (!hiddenTiles.includes(tile)) { if (tile.text) { tile.text.visible = false; } var tileTapContainer = new Container(); var tileTapGraphic = tileTapContainer.attachAsset('Tile_Tap', { anchorX: 0.5, anchorY: 0.5 }); var tileTap2Graphic = LK.getAsset('Tile_Tap_2', { anchorX: 0.5, anchorY: 0.5 }); tileTap2Graphic.visible = false; // Ensure alternate frame is hidden initially tileTapContainer.addChild(tileTap2Graphic); tileTapContainer.addChild(tile.text); // Ensure text is over the asset tile.addChild(tileTapContainer); tile.interactive = true; tile.tapContainer = tileTapContainer; // Store reference to the tap container hiddenTiles.push(tile); } hiddenTiles.forEach(function (tile) { tile.down = function (x, y, obj) { LK.getSound('Click').play(); // Play the 'Click' sound if (!tile.text.visible) { tile.text.visible = true; tile.number = 1; tile.text.setText(tile.number.toString()); } else { var currentNumber = tile.number; tile.number = tile.number % 6 + 1; var nextNumber = tile.number; // Switch to Tile_Tap_2 tile.tapContainer.children[0].visible = false; // Hide Tile_Tap tile.tapContainer.children[1].visible = true; // Show Tile_Tap_2 // Revert back to Tile_Tap after 100ms LK.setTimeout(function () { tile.tapContainer.children[0].visible = true; // Show Tile_Tap tile.tapContainer.children[1].visible = false; // Hide Tile_Tap_2 }, 100); // Create a tween for the current number to move down if (tile.text.tweenRef) { tween.stop(tile.text.tweenRef); // Stop any ongoing tween for the tile text } tile.text.y = 0; // Reset text position to center tile.text.alpha = 1; // Reset alpha to 1 tile.text.tweenRef = tween(tile.text, { y: tile.text.y + 20, // Move text down slightly alpha: 0 }, { duration: 200, easing: tween.easeInOut, onFinish: function onFinish() { tile.text.setText(nextNumber.toString()); tile.text.y -= 40; // Move text up to simulate coming from top tile.text.alpha = 0; // Create a tween for the next number to appear tween(tile.text, { y: tile.text.y + 20, // Move text back to center alpha: 1 }, { duration: 200, easing: tween.easeInOut, onFinish: function onFinish() { tile.text.y = 0; // Ensure text is centered after animation tile.text.alpha = 1; // Ensure text is fully visible } }); } }); } // Check if the current tile's number matches the solution if (tile.number === sudokuSolution[tile.row][tile.col]) { tile.correct = true; } else { tile.correct = false; } // Check if all hidden tiles are correct var allCorrect = hiddenTiles.every(function (t) { return t.correct; }); if (allCorrect) { LK.getSound('Win_Level').play(); // Lock hidden tiles to prevent further interaction hiddenTiles.forEach(function (tile) { tile.interactive = false; }); // Unlock level 10 unlockApp(10); unlockApp(8); // Unlock App 8 isDigit1Enabled = true; // Enable digit '1' on the keypad in level 4 } }; }); } } else if (levelNumber === 8) { this.documentGrid = new DocumentGrid(); // Assign DocumentGrid instance to a property this.documentGrid.x += 100; // Move grid 100 pixels to the right this.documentGrid.y += 180; // Move grid 150 pixels lower self.addChild(this.documentGrid); // Initialize Code_Display Text2 object and assign it to the global variable Code_Display = new Text2('Click a file to view its code.', { size: 100, fill: 0x000000 }); Code_Display.anchor.set(0.5, 0); Code_Display.x = 2048 / 2; // Center horizontally Code_Display.y = 2048 / 2 - 600; // Position at the top self.addChild(Code_Display); } else if (levelNumber === 11) { levelBackground = self.attachAsset('level11', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); // Add a text box displaying the highest battery performance score var bestBatteryText = new Text2("Best Battery Performance", { size: 80, fill: 0xFFFFFF, stroke: 0x000000, // Add black outline strokeThickness: 10 // Set outline thickness }); bestBatteryText.anchor.set(0.5, 0.5); bestBatteryText.x = 2048 / 2 + 50; bestBatteryText.y = 2732 / 2 - 300; // Position below the center self.addChild(bestBatteryText); var remainingBatteryText = new Text2("Remaining Battery:", { size: 80, fill: 0x000000 }); remainingBatteryText.anchor.set(0.5, 0.5); remainingBatteryText.x = 2048 / 2 + 180; remainingBatteryText.y = 2732 / 2 - 1230; // Position at the upper part of the screen self.addChild(remainingBatteryText); this.batteryPercentageText = new Text2(storage.highestScore + "%", { size: 300, fill: 0xFFFFFF, stroke: 0x000000, // Add black outline strokeThickness: 30 // Set outline thickness }); this.batteryPercentageText.anchor.set(0.5, 0.5); this.batteryPercentageText.x = 2048 / 2; this.batteryPercentageText.y = bestBatteryText.y + 350; // Position below the 'Best Battery Performance' text self.addChild(this.batteryPercentageText); // Add Restart button var restartButton = new RestartButton(); self.addChild(restartButton); } else if (levelNumber === 12) { // Add Restart button var restartButton = new Container(); var restartGraphics = restartButton.attachAsset('Restart', { anchorX: 0.5, anchorY: 0.5 }); restartButton.x = 2048 / 2; // Center horizontally restartButton.y = 2732 / 2 + 1100; // Move 800 pixels lower restartButton.down = function (x, y, obj) { LK.showGameOver(); // Trigger Game Over condition }; self.addChild(restartButton); } if (levelNumber === 1) { var _scheduleRandomGlitch = function scheduleRandomGlitch() { var randomInterval = Math.floor(Math.random() * 2000) + 1000; // Random interval between 1000ms (1s) and 3000ms (3s) LK.setTimeout(function () { createGlitch(); _scheduleRandomGlitch(); // Schedule the next glitch }, randomInterval); }; var createGlitch = function createGlitch() { var glitch = LK.getAsset('Glitch', { anchorX: 0.5, anchorY: 0.5, x: Math.random() * 2048, y: Math.random() * 2732, rotation: Math.random() * Math.PI * 2 }); self.addChild(glitch); // Flicker effect var flickerInterval = LK.setInterval(function () { glitch.visible = !glitch.visible; }, 75); // Remove glitch after 2 seconds LK.setTimeout(function () { LK.clearInterval(flickerInterval); self.removeChild(glitch); }, 1500); }; // Schedule multiple glitches at random intervals var lock = new Lock(); lock.x = 2048 / 2; lock.y = 2732 / 2 + 10; self.addChild(lock); var key = new Key(); key.x = 2048 / 2 - 860; key.y = 2732 / 2 + 790; self.addChild(key); // Function to create and animate a glitch _scheduleRandomGlitch(); // Start the first glitch } if (levelNumber >= 1 && levelNumber <= 10) { var _animateTutorialAssets = function animateTutorialAssets() { if (isAnimating) { return; } isAnimating = true; tutorialFace.y = tutorialFaceStartPosition; tutorialTextBox.y = tutorialTextBoxStartPosition; // Intro animation for tutorialFace tween(tutorialFace, { y: tutorialFaceRestPosition // Resting position }, { duration: ANIMATION_DURATION, easing: tween.easeInOut, onFinish: function onFinish() { // Rest position for 5 seconds LK.setTimeout(function () { // Outro animation for tutorialFace tween(tutorialFace, { y: tutorialFaceStartPosition // Starting position }, { duration: ANIMATION_DURATION, easing: tween.easeInOut }); }, REST_DURATION); } }); // Intro animation for tutorialTextBox tween(tutorialTextBox, _defineProperty({ y: tutorialTextBoxRestPosition }, "y", tutorialTextBoxStartY), { duration: ANIMATION_DURATION, easing: tween.easeInOut, onFinish: function onFinish() { // Rest position for 5 seconds LK.setTimeout(function () { // Outro animation for tutorialTextBox tween(tutorialTextBox, _defineProperty({ y: tutorialTextBoxStartPosition }, "y", tutorialTextBoxStartY), { duration: ANIMATION_DURATION, easing: tween.easeInOut }); }, REST_DURATION); } }); }; var tutorialFace = self.attachAsset('Tutorial_Face', { anchorX: 0.0, anchorY: 1.0, x: tutorialFaceStartX, y: tutorialFaceStartPosition // Always below the screen }); // Add event listener to tutorialFace to trigger animation outro on click tutorialFace.down = function (x, y, obj) { tween.stop(tutorialFace); tween.stop(tutorialTextBox); tween(tutorialFace, { y: tutorialFaceStartPosition }, { duration: ANIMATION_DURATION, easing: tween.easeInOut, onFinish: function onFinish() { isAnimating = false; } }); tween(tutorialTextBox, { y: tutorialTextBoxStartPosition }, { duration: ANIMATION_DURATION, easing: tween.easeInOut }); }; var tutorialTextBox = new Container(); var tutorialTextBoxGraphics = tutorialTextBox.attachAsset('Tutorial_Text_Box', { anchorX: 0.0, anchorY: 1.0, x: +600, y: tutorialTextBoxStartY // Starting y position for tutorialTextBox }); // Add event listener to tutorialTextBox to trigger animation outro on click tutorialTextBoxGraphics.down = function (x, y, obj) { tween.stop(tutorialFace); tween.stop(tutorialTextBox); tween(tutorialFace, { y: tutorialFaceStartPosition }, { duration: ANIMATION_DURATION, easing: tween.easeInOut, onFinish: function onFinish() { isAnimating = false; } }); tween(tutorialTextBox, { y: tutorialTextBoxStartPosition }, { duration: ANIMATION_DURATION, easing: tween.easeInOut }); }; self.addChild(tutorialTextBox); // Define animation duration self._animateTutorialAssets = function () { animateTutorialAsset(tutorialFace, tutorialFaceStartPosition, tutorialFaceRestPosition); animateTutorialAsset(tutorialTextBox, tutorialTextBoxStartPosition, tutorialTextBoxRestPosition); }; var tutorialTextContent = ["Your phone’s been hacked, but don’t panic. I’m here to guide you. This lock is simple, no need to let it drag out longer than necessary.", "The settings screen is a mess of glitches and half working options. It’s obvious whoever tampered with this, was clearly working against the clock.", "Odd...this game shouldn't even be here. It’s glitching and could drain your battery fast! Play carefully and plan ahead.", "A simple PIN lock? How primitive. The codes must be scattered nearby. Find them before your battery runs out.", "I managed to grab these recordings from the hacker’s phone, just before getting intercepted. They’re cryptic fragments, but maybe you can piece them together?", "The grid is broken, and your network is down. Fix it, but watch out, the hacker’s virus is making everything unpredictable. Can you make it in time?", "This encryption lock seems like a relic from the digital stone age. Not exactly cutting edge, but still functional enough to stop a few. Can you handle it?", "This collection of files feels like an elaborate prank meant to distract you. It’s almost like the hacker is trying to trap you in a loop. Could it be a dead end?", "I uploaded this old Decipher Cube on your device, but it’s useless without the proper sequence. Solve it, or rely on brute force, it’s up to you.", "This corrupted file has an air of desperation, as if the hacker couldn’t quite decide how to finish it. Perhaps the creator tapped out of ideas and gave up."]; var tutorialText = new Text2(tutorialTextContent[levelNumber - 1], { size: 50, fill: 0xFFFFFF, wordWrap: true, // Enable word wrap wordWrapWidth: 1000, // Set word wrap width to 1000 pixels stroke: 0x000000, // Add black outline strokeThickness: 10 // Set outline thickness to 3 }); tutorialText.anchor.set(0.5, 0.5); tutorialText.x = tutorialTextBox.width - 100; tutorialText.y = tutorialTextBox.height - 250; tutorialTextBox.addChild(tutorialText); } // Removed gates from level 1 self.isPassed = function () { // Define the condition for the level to be considered as passed // This is a placeholder, replace with the actual condition return false; }; self.update = function () { // Update logic for the level // Check if the level is passed if (self.isPassed()) { // Hide the current level self.visible = false; // Show the next level var nextLevelIndex = levels.indexOf(self) + 1; if (nextLevelIndex < levels.length) { levels[nextLevelIndex].visible = true; } else { // If there are no more levels, the game is won LK.showGameWon(); } } }; }); var Level0Animation = Container.expand(function () { var self = Container.call(this); var level0Asset = self.attachAsset('level0', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2, scaleX: 1, scaleY: 1 }); self.playAnimation = function () { tween(level0Asset.scale, { x: 1.3, //{d2.1} y: 1.3 //{d2.2} }, { //{d2.3} duration: 500, //{d2.4} easing: tween.easeInOut }); }; self.resetAnimation = function () { level0Asset.scale.x = 1; level0Asset.scale.y = 1; }; }); var Level9 = Container.expand(function () { var self = Container.call(this); // Add _animateTutorialAssets method to Level9 self._animateTutorialAssets = function () { // Implement the tutorial animation logic for Level 9 animateTutorialAsset(tutorialFace, tutorialFaceStartPosition, tutorialFaceRestPosition); animateTutorialAsset(tutorialTextBox, tutorialTextBoxStartPosition, tutorialTextBoxRestPosition); }; // Attach the level 9 asset as the background var levelBackground = self.attachAsset('level9', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 + 100 }); // Attach a new asset named Cube_Corrupt var cubeCorrupt = new Cube('corrupt'); var cubeCorrupt2 = new Cube('corrupt_2'); var cubeCorrect = new Cube('correct'); self.addChild(cubeCorrupt); // Create a 2 by 2 grid of Joystick_Button var sequenceButtons = []; var inputSequence = [0, 0, 0, 0]; // Initialize the input sequence to match the "0000" display var isCubeCorrect = false; // Track if the cube is in the correct state var correctSequence = [4, 1, 3, 2]; var buttonSize = 400; var gridOffsetX = 2048 / 2 - buttonSize * 2 + 180; var gridOffsetY = 2732 / 2 + 430 + 430; for (var i = 0; i < 4; i++) { var button = LK.getAsset('Button_Round', { anchorX: 0.5, anchorY: 0.5, x: gridOffsetX + i * (buttonSize + 10), // Adjust horizontal spacing y: gridOffsetY, alpha: 0 // Set button alpha to 0 }); button.buttonIndex = i + 1; // Assign unique identifier to each button sequenceButtons.push(button); self.addChild(button); button.down = function () { var currentButton = button; // Capture the current button return function (x, y, obj) { LK.getSound('Click').play(); // Play the 'Click' sound tween(currentButton, { alpha: 1 }, { duration: 50, easing: tween.easeInOut, onFinish: function onFinish() { tween(currentButton, { alpha: 0 }, { duration: 50, easing: tween.easeInOut }); } }); playerSequence.push(currentButton.buttonIndex); if (playerSequence.length > 4) { playerSequence.shift(); // Keep only the last 4 entries } // Toggle between Cube_Corrupt and Cube_Corrupt_2 if (!isCubeCorrect) { if (self.children.includes(cubeCorrupt)) { self.removeChild(cubeCorrupt); self.addChild(cubeCorrupt2); } else { self.removeChild(cubeCorrupt2); self.addChild(cubeCorrupt); } } if (playerSequence.length === 4) { if (compareSequences(playerSequence, correctSequence)) { LK.getSound('Win_Level').play(); playerSequence = []; self.removeChild(cubeCorrupt); self.removeChild(cubeCorrupt2); self.addChild(cubeCorrect); isCubeCorrect = true; if (!levels[8].documentGrid.hasReplaced) { levels[8].documentGrid.replaceRandomFileWith10111(); // Call the method to change a random file name in level 8 } } } }; }(button.buttonIndex); } }); var Lock = Container.expand(function () { var self = Container.call(this); var lockGraphics = self.attachAsset('Lock', { anchorX: 0.5, anchorY: 0.5, alpha: 0 // Set alpha to 0 to make it invisible }); }); //<Assets used in the game will automatically appear here> // Define the Level class var MainMenu = Container.expand(function () { var self = Container.call(this); // Attach the corresponding level asset as the background of the level // Reset tutorial assets to starting positions tutorialFace = self.attachAsset('Tutorial_Face', { anchorX: 0.0, anchorY: 1.0, x: tutorialFaceStartX, y: tutorialFaceStartPosition // Start below the screen }); tutorialTextBox = new Container(); var tutorialTextBoxGraphics = tutorialTextBox.attachAsset('Tutorial_Text_Box', { anchorX: 0.0, anchorY: 1.0, x: tutorialTextBoxStartX, y: tutorialTextBoxStartPosition // Start below the screen }); // Ensure tutorialTextBox is not visible at the start of level 0 tutorialTextBox.visible = false; self.addChild(tutorialTextBox); // Add event listener to unlock level 2 when level 0 is pressed self.down = function (x, y, obj) {}; }); var RestartButton = Container.expand(function () { var self = Container.call(this); var restartGraphics = self.attachAsset('Restart', { anchorX: 0.5, anchorY: 0.5 }); self.x = 2048 / 2; // Center horizontally self.y = 2732 / 2 + 1100; // Move 800 pixels lower self.down = function (x, y, obj) { LK.showGameOver(); // Trigger Game Over condition }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x161c27 //Init game with new background color }); /**** * Game Code ****/ function disableGrid() { var gridContainer = levels[6].children.find(function (child) { return child instanceof GridContainer; }); if (gridContainer) { gridContainer.gridManager.grid.forEach(function (row) { row.forEach(function (cell) { if (cell.asset) { cell.asset.interactive = false; // Disable interaction on all grid cells } }); }); gridContainer.interactive = false; // Disable interaction on the grid container itself gridContainer.gridManager.gridInteractionEnabled = false; // Disable grid interaction logic tween.stop(gridContainer); // Stop any pending animations on the grid container } } var isDigit3Enabled = false; // Initialize the state of digit '3' on the keypad in level 4 var isDigit1Enabled = false; // Initialize the state of digit '1' on the keypad in level 4 var isDigit9Enabled = false; // Initialize the state of digit '9' on the keypad in level 4 //{0.1} var bugSpawnCount = 0; // Initialize bug spawn counter var retryButton; // Declare retryButton in the global scope var level6Completed = false; // Flag to ensure grid-disabling logic executes only once //{0.1} var connectionsMade = 0; // Initialize connectionsMade to track successful connections function updateLEDState(ledIndex, isLit) { var ledContainer = levels[6].children.find(function (child) { return child.id === 'ledContainer'; // Unique identifier }); if (ledContainer) { // Update the specific LED's alpha ledContainer.children[ledIndex].alpha = isLit ? 1.0 : 0.5; // Check if all LEDs are lit and the level hasn't been completed yet var allLit = ledContainer.children.every(function (led) { return led.alpha === 1.0; }); if (allLit && !level6Completed) { level6Completed = true; // Prevent re-triggering LK.getSound('Win_Big').play(); // Play the Win_Big sound unlockApp(11); // Unlock App 11 console.log("Level 6 Completed: All LEDs are lit."); disableGrid(); // Call the function to disable grid interaction // Add overlay layer var overlay = LK.getAsset('level6', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2, alpha: 0, // Set alpha to 50% scaleX: 1, // Maintain original size scaleY: 0.6 // Maintain original size }); overlay.interactive = true; // Make overlay interactive to block interactions behind it overlay.down = function (x, y, obj) { LK.getSound('Wrong').play(); // Play the 'Wrong' sound when overlay is tapped }; levels[6].addChild(overlay); } } } var buttonsPressed = 0; // Initialize buttonsPressed to track the number of button presses //{0.1} var ButtonPressManager = function ButtonPressManager(totalButtons, soundId) { this.totalButtons = totalButtons; this.soundId = soundId; this.pressedCount = 0; }; ButtonPressManager.prototype.buttonPressed = function () { this.pressedCount++; if (this.pressedCount === this.totalButtons) { LK.getSound(this.soundId).play(); if (levels[3] && levels[3].visible) { isDigit3Enabled = true; // Enable digit '3' on the keypad in level 4 } // unlockApp(8); // Removed unlocking of App 8 when all buttons are pressed } }; ButtonPressManager.prototype.reset = function () { this.pressedCount = 0; }; var toggleIconX = 400; // Global variable for toggle icon x-coordinate // Add new sound asset 'File' // Replace 'toggle_on_image_id' with actual image ID // Replace 'toggle_off_image_id' with actual image ID function generateRandomScrambledText() { var letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; var digits = '0123456789'; var textLength = 20; // Fixed length of 20 var scrambledText = ''; // Generate a guaranteed chunk of 4 consecutive random digits var digitChunk = ''; for (var i = 0; i < 4; i++) { var randomDigitIndex = Math.floor(Math.random() * digits.length); digitChunk += digits[randomDigitIndex]; } // Insert the digit chunk at a random position in the scrambled text var insertPosition = Math.floor(Math.random() * (textLength - 4)); for (var i = 0; i < textLength; i++) { if (i === insertPosition) { scrambledText += digitChunk; i += 3; // Skip the next 3 positions as they are filled by digitChunk } else if (i % 2 === 0) { var randomIndex = Math.floor(Math.random() * letters.length); scrambledText += letters[randomIndex]; } else { var randomDigitIndex = Math.floor(Math.random() * digits.length); scrambledText += digits[randomDigitIndex]; } } return scrambledText; } function handleFileClick(file) { if (file.fileName === "10111") { if (file.unlocked === true) { Code_Display.setText("Phone PIN Code: 74#9"); if (!file.soundPlayed) { file.removeChildren(); // Remove all current graphics var fileOpenGraphic = LK.getAsset('File_Open', { anchorX: 0.5, anchorY: 0.5 }); file.addChildAt(fileOpenGraphic, 0); // Add the new File_Open graphic // Re-add the file name text to ensure it remains visible var fileNameText = new Text2("10111", { size: 50, fill: 0x000000 }); fileNameText.anchor.set(0.5, 0); fileNameText.y = fileOpenGraphic.height / 2 + 10; // Position below the file, maintaining consistent spacing file.addChild(fileNameText); // Check if the sound has already been played LK.getSound('Win_Level').play(); // Play 'Win_Level' sound when the 10111 file is clicked and unlocked file.soundPlayed = true; // Set flag to true after playing the sound isDigit9Enabled = true; // Enable digit '9' on the keypad in level 4 } } else { Code_Display.setText("Locked: Complete level 9 to unlock."); } } else { Code_Display.setText(file.randomCode); } // Access file properties and perform actions console.log("Handling file click for:", file.children[0].text); // Additional logic for handling file click can be added here } function shuffleArray(array) { for (var i = array.length - 1; i > 0; i--) { var j = Math.floor(Math.random() * (i + 1)); var temp = array[i]; array[i] = array[j]; array[j] = temp; } return array; } // Define Code_Display in the global scope for accessibility var Code_Display; // Function to reset app button visibility based on the active level function resetAppButtonVisibility() { for (var j = 0; j < levelButtons.length; j++) { levelButtons[j].visible = levels[0].visible && (j < 2 || hiddenAppsVisible); } } //{0.1} // Store random codes for each file var fileCodes = {}; var GridManager = function GridManager(gridSize) { this.gridSize = gridSize; this.grid = Array.from({ length: gridSize }, function (_, rowIndex) { return Array.from({ length: gridSize }, function (_, colIndex) { return { cellType: 'Cell_Empty', row: rowIndex, col: colIndex }; }); }); if (Math.random() < 0.5) { this.startCell = { row: 0, col: 0 }; this.goalCell = { row: gridSize - 1, col: gridSize - 1 }; } else { this.startCell = { row: 0, col: gridSize - 1 }; this.goalCell = { row: gridSize - 1, col: 0 }; } // Initialize grid with default state this.grid[this.startCell.row][this.startCell.col] = { cellType: 'Cell_Occupied' }; this.grid[this.goalCell.row][this.goalCell.col] = { cellType: 'Cell_Occupied' }; // Place random bugs this.placeRandomBugs(Math.floor(Math.random() * 3) + 1); }; GridManager.prototype.placeRandomBugs = function (numberOfBugs) { var emptyCells = []; for (var r = 0; r < this.gridSize; r++) { for (var c = 0; c < this.gridSize; c++) { if (this.grid[r][c].cellType === 'Cell_Empty') { emptyCells.push({ row: r, col: c }); } } } if (emptyCells.length < numberOfBugs) { numberOfBugs = emptyCells.length; // Adjust number of Bugs if fewer empty tiles exist } shuffleArray(emptyCells); var selectedBugs = emptyCells.slice(0, numberOfBugs); selectedBugs.forEach(function (cellPosition) { var r = cellPosition.row; var c = cellPosition.col; this.grid[r][c].cellType = 'Cell_Bug'; if (this.grid[r][c].asset) { this.grid[r][c].asset.interactive = false; // Disable interaction on the cell } LK.getSound('Click').play(); // Play the 'Click' sound when a new bug spawns bugSpawnCount++; // Increment bug spawn counter if (bugSpawnCount >= 10) { retryButton.visible = true; // Make retry button visible retryButton.interactive = true; // Enable interaction } }, this); }; GridManager.prototype.getGrid = function () { return this.grid; }; GridManager.prototype.getStartCell = function () { return this.startCell; }; GridManager.prototype.getGoalCell = function () { return this.goalCell; }; var level0Animation = new Level0Animation(); game.addChild(level0Animation); level0Animation.playAnimation(); var currentInput = ''; // Initialize currentInput variable to store user input // Initialize button states // Initialize background music LK.playMusic('backgroundMusic'); // Retrieve the highest score from storage or initialize it to 0 var highestScore = storage.highestScore; //{0.1} //{0.1} // New asset for buttons in level 4 // Add new sound asset for 'Wrong' var BatteryBlink = function BatteryBlink(textObject) { this.textObject = textObject; }; BatteryBlink.prototype.start = function () { var _this4 = this; tween(this.textObject.scale, { x: 1.25, y: 1.25 }, { duration: 100, easing: tween.easeInOut, onFinish: function onFinish() { tween(_this4.textObject.scale, { x: 1, y: 1 }, { duration: 100, easing: tween.easeInOut }); } }); }; function unlockApp(appNumber) { // Update App's visual state var appButton = levelButtons[appNumber - 1]; // App index is appNumber - 1 appButton.children[0].destroy(); // Remove the existing locked icon var appIcon = appButton.attachAsset('App_' + appNumber, { anchorX: 0.5, anchorY: 0.5 }); // Attach new App's icon appButton.addChildAt(appIcon, 0); // Add the new icon at the first position appButton.children[1].setText(appNames[appNumber - 1]); // Update text to app's name appButton.interactive = true; // Enable interactivity // Update game state buttonStates['button_' + appNumber] = false; // Mark App as unlocked } // New asset for locked apps // Initialize sound effect Call_4 // Initialize sound effect Call_3 // Initialize sound effect Call_2 // Initialize sound effect Call_1 var appNames = ["Ransomware.exe", "Settings", "Galaxoid", "Safe Storage", "Voice Recorder", "Virus Wars", "Gridlock", "Binary Files", "Cube Cracker", "Photo10110.JPG", "JOIN_US.org", "Reboot"]; var sequenceButtons = []; // Define sequenceButtons array in the global scope var isCubeCorrect = false; // Initialize isCubeCorrect to track cube state var hiddenAppsVisible = false; // Initialize visibility state for Apps 4-12 //{0.1} function compareSequences(seq1, seq2) { if (seq1.length !== seq2.length) { return false; } for (var i = 0; i < seq1.length; i++) { if (seq1[i] !== seq2[i]) { return false; } } return true; } var uiBar = LK.getAsset('UI_Bar', { anchorX: 1.0, anchorY: 0.0, scaleX: 2048 / 2400, // Scale to fit the screen width x: 2048 / 2 - 300, y: -10 // Position at the top of the screen }); LK.gui.top.addChild(uiBar); function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) { return t; } var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) { return i; } throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function animateTutorialAsset(asset, startPosition, restPosition) { asset.y = startPosition; // Ensure it starts at the correct position tween(asset, { y: restPosition }, { duration: ANIMATION_DURATION, easing: tween.easeInOut, onFinish: function onFinish() { LK.setTimeout(function () { tween(asset, { y: startPosition }, { duration: ANIMATION_DURATION, easing: tween.easeInOut }); }, REST_DURATION); } }); } // Define global animation duration variables var ANIMATION_DURATION = 1000; var REST_DURATION = 7000; // Duration for how long the assets stay in the resting position var tutorialTextBoxStartX = 0; // Starting x position for tutorialTextBox // Change the height to 200 to make the button square var tutorialFaceStartX = 0; // Starting x position for tutorialFace var tutorialFaceStartPosition = 4200; // Below screen var tutorialTextBoxStartPosition = 3000; // Below screen var tutorialFaceRestPosition = 2900; // Resting position for tutorialFace var tutorialTextBoxStartY = 1000; // Starting y position for tutorialTextBox var tutorialTextBoxRestPosition = 800; // Resting position for tutorialTextBox // Define tutorialFace and tutorialTextBox globally var tutorialFace; var tutorialTextBox; var isAnimating = false; var score = 0; var level = 1; var maxLevels = 12; var hero = { x: 0, y: 0 }; // Define the hero object var batteryPercentage = 101; var depletionRate = 0.2; // Increase depletion rate to drain battery faster var batteryTxt = new Text2(batteryPercentage + '%', { size: 50, fill: 0x000000 }); batteryTxt.anchor.set(0.5, 0.5); batteryTxt.x = 420; // Move 400 pixels to the right batteryTxt.y = 90; // Move 100 pixels lower LK.gui.top.addChild(batteryTxt); function updateBattery() { batteryPercentage -= depletionRate / 60; // Deplete based on 60 FPS if (batteryPercentage <= 0) { batteryPercentage = 0; transitionToLevel12(); } batteryTxt.setText(Math.floor(batteryPercentage) + '%'); } function transitionToLevel12() { for (var i = 0; i < levels.length; i++) { levels[i].visible = false; } levels[11].visible = true; // Level 12 is at index 11 playerSequence = []; // Reset the puzzle state // Simulate app_12 button press if (levelButtons[11]) { levelButtons[11].down(); } } game.update = function () { updateBattery(); }; // Function to handle move events function handleMove(x, y, obj) { hero.x = x; hero.y = y; } // Initialize button states var buttonStates = { button_1: false, // Unlocked button_2: true, // Locked button_3: false, // Unlocked button_4: false, // Unlocked button_5: true, // Locked button_6: true, // Unlocked // Locked button_7: true, // Locked button_8: true, // Locked button_9: true, // Locked button_10: true, // Locked button_11: true, // Locked button_12: true // Locked }; // Initialize the levels var levels = []; var mainMenu = new MainMenu(); levels.push(mainMenu); game.addChild(mainMenu); for (var i = 0; i < maxLevels; i++) { var level; if (i + 1 === 9) { level = new Level9(); } else { level = new Level(i + 1); } levels.push(level); game.addChild(level); } // Hide all levels except the first one for (var i = 1; i < levels.length; i++) { levels[i].visible = false; } // Create the debug menu buttons var levelButtons = []; for (var i = 0; i < maxLevels; i++) { var buttonAsset = buttonStates['button_' + (i + 1)] ? 'App_Locked' : 'App_' + (i + 1); var button = new Button(i + 1, buttonAsset); button.interactive = !buttonStates['button_' + (i + 1)]; var buttonGap = 600; // Increase the gap between buttons by 100 pixels button.x = 1024 + (i % 3 - 1) * buttonGap + (i === 11 ? 900 : 0); // Move app 12, 200 pixels to the right button.y = 1366 - 200 + (Math.floor(i / 3) - 1) * buttonGap; // Use the global variable for the gap between buttons vertically button.visible = i < 2 || hiddenAppsVisible; // Ensure the first two buttons are visible initially game.addChild(button); levelButtons.push(button); } for (var i = 1; i < levels.length; i++) { // Start from 1 to skip level 0 if (i !== 12 && i !== 11) { // Skip adding back button to level 12 and level 11 var backButton = new BackButton(); backButton.x = 2048 / 2; backButton.y = 2732 - 200; levels[i].addChild(backButton); } } // Set up event listeners game.move = handleMove; game.down = handleMove; game.up = function (x, y, obj) { // No action needed on up event resetAppButtonVisibility(); }; Container.prototype.intersects = function (other) { var a = this.getBounds(); var b = other.getBounds(); return a.x < b.x + b.width && a.x + a.width > b.x && a.y < b.y + b.height && a.y + a.height > b.y; }; function shuffleAndReassignSettings() { var settings = self.settingsContainer.children; var shuffledSettings = shuffleArray(settings); shuffledSettings.forEach(function (setting, index) { setting.y = 2732 / 2 - 600 + index * 200; // Reassign y position based on new index self.settingsContainer.addChild(setting); // Re-add to container to update order }); }
===================================================================
--- original.js
+++ change.js
@@ -2192,9 +2192,9 @@
button_4: false,
// Unlocked
button_5: true,
// Locked
- button_6: false,
+ button_6: true,
// Unlocked
// Locked
button_7: true,
// Locked
@@ -2203,9 +2203,9 @@
button_9: true,
// Locked
button_10: true,
// Locked
- button_11: false,
+ button_11: true,
// Locked
button_12: true // Locked
};
// Initialize the levels
A hologram projection of a rebel secret agent bust, with a futuristic cyberpunk style. The agent is a confident woman in a rugged yet high-tech suit, adorned with subtle anarchist symbols and glowing blue accents. Her look conveys authority and high rank within an underground rebel group, with a determined and defiant expression as she gives hacking instructions to the player.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A background for a game over screen, depicting a mobile phone UI with a depleted battery at 0%. The screen features bold red and yellow colors, creating a sense of urgency and tension. A large, flashing battery icon with a red '0%' and a warning triangle is prominently displayed. The UI includes glitch effects, cracks, or distortion to suggest the phone has been overcharged and malfunctioned. The background is filled with subtle warning messages and symbols in red and yellow tones, enhancing the dramatic and high-stakes atmosphere. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A square app store icon with rounded edges, designed for a Contacts List app with a subtle futuristic touch. The icon features a clean human avatar face in the center, outlined with smooth lines and a soft glow. The avatar is wearing a minimalist headset, hinting at communication functionality. The background is a gradient of deep blue to teal, with faint light effects to suggest a modern and slightly futuristic aesthetic. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A square app store icon with rounded edges, designed for an Encrypted Code File app. The icon features a clean and minimalistic file graphic in the center, with a padlock symbol overlaying it to indicate encryption. Subtle code lines or binary patterns are faintly visible on the file for a modern touch. The background is a gradient of dark blue to teal, with a soft glow around the edges, conveying security and advanced technology while keeping the design clean and professional.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A square app store icon with rounded edges, designed for a Calculator app. The icon features a sleek and minimalistic calculator graphic in the center, with clean, simple buttons and a glowing equals sign (=) to highlight its function. The background is a gradient of soft grey to blue, with a subtle hint of light effects to suggest a modern and slightly futuristic aesthetic, while maintaining a clean and professional design. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A square app store icon with rounded edges, designed for a Settings app. The icon features a simple gear symbol in the center, cleanly outlined with smooth lines. The background is a gradient of grey to dark blue, with a subtle glow around the gear, maintaining a modern and minimalistic aesthetic.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A square app store icon with rounded edges, designed for a Reboot Warning app. The icon features a circular arrow symbol in the center, paired with a small warning triangle to indicate urgency. The background is a gradient of red to orange, creating a sense of caution while keeping the design clean and modern.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A square app store icon with rounded edges, designed for a WIN screen app. The icon features a simple trophy or star symbol in the center, glowing softly to signify achievement. The background is a gradient of gold to yellow, giving the icon a celebratory yet minimalistic look. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A square app store icon with rounded edges, designed for a Picture File app. The icon features a basic landscape graphic in the center, showing a simple mountain and sun design. The background is a gradient of light green to blue, keeping the aesthetic clean and visually appealing. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A full-screen background depicting a corrupted device overtaken by a ransomware message. The screen is dominated by a bold, alarming warning message in red and white text, with phrases like 'Your device has been locked!' and 'Pay to unlock your files!' prominently displayed. The background is dark, with digital glitch effects, static noise, and distorted text adding to the sense of corruption. Subtly embedded within the chaotic design is a hidden encrypted code, integrated into the distortion or glitch patterns, making it challenging to notice at first glance. The overall aesthetic is tense, urgent, and visually striking, fitting the theme of a high-tech device under attack.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A very simple and minimalistic white key symbol, designed with clean lines and no additional details. The key has a basic rectangular shaft with a small circular head and a single notch, all in a flat white design. The style is subtle and understated, focusing on simplicity and clarity.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Create an isometric 3D holographic cube resembling a Rubik's cube. The cube should display the top face and two adjacent side faces, each divided into a 3x3 grid of cells. Each cell must contain either a '1' or a '0' in a glowing cyan-blue monospace font, clearly visible on all three visible faces. A few specific cells across the cube should stand out with their binary digits ('1' or '0') highlighted in bright red. The entire cube should have a holographic look, with glowing gridlines separating the cells and a subtle flicker effect. Ensure the cube appears suspended in mid-air, projecting from a base below, with soft lighting and a sci-fi ambiance.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A sleek game controller inspired by a PlayStation design, viewed from a front perspective. On the left side, there is a cluster of four directional arrow buttons arranged in a cross pattern. On the right side, four distinct circular buttons are arranged in a diamond shape, each with a unique symbol: a blue button with a simple 'X', a red button with a 'O', a green button with a triangle, and a pink button with a square. The controller itself is ergonomic, with a clean and modern design, featuring a matte black surface and subtle accents for a polished and professional gaming aesthetic.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A clean and minimalistic interface for a voice recorder app, featuring a 2x2 grid layout. Each grid square represents a recording file, displayed as large, distinct tiles. Each tile includes a simple circular play button in the center, with a subtle waveform icon or progress bar beneath it to represent the audio. The background is a soft gradient of light grey to white, ensuring clarity and focus on the files. The design is modern and functional, with smooth edges and a clean UI aesthetic for a professional and user-friendly experience.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A square app store icon with rounded edges, designed for a Cube Cracking app. The icon features an isometric Rubik's cube in the center, with one side glowing in simple neon blue lines, inspired by Tron, and the opposite side subtly tinted red, with minimal cracks to suggest corruption. The background is a clean gradient of dark grey to black, with a faint glow emanating from the cube's edges. The design remains sleek and minimal, focusing on the contrast between the orderly blue side and the corrupted red side. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A clean and minimalistic game interface for a Galaxian-inspired game, viewed flat and straight from the front as a mobile app UI. At the bottom of the screen is a sleek, centrally aligned starship designed to fire single projectiles upward. The background features a simple, dark space theme with scattered stars and soft gradients, maintaining a futuristic yet uncluttered aesthetic. At the top of the screen, coins are arranged in an 8-column by 4-row grid formation, resembling a classic bug-like pattern. Among these, four consecutive coins in the central row are replaced with glowing red digits '3,' '6,' '9,' and '8,' positioned prominently. These digits are larger, brighter, and pulse subtly, making them stand out distinctly from the neutral-colored coins while remaining seamlessly integrated into the grid. The clean layout highlights the digits' importance while keeping the overall design sleek and user-friendly. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A square app store icon with rounded edges, designed for a Galaxian-inspired game. The icon features the classic shape of a Galaxian enemy in the center, rendered with clean, sharp lines and a subtle glow around its edges. The background is a gradient of deep space blue to black, with faint stars scattered throughout, evoking the feel of a cosmic battlefield. The design is sleek and minimal, balancing nostalgia with a modern touch, making it instantly recognizable and visually appealing. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Design a clean and minimalistic landscape-oriented mobile phone interface inspired by Star Wars, adhering to user-friendly web design principles. The frame has a sleek, weathered industrial aesthetic with rounded edges and a muted metallic finish. The screen is completely empty, providing a clean and open space. At the bottom of the HUD, align four large buttons in a simple, straight row. Each button features a unique, bold shape: a triangle, a square, an X, and a star. The buttons are evenly spaced, brightly colored (e.g., red, green, blue, yellow), and have a subtle glow with smooth, tactile designs to make them visually distinct and user-friendly. The background incorporates faint industrial details, such as subtle panel lines or rivets, to reinforce the Star Wars aesthetic without overwhelming the design. The interface balances functionality and thematic style while maintaining a minimalist and intuitive layout focused on the aligned button array.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
futuristic button with the text saying "RESTART". drawn as a 2D user interface element. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Grey-Tinted Tile: A minimalist and futuristic tile design for a Sudoku game, featuring a perfect square with a smooth, clean surface. The tile has a soft gradient, starting with a light grey center that transitions to a slightly darker grey near the edges, giving it depth and sophistication. A thin, faintly glowing silver-grey border surrounds the tile, adding a subtle futuristic touch while maintaining a sleek and clean appearance. The surface remains blank and ready for interaction.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Blue-Tinted Tile: A clean and sleek tile design, consisting of a perfect square with a soft blue surface. A barely noticeable, thin blue border defines the edges, maintaining a smooth and minimal aesthetic. The tile is blank and pristine, embodying futuristic simplicity. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A square app store icon with rounded edges, featuring a sleek and minimalistic Sudoku-inspired design. The icon showcases a simplified 3x3 section of a Sudoku grid in the center, with clean, thin lines dividing the squares. The background features a gradient of soft gray and white, subtly transitioning to create depth and a polished look. Around the edges, a faint glow or highlight enhances the modern and futuristic aesthetic. The design remains clean and user-friendly, with light accents that give the grid a crisp, high-tech feel while maintaining a minimalist aesthetic.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A clean mobile app interface designed to display photos from a user’s phone, with a retro aesthetic for the displayed image. The screen showcases a single black-and-white photo, styled to mimic a grainy 90s film capture. The photo shows a young man in his 30s, sitting in an office chair and looking surprised at the camera as if caught off guard. The office environment is cluttered with retro elements like a CRT monitor, stacks of papers, a desk lamp, and a vintage rotary phone. The monitor subtly displays binary code '1011,' hidden among other on-screen data. The photo frame has faint edges, resembling a classic film border, with subtle scratches and grain to enhance the retro feel. The app interface itself is minimal, with a back arrow at the top-left and a small menu icon at the top-right, keeping the focus on the photograph.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Create a square app store icon with rounded corners, specifically designed for a 'Locked' application. Center the icon with a sleek and minimalist padlock symbol to clearly represent security and protection. Overlay the padlock on a subtle file or document graphic to signify locked or encrypted files. Incorporate faint lines of code or binary digits within the file graphic to add a modern, tech-savvy touch. Use a background gradient transitioning from deep crimson to dark burgundy, creating a sense of urgency and protection. Add a soft red glow around the icon's edges to emphasize security and advanced technology, ensuring the overall design remains clean, professional, and visually striking. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A clean and functional browser UI displaying an illegal hacking website. The page uses a light, minimalist theme with a subtle grey and white color palette to mimic a legitimate site. The main content area features a grid layout of discreetly labeled icons, each representing hacking tools, scripts, or encrypted data for sale, blending in as if it were a professional tech page. In the top-left corner, a small visual cue, such as an encrypted symbol or a faintly styled link, hints at the site's true purpose without drawing too much attention. The interface is designed to look deceptively ordinary, with clean lines, clear fonts, and minimal decorative elements, giving the appearance of a legitimate web application while concealing its illicit nature. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Blue-Tinted Tile: A clean and sleek tile design, consisting of a perfect square with a soft blue surface. A barely noticeable, thin blue border defines the edges, maintaining a smooth and minimal aesthetic. The tile is blank and pristine, embodying futuristic simplicity.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
green-Tinted Tile: A clean and sleek tile design, consisting of a perfect square with a soft neon green surface. A barely noticeable, thin green border defines the edges, maintaining a smooth and minimal aesthetic. The tile is blank and pristine, embodying futuristic simplicity.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Bug Tile: A clean and sleek square tile with a soft red surface, subtly tinted to evoke a futuristic aesthetic. A barely noticeable, thin red border defines the edges, giving it a polished and minimal appearance. Within the tile, faintly visible and almost imperceptible, is the outline of a bug seen from above, blending seamlessly with the red surface. The design maintains a pristine and subtle aesthetic, representing a hidden bug tile within a computer system. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Blue-Tinted Tile: A clean and sleek tile design, consisting of a perfect square with a soft blue surface. A barely noticeable, thin blue border defines the edges, maintaining a smooth and minimal aesthetic. The tile is blank and pristine, embodying futuristic simplicity.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A square app store icon with rounded edges, designed for a hacking game about connecting a line. The icon features a highly angular, pixelated snake-like line in bright green, built from sharp, connected shapes aligned perfectly within a square grid. The snake's angular, segmented design conveys the strategic and technological theme of the game. The background is a subtle dark gradient, transitioning from deep grey to black, with faint grid lines barely visible to suggest a digital environment. Scattered subtly in the background are tiny red dots, representing bugs, blending seamlessly into the design without overpowering the focus on the snake. The overall look is clean, modern, and sharp, embodying the futuristic and technical essence of the game.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A minimalist UI website icon for a retro hacking app, representing a text-based file. The icon is a simple rectangular shape with a slightly folded corner at the top-right, rendered in a clean, pixel-art style. A few green binary digits ('0' and '1') are subtly displayed across the surface in a small, stylized font, blending seamlessly with the retro theme. The design is stripped down to essential elements, using a monochromatic palette with a soft green glow to evoke the feel of a classic hacking interface. The overall look is clean, minimalist, and perfectly aligned with a retro tech aesthetic.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A square folder icon with rounded edges, designed to represent a storage app for binary files. The folder graphic in the center is smooth and minimalistic, featuring faint, glowing neon accents in matrix green to suggest a post-apocalyptic and tech-savvy theme. Subtle rows of binary digits ('0' and '1') are faintly integrated into the folder's surface, blending seamlessly with the design. The background is a clean gradient transitioning from dark grey to soft teal, evoking a sense of advanced technology and digital precision. The overall appearance is sleek, professional, and minimalistic, making it suitable as a 2D game asset with a blank, high-contrast background and no shadows.
A POV perspective of a retro-futuristic handheld device, its screen glowing softly with greenish-blue digital patterns. The design features a blocky, cyberpunk aesthetic with subtle neon accents along the edges and small, glowing symbols etched into the surface. Chains around the device are mid-shatter, breaking into faintly glowing fragments that drift away, symbolizing its freedom. The screen flickers with faint digital animations, hinting at its restored functionality without being overly complex. The hand holding the device is faintly lit by the neon glow, with the background melting into a dim, urban cyberpunk haze, emphasizing the sleek yet gritty retro-futuristic vibe.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A minimalist UI website icon for a retro hacking app, representing a WiFi connection. The icon features a simple pixel-art style signal symbol with three curved bars radiating outward in blue, evoking a classic WiFi logo. The bars are cleanly rendered with subtle gradients for depth, while a soft neon blue glow surrounds the design to emphasize the cyberpunk aesthetic. The background is dark and minimal, with a faint grid pattern barely visible, aligning with the retro-futuristic theme. The overall design is clean, functional, and perfectly suited for a retro hacking interface. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
futuristic video game green long rectangle button with the text saying "RESTART". Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A green, elongated rectangular button designed for a video game UI, viewed straight from the front. The button has a muted neon green surface with a soft, subtle glow, giving it a retro-punk futuristic vibe without overwhelming brightness. The edges are slightly rounded, with a faint cyan outline that adds a touch of depth and complements the design. Centered on the button, the word 'RESTART' appears in a bold, pixel-art font with a faint white outline, ensuring it remains clear and readable. The background is simple and minimal, with a subtle grid texture lightly visible on the button's surface to maintain the retro-futuristic aesthetic without excess glare. The overall design is clean and balanced, perfect for an immersive gaming interface.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Win_Level
Sound effect
Call_1
Sound effect
Call_2
Sound effect
Call_3
Sound effect
Call_4
Sound effect
Click
Sound effect
Wrong
Sound effect
Back
Sound effect
backgroundMusic
Music
File
Sound effect
Hide
Sound effect
Win_Big
Sound effect
Restart
Sound effect
Voice_Message
Sound effect
Sound_Lock
Sound effect
Sound_Galaxoid
Sound effect
Sound_Sudoku
Sound effect
Sound_Cube
Sound effect
Sound_Virus
Sound effect
Sound_Photo
Sound effect
Sound_Folder
Sound effect
Sound_Recorder
Sound effect
Sound_Win
Sound effect