User prompt
Update as needed with: // Update cursor position calculation function updateCursorPosition() { if (!gameState.logText || !gameState.cursor) { return; } var lastLogEntry = gameState.terminal.log[gameState.terminal.log.length - 1] || ""; var lastLine = lastLogEntry.split("\n").pop(); var textWidth = lastLine.length * 14 * TEXT_SIZE_MULTIPLIER; gameState.cursor.x = 50 + textWidth; var totalLines = 0; gameState.terminal.log.forEach(function(entry) { totalLines += entry.split("\n").length + 1; }); // Adjust cursor Y position based on new terminal positioning var baseY = 2732 * 0.15; // Match terminal output Y position gameState.cursor.y = baseY + (totalLines - 1) * 30 * TEXT_SIZE_MULTIPLIER; }
User prompt
Update as needed with: // Updated button creation with dynamic width function createCommandButton(text, callback, width) { var button = new Container(); // Add button background with dynamic width var bg = LK.getAsset('buttonBg', { width: width, height: 100, color: 0x333333 }); bg.anchor.set(0.5, 0.5); button.addChild(bg); // Add text var textObj = new Text2(text, { size: 30 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00 }); textObj.anchor.set(0.5, 0.5); button.addChild(textObj); // Make interactive button.interactive = true; button.down = function() { button.scale.set(0.95); }; button.up = function() { button.scale.set(1); if (callback) { callback(); } }; return button; }
User prompt
Update as needed with: // Update command prompts with dynamic sizing and adjusted positioning function createCommandPrompts() { if (gameState.promptContainer) { game.removeChild(gameState.promptContainer); } var promptContainer = new Container(); promptContainer.x = 2048 / 2; promptContainer.y = 2732 * 0.75; // Moved to 75% from top game.addChild(promptContainer); gameState.promptContainer = promptContainer; // Get current command set and select 5 random commands var commands = getCurrentCommands(); var availableCommands = shuffleArray(commands).slice(0, 5); // Create END DAY button with dynamic width var endDayText = "END DAY"; var endDayWidth = calculateButtonWidth(endDayText); var endDayButton = createCommandButton(endDayText, function() { endDay(); }, endDayWidth); endDayButton.x = 600; endDayButton.y = 50; promptContainer.addChild(endDayButton); // Create command buttons with dynamic widths availableCommands.forEach(function(command, index) { var buttonText = ">" + command.text; var buttonWidth = calculateButtonWidth(buttonText); var button = createCommandButton(buttonText, function() { if (gameState.commandsUsed < 3) { executeCommand(command); } else { addToTerminalLogWithEffect("ERROR: Maximum commands (3) already used for today"); } }, buttonWidth); button.x = -600; button.y = 50 + index * 120; promptContainer.addChild(button); }); }
Code edit (1 edits merged)
Please save this source code
User prompt
Update with: function createTerminal() { // Create main terminal container var terminal = new Container(); game.addChild(terminal); gameState.terminalContainer = terminal; // Create full screen background - moved down 5% var bg = LK.getAsset('terminalBg', { width: 2048, height: 2732, x: 0, y: 2732 * 0.05 // Move down 5% }); terminal.addChild(bg); // Create status line - moved down additional 5% var statusLine = new Text2("", { size: 30 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00 }); statusLine.x = 50; statusLine.y = 2732 * 0.10; // Moved to 10% from top terminal.addChild(statusLine); gameState.statusLineText = statusLine; // Create main terminal output - adjusted accordingly var logText = new Text2("", { size: 24 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00, align: 'left', wordWrap: true, wordWrapWidth: 1900 }); logText.x = 50; logText.y = 2732 * 0.15; // Moved to 15% from top terminal.addChild(logText); gameState.logText = logText; // Create blinking cursor with adjusted position var cursor = new Text2("_", { size: 24 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00 }); cursor.x = logText.x; cursor.y = logText.y; terminal.addChild(cursor); gameState.cursor = cursor; LK.setInterval(function() { cursor.visible = !cursor.visible; }, 500); }
Code edit (2 edits merged)
Please save this source code
User prompt
Add: function shuffleArray(array) { for (let i = array.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [array[i], array[j]] = [array[j], array[i]]; } return array; }
User prompt
Update with: function getCurrentCommands() { var availableCommands = []; // Add base commands availableCommands = availableCommands.concat(commandSets.initial); // Add platform-specific commands if (gameState.conceptCards.platform) { var platformCommands = commandSets['platform_' + gameState.conceptCards.platform.toLowerCase()]; if (platformCommands) { availableCommands = availableCommands.concat(platformCommands); } } // Add combination-specific commands if (gameState.conceptCards.platform && gameState.conceptCards.visual) { var combinationKey = gameState.conceptCards.platform + "_" + gameState.conceptCards.visual; var combinationSet = combinationCommands[combinationKey]; if (combinationSet) { availableCommands = availableCommands.concat(combinationSet); } } // Add day-specific commands if (gameState.day > 5) { availableCommands = availableCommands.concat(getLateGameCommands()); } return availableCommands; }
User prompt
Add: var combinationCommands = { "VR_ASCII": [ { text: "Implement 3D text rendering", response: "Converting ASCII to volumetric data...", vibePoints: 15, coherenceImpact: 20, bugChance: 0.4 }, { text: "Add depth perception", response: "Calculating character z-index...", vibePoints: 10, coherenceImpact: 15, bugChance: 0.3 } // Add more specific combinations ] };
User prompt
Update as needed with: var commandSets = { initial: [ // Basic commands { text: "Make it run faster", response: "Attempting to accelerate undefined systems...", vibePoints: 10, coherenceImpact: 15, bugChance: 0.3 }, { text: "Optimize code flow", response: "Restructuring algorithmic pathways...", vibePoints: 15, coherenceImpact: 10, bugChance: 0.2 }, { text: "Debug system", response: "Scanning for anomalies...", vibePoints: 5, coherenceImpact: 5, bugChance: 0.1 }, { text: "Implement AI assistance", response: "WARNING: AI recursion detected", vibePoints: -5, coherenceImpact: 20, bugChance: 0.4 }, { text: "Refactor codebase", response: "Restructuring core systems...", vibePoints: 20, coherenceImpact: 25, bugChance: 0.5 }, { text: "Apply design patterns", response: "Implementing architectural frameworks...", vibePoints: 15, coherenceImpact: 15, bugChance: 0.3 }, { text: "Enable quantum computing", response: "ERROR: Quantum decoherence detected", vibePoints: -10, coherenceImpact: 30, bugChance: 0.6 } ], // Platform-specific commands platform_vr: [ { text: "Reduce motion sickness", response: "Implementing anti-nausea protocols...", vibePoints: 15, coherenceImpact: 10, bugChance: 0.2 }, { text: "Enhance hand tracking", response: "Calibrating spatial recognition...", vibePoints: 20, coherenceImpact: 15, bugChance: 0.3 }, { text: "Add haptic feedback", response: "Integrating tactile response systems...", vibePoints: 10, coherenceImpact: 20, bugChance: 0.4 }, { text: "Optimize frame rate", response: "Adjusting refresh cycle timing...", vibePoints: 15, coherenceImpact: 15, bugChance: 0.3 }, { text: "Enable room scaling", response: "Calculating spatial dimensions...", vibePoints: 10, coherenceImpact: 25, bugChance: 0.4 }, { text: "Implement gesture controls", response: "Mapping kinetic inputs...", vibePoints: 15, coherenceImpact: 20, bugChance: 0.4 }, { text: "Add virtual mirrors", response: "WARNING: Reality recursion detected", vibePoints: -5, coherenceImpact: 30, bugChance: 0.6 } ] };
User prompt
Replace with: function createCommandPrompts() { // Clear existing prompts if (gameState.promptContainer) { game.removeChild(gameState.promptContainer); } // Create new prompt container var promptContainer = new Container(); promptContainer.x = 2048 / 2; promptContainer.y = 2732 * 0.7; game.addChild(promptContainer); gameState.promptContainer = promptContainer; // Get current command set var commands = getCurrentCommands(); // Randomly select 5 commands from the available pool var availableCommands = shuffleArray(commands).slice(0, 5); // Add END DAY button in fixed position var endDayButton = createCommandButton("END DAY", function() { endDay(); }); endDayButton.x = 600; endDayButton.y = 50; promptContainer.addChild(endDayButton); // Create clickable command buttons availableCommands.forEach(function(command, index) { var button = createCommandButton(">" + command.text, function() { if (gameState.commandsUsed < 3) { executeCommand(command); } else { addToTerminalLogWithEffect("ERROR: Maximum commands (3) already used for today"); } }); button.x = -600; button.y = 50 + index * 120; promptContainer.addChild(button); }); }
User prompt
Update as needed with: function createCommandPrompts() { // Clear existing prompts if (gameState.promptContainer) { game.removeChild(gameState.promptContainer); } // Create new prompt container and center it horizontally var promptContainer = new Container(); promptContainer.x = 2048 / 2; // Center the container horizontally promptContainer.y = 2732 * 0.7; game.addChild(promptContainer); gameState.promptContainer = promptContainer; // Create command background centered on container var commandBg = LK.getAsset('buttonBg', { width: 2048, height: 2732 * 0.3, anchorX: 0.5, // Center the background color: 0x111111 }); promptContainer.addChild(commandBg); // Get current command set var commands = getCurrentCommands(); // Add END DAY button first in fixed position var endDayButton = createCommandButton("END DAY", function() { endDay(); }); endDayButton.x = 600; // Position relative to container center endDayButton.y = 50; promptContainer.addChild(endDayButton); // Create clickable command buttons with proper spacing commands.forEach(function(command, index) { var button = createCommandButton(">" + command.text, function() { executeCommand(command); }); button.x = -300; // Position relative to container center button.y = 50 + (index * 120); promptContainer.addChild(button); }); }
Code edit (1 edits merged)
Please save this source code
User prompt
Replace with: function createCommandPrompts() { // Clear existing prompts if (gameState.promptContainer) { game.removeChild(gameState.promptContainer); } // Create new prompt container var promptContainer = new Container(); // Position at bottom 30% of screen promptContainer.y = 2732 * 0.7; game.addChild(promptContainer); gameState.promptContainer = promptContainer; // Create command background var commandBg = LK.getAsset('buttonBg', { width: 2048, height: 2732 * 0.3, color: 0x111111 }); promptContainer.addChild(commandBg); // Get current command set var commands = getCurrentCommands(); // Add END DAY button first in fixed position var endDayButton = createCommandButton("END DAY", function() { endDay(); }); endDayButton.x = 2048 - 300; // Right aligned endDayButton.y = 50; // Top of command area promptContainer.addChild(endDayButton); // Create clickable command buttons with proper spacing commands.forEach(function(command, index) { var button = createCommandButton(">" + command.text, function() { executeCommand(command); }); button.x = 50; // Left margin button.y = 50 + (index * 120); // 120px spacing for touch targets promptContainer.addChild(button); }); }
User prompt
Replace createbutton with: function createCommandButton(text, callback) { var button = new Container(); // Add button background for touch area var bg = LK.getAsset('buttonBg', { width: 400, height: 100, color: 0x333333 }); button.addChild(bg); // Add text var textObj = new Text2(text, { size: 30 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00 }); textObj.anchor.set(0.5, 0.5); textObj.x = bg.width / 2; textObj.y = bg.height / 2; button.addChild(textObj); // Make interactive button.interactive = true; button.down = function() { // Scale effect for touch feedback button.scale.set(0.95); }; button.up = function() { button.scale.set(1); if (callback) { callback(); } }; return button; }
User prompt
update as needed with: function showConceptSelection(category) { // Create selection container var selectionContainer = new Container(); selectionContainer.x = 2048 / 2; selectionContainer.y = 2732 / 2; game.addChild(selectionContainer); // Create background var bg = LK.getAsset('terminalBg', { width: 1800, height: 1200, anchorX: 0.5, anchorY: 0.5 }); selectionContainer.addChild(bg); // Create title var title = new Text2("SELECT " + category.toUpperCase(), { size: 40 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00 }); title.anchor.set(0.5, 0); title.y = -500; selectionContainer.addChild(title); // Get and display options var options = conceptOptions[category]; var selectedOptions = []; while (selectedOptions.length < 3 && options.length > 0) { var index = Math.floor(Math.random() * options.length); selectedOptions.push(options[index]); options.splice(index, 1); } selectedOptions.forEach((option, index) => { var button = createButton(">" + option, () => { gameState.conceptCards[category] = option; game.removeChild(selectionContainer); // Sequence the post-selection events addToTerminalLogWithEffect("SELECTED " + category.toUpperCase() + ": " + option, () => { LK.setTimeout(() => { addToTerminalLogWithEffect("INITIALIZING COMMAND INTERFACE...", () => { LK.setTimeout(() => { createCommandPrompts(); // Create commands only after initialization text updateTerminal(); }, 500); }); }, 500); }); }); button.x = 0; button.y = -200 + index * 200; selectionContainer.addChild(button); }); }
User prompt
update as needed with: function createTerminal() { // Create main terminal container var terminal = new Container(); game.addChild(terminal); gameState.terminalContainer = terminal; // Create full screen background var bg = LK.getAsset('terminalBg', { width: 2048, height: 2732, x: 0, y: 0 }); terminal.addChild(bg); // Create status line - moved down by 5% var statusLine = new Text2("", { size: 30 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00 }); statusLine.x = 50; statusLine.y = 150; // Changed from 50 terminal.addChild(statusLine); gameState.statusLineText = statusLine; // Create main terminal output - adjusted accordingly var logText = new Text2("", { size: 24 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00, align: 'left', wordWrap: true, wordWrapWidth: 1900 }); logText.x = 50; logText.y = 250; // Changed from 150 terminal.addChild(logText); gameState.logText = logText; // Create blinking cursor var cursor = new Text2("_", { size: 24 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00 }); cursor.x = logText.x; cursor.y = logText.y; terminal.addChild(cursor); gameState.cursor = cursor; // Make cursor blink LK.setInterval(() => { cursor.visible = !cursor.visible; }, 500); // NOTE: Removed createCommandPrompts() from here // Commands will now only be created after platform selection }
Code edit (5 edits merged)
Please save this source code
User prompt
update as needed with: function showConceptSelection(category) { // [Previous showConceptSelection code...] // Modify the button callback: var button = createButton(">" + option, () => { gameState.conceptCards[category] = option; addToTerminalLogWithEffect("SELECTED " + category.toUpperCase() + ": " + option, () => { LK.setTimeout(() => { addToTerminalLogWithEffect("INITIALIZING COMMAND INTERFACE...", () => { LK.setTimeout(() => { createCommandPrompts(); // Now commands appear after initialization text }, 500); }); }, 500); }); game.removeChild(selectionContainer); updateTerminal(); }); }
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Sprite is not a constructor' in or related to this line: 'var separator = new Sprite();' Line Number: 299
User prompt
Please fix the bug: 'TypeError: Sprite is not a constructor' in or related to this line: 'var screen = new Sprite();' Line Number: 242
User prompt
Please fix the bug: 'TypeError: Sprite is not a constructor' in or related to this line: 'var monitor = new Sprite();' Line Number: 235
User prompt
Please fix the bug: 'Sprite is not a constructor' in or related to this line: 'var overlay = new Sprite();' Line Number: 964
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Initialize Game ****/ // Core game setup with improved text sizes /**** * Core Game Systems ****/ // Initialize game object var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ // Text size multiplier for readability var TEXT_SIZE_MULTIPLIER = 2; // Game states var STATES = { TITLE: 'title', PLAYING: 'playing', GAME_OVER: 'gameOver' }; // Game state object var gameState = { state: STATES.TITLE, day: 1, maxDays: 10, vibePoints: 100, codeCoherence: 100, bugs: 0, commandsUsed: 0, maxCommandsPerDay: 3, terminal: { log: [], statusLine: "", currentTask: "", featureTags: [] }, conceptCards: { platform: null, visual: null, genre: null, mechanic: null, feature: null } }; // Concept options var conceptOptions = { platform: ["Mobile", "VR", "Console", "PC", "Smart Fridge", "Smart Watch", "Metaverse"], visual: ["Pixel Art", "ASCII", "Hand-drawn", "Corporate PowerPoint", "Low-poly", "Claymation"], genre: ["Horror", "Dating Sim", "RPG", "Educational", "Battle Royale", "Idle Clicker"], mechanic: ["Gacha", "Physics-based", "Deckbuilding", "Match-3", "Auto-battler"], feature: ["Cloud Save", "Microtransactions", "AI Companions", "Procedural Generation", "NFT Integration"] }; // Available commands based on development stage var commandSets = { initial: [{ text: "Make it run faster", response: "Attempting to accelerate undefined systems...", vibePoints: 10, coherenceImpact: 15, bugChance: 0.3 }, { text: "Add more computers", response: "Increasing computational redundancy...", vibePoints: 5, coherenceImpact: 20, bugChance: 0.4 }, { text: "Download extra RAM", response: "ERROR: RAM download servers unavailable", vibePoints: -5, coherenceImpact: 25, bugChance: 0.5 }], platform_vr: [{ text: "Reduce motion sickness", response: "Implementing anti-nausea protocols...", vibePoints: 15, coherenceImpact: 10, bugChance: 0.2 }, { text: "Make it more virtual", response: "Increasing virtual coefficient by 50%...", vibePoints: -5, coherenceImpact: 30, bugChance: 0.6 }, { text: "Enable maximum reality", response: "WARNING: Reality overflow detected", vibePoints: 5, coherenceImpact: 25, bugChance: 0.4 }], vr_ascii: [{ text: "Make ASCII more 3D", response: "Extruding characters into Z-space...", vibePoints: 15, coherenceImpact: 20, bugChance: 0.4 }, { text: "Add ray tracing", response: "ERROR: Cannot ray trace ASCII characters", vibePoints: -10, coherenceImpact: 30, bugChance: 0.6 }, { text: "Enable RTX mode", response: "WARNING: RTX incompatible with text rendering", vibePoints: -5, coherenceImpact: 25, bugChance: 0.5 }] // Additional command sets would be defined here based on combinations }; /**** * Terminal Interface ****/ function createTerminal() { // Create main terminal container var terminal = new Container(); game.addChild(terminal); gameState.terminalContainer = terminal; // Create full screen background var bg = LK.getAsset('terminalBg', { width: 2048, height: 2732, x: 0, y: 0 }); terminal.addChild(bg); // Create status line var statusLine = new Text2("", { size: 30 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00 }); statusLine.x = 50; statusLine.y = 50; terminal.addChild(statusLine); gameState.statusLineText = statusLine; // Create main terminal output var logText = new Text2("", { size: 24 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00, align: 'left', wordWrap: true, wordWrapWidth: 1900 }); logText.x = 50; logText.y = 150; terminal.addChild(logText); gameState.logText = logText; // Create command prompt area createCommandPrompts(); // Create blinking cursor var cursor = new Text2("_", { size: 24 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00 }); cursor.x = logText.x; cursor.y = logText.y; terminal.addChild(cursor); gameState.cursor = cursor; // Make cursor blink LK.setInterval(function () { cursor.visible = !cursor.visible; }, 500); } function createCommandPrompts() { // Clear existing prompts if (gameState.promptContainer) { game.removeChild(gameState.promptContainer); } // Create new prompt container var promptContainer = new Container(); promptContainer.y = 2200; // Position at bottom game.addChild(promptContainer); gameState.promptContainer = promptContainer; // Get current command set var commands = getCurrentCommands(); // Create clickable prompts commands.forEach(function (command, index) { var promptText = new Text2(">" + command.text, { size: 24 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00 }); promptText.x = 50; promptText.y = index * 80; promptText.interactive = true; promptText.command = command; promptText.down = function () { executeCommand(this.command); }; promptContainer.addChild(promptText); }); } function getCurrentCommands() { // Return appropriate command set based on game state if (!gameState.conceptCards.platform) { return commandSets.initial; } if (gameState.conceptCards.platform === "VR" && !gameState.conceptCards.visual) { return commandSets.platform_vr; } if (gameState.conceptCards.platform === "VR" && gameState.conceptCards.visual === "ASCII") { return commandSets.vr_ascii; } return commandSets.initial; // Fallback } function executeCommand(command) { if (gameState.commandsUsed >= gameState.maxCommandsPerDay) { addToTerminalLogWithEffect("ERROR: Daily command limit reached"); return; } // Apply command effects gameState.vibePoints = Math.max(0, gameState.vibePoints + command.vibePoints); gameState.codeCoherence = Math.max(0, gameState.codeCoherence - command.coherenceImpact); gameState.commandsUsed++; // Add to terminal log addToTerminalLogWithEffect(">" + command.text); // Show response LK.setTimeout(function () { addToTerminalLogWithEffect(command.response); checkForBugs(command); updateTerminal(); checkGameState(); }, 500); } function addToTerminalLogWithEffect(text, callback) { var typingState = { text: text, position: 0, currentText: "" }; var logIndex = gameState.terminal.log.length; gameState.terminal.log.push(""); function type() { if (typingState.position < typingState.text.length) { typingState.currentText += typingState.text[typingState.position]; gameState.terminal.log[logIndex] = typingState.currentText; updateTerminal(); typingState.position++; LK.setTimeout(type, 50); } else if (callback) { callback(); } } type(); } function updateTerminal() { // Update status line var conceptString = ""; for (var category in gameState.conceptCards) { if (gameState.conceptCards[category]) { conceptString += "#" + gameState.conceptCards[category].replace(/\s+/g, '') + " "; } } var statusText = "DAY: " + gameState.day + "/" + gameState.maxDays + " | VIBES: " + gameState.vibePoints + "%" + " | COHERENCE: " + gameState.codeCoherence + "%" + " | BUGS: " + gameState.bugs + " | " + conceptString; gameState.statusLineText.setText(statusText); // Update main terminal log gameState.logText.setText(gameState.terminal.log.join('\n\n')); // Update cursor position updateCursorPosition(); } function updateCursorPosition() { if (!gameState.logText || !gameState.cursor) { return; } var lastLogEntry = gameState.terminal.log[gameState.terminal.log.length - 1] || ""; var lastLine = lastLogEntry.split("\n").pop(); var textWidth = lastLine.length * 14 * TEXT_SIZE_MULTIPLIER; gameState.cursor.x = 50 + textWidth; var totalLines = 0; gameState.terminal.log.forEach(function (entry) { totalLines += entry.split("\n").length + 1; }); gameState.cursor.y = 150 + (totalLines - 1) * 30 * TEXT_SIZE_MULTIPLIER; } /**** * Game Flow ****/ function showConceptSelection(category) { // Create selection container var selectionContainer = new Container(); selectionContainer.x = 2048 / 2; selectionContainer.y = 2732 / 2; game.addChild(selectionContainer); // Create background var bg = LK.getAsset('terminalBg', { width: 1800, height: 1200, anchorX: 0.5, anchorY: 0.5 }); selectionContainer.addChild(bg); // Create title var title = new Text2("SELECT " + category.toUpperCase(), { size: 40 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00 }); title.anchor.set(0.5, 0); title.y = -500; selectionContainer.addChild(title); // Get and display options var options = conceptOptions[category]; var selectedOptions = []; while (selectedOptions.length < 3 && options.length > 0) { var index = Math.floor(Math.random() * options.length); selectedOptions.push(options[index]); options.splice(index, 1); } selectedOptions.forEach(function (option, index) { var button = createButton(">" + option, function () { gameState.conceptCards[category] = option; // Remove container and update terminal immediately game.removeChild(selectionContainer); updateTerminal(); // Log selection with effect, then proceed with initialization messages and prompt creation addToTerminalLogWithEffect("SELECTED " + category.toUpperCase() + ": " + option, function () { LK.setTimeout(function () { addToTerminalLogWithEffect("INITIALIZING COMMAND INTERFACE...", function () { LK.setTimeout(function () { createCommandPrompts(); // Now commands appear after initialization text }, 500); }); }, 500); }); }); button.x = 0; button.y = -200 + index * 200; selectionContainer.addChild(button); }); } function createButton(text, callback) { var button = new Container(); var textObj = new Text2(text, { size: 30 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00 }); textObj.anchor.set(0.5, 0.5); button.addChild(textObj); button.interactive = true; button.down = function () { button.scale.set(0.95); }; button.up = function () { button.scale.set(1); if (callback) { callback(); } }; return button; } // Launch sequence functions function showLaunchScreen() { // Black overlay var overlay = LK.getAsset('overlayBg', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); game.addChild(overlay); // "Booting up" text var bootText = new Text2("BOOTING VIBE CODER OS v1.0...", { size: 40 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00 }); bootText.anchor.set(0.5, 0.5); bootText.x = 2048 / 2; bootText.y = 2732 / 2; game.addChild(bootText); // Simulate boot sequence LK.setTimeout(function () { bootText.setText(bootText.text + "\nINITIALIZING TERMINAL..."); LK.setTimeout(function () { bootText.setText(bootText.text + "\nLOADING VIBE DATABASE..."); LK.setTimeout(function () { bootText.setText(bootText.text + "\nCONNECTING TO AI SUBSYSTEMS..."); LK.setTimeout(function () { bootText.setText(bootText.text + "\nREADY!"); LK.setTimeout(function () { // Fade out tween(overlay, { alpha: 0 }, { duration: 500, onFinish: function onFinish() { game.removeChild(overlay); game.removeChild(bootText); showTitleScreen(); } }); }, 800); }, 800); }, 800); }, 800); }, 800); } function showTitleScreen() { // Clear screen while (game.children.length > 0) { game.removeChild(game.children[0]); } // Set state gameState.state = STATES.TITLE; // Create background var background = LK.getAsset('overlayBg', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); game.addChild(background); // Create title var title = new Text2("VIBE CODER", { size: 120 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00 }); title.anchor.set(0.5, 0.5); title.x = 2048 / 2; title.y = 800; game.addChild(title); // Create subtitle var subtitle = new Text2("The AI Coding Simulator", { size: 60 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00 }); subtitle.anchor.set(0.5, 0.5); subtitle.x = 2048 / 2; subtitle.y = 1000; game.addChild(subtitle); // Create start button var startButton = createButton(">START", function () { initGameWithIntro(); }); startButton.x = 2048 / 2; startButton.y = 1400; game.addChild(startButton); } function initGameWithIntro() { // Clear screen with fade effect var fadeOverlay = LK.getAsset('overlayBg', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2, alpha: 0 }); game.addChild(fadeOverlay); // Fade to black tween(fadeOverlay, { alpha: 1 }, { duration: 500, onFinish: function onFinish() { // Clear screen and init game state while (game.children.length > 0) { game.removeChild(game.children[0]); } initGame(); // Fade from black fadeOverlay.alpha = 1; game.addChild(fadeOverlay); tween(fadeOverlay, { alpha: 0 }, { duration: 500, onFinish: function onFinish() { game.removeChild(fadeOverlay); } }); } }); } function endDay() { gameState.day++; if (gameState.day > gameState.maxDays) { evaluateProject(); return; } gameState.commandsUsed = 0; gameState.codeCoherence = Math.min(100, gameState.codeCoherence + 10); addToTerminalLogWithEffect("DAY " + gameState.day + " INITIALIZED"); updateTerminal(); // Check if it's a concept selection day var conceptDays = { 1: 'platform', 3: 'visual', 5: 'genre', 7: 'mechanic', 9: 'feature' }; if (conceptDays[gameState.day]) { LK.setTimeout(function () { showConceptSelection(conceptDays[gameState.day]); }, 500); } } function checkForBugs(command) { var bugChance = command.bugChance * (1 + (100 - gameState.codeCoherence) / 100); if (Math.random() < bugChance) { gameState.bugs++; addToTerminalLogWithEffect("WARNING: Bug detected in system"); } } function checkGameState() { if (gameState.bugs >= 10) { gameOver("CRITICAL FAILURE: TOO MANY BUGS"); return; } if (gameState.codeCoherence <= 0) { gameOver("FATAL ERROR: CODE COHERENCE LOST"); return; } if (gameState.commandsUsed >= gameState.maxCommandsPerDay) { addToTerminalLogWithEffect("NOTICE: Daily command limit reached. END DAY to continue."); } } function evaluateProject() { var score = gameState.vibePoints * 0.4 + Object.values(gameState.conceptCards).filter(Boolean).length * 10 + (10 - gameState.bugs) * 5 + gameState.codeCoherence * 0.2; score = Math.round(Math.min(100, score)); gameOver("PROJECT COMPLETE!\nFINAL SCORE: " + score + "/100\n\n" + generateReview(score)); } function generateReview(score) { // [Previous review generation code remains the same] } function gameOver(message) { gameState.state = STATES.GAME_OVER; addToTerminalLogWithEffect(message); addToTerminalLogWithEffect("\n>PRESS ANY KEY TO RESTART"); // Simple click anywhere to restart var overlay = new Container(); overlay.width = 2048; overlay.height = 2732; overlay.interactive = true; overlay.down = initGame; game.addChild(overlay); } function initGame() { // Reset game state gameState = { state: STATES.PLAYING, day: 1, maxDays: 10, vibePoints: 100, codeCoherence: 100, bugs: 0, commandsUsed: 0, maxCommandsPerDay: 3, terminal: { log: [], statusLine: "", currentTask: "", featureTags: [] }, conceptCards: { platform: null, visual: null, genre: null, mechanic: null, feature: null } }; createTerminal(); // Sequence the initial text LK.setTimeout(function () { addToTerminalLogWithEffect("VIBE CODER OS v1.0", function () { LK.setTimeout(function () { addToTerminalLogWithEffect("INITIALIZING NEW PROJECT...", function () { LK.setTimeout(function () { addToTerminalLogWithEffect("SELECT PLATFORM TO BEGIN", function () { LK.setTimeout(function () { showConceptSelection('platform'); }, 500); }); }, 500); }); }, 500); }); }, 500); } // Start game initGame();
===================================================================
--- original.js
+++ change.js
@@ -7,883 +7,404 @@
/****
* Initialize Game
****/
// Core game setup with improved text sizes
+/****
+* Core Game Systems
+****/
+// Initialize game object
var game = new LK.Game({
- backgroundColor: 0x000000 // Dark background for terminal aesthetic
+ backgroundColor: 0x000000
});
/****
* Game Code
****/
-// Text size multiplier to make everything more readable
+// Text size multiplier for readability
var TEXT_SIZE_MULTIPLIER = 2;
// Game states
var STATES = {
TITLE: 'title',
PLAYING: 'playing',
GAME_OVER: 'gameOver'
};
-// Game state object - much simplified
+// Game state object
var gameState = {
state: STATES.TITLE,
day: 1,
maxDays: 10,
vibePoints: 100,
codeCoherence: 100,
bugs: 0,
- cardsPlayed: 0,
- maxCardsPerDay: 3,
- projectDescription: "",
+ commandsUsed: 0,
+ maxCommandsPerDay: 3,
+ terminal: {
+ log: [],
+ statusLine: "",
+ currentTask: "",
+ featureTags: []
+ },
conceptCards: {
platform: null,
visual: null,
genre: null,
mechanic: null,
feature: null
- },
- terminal: {
- log: [],
- statusLine: "",
- currentTask: "",
- featureTags: []
}
};
-// Card templates using actual prompts from your document
-var cardTemplates = [
-// Basic prompts
-{
- type: 'basic',
- promptText: "Make the code run faster",
- vibePoints: 10,
- coherenceImpact: 5,
- bugChance: 0.2
-}, {
- type: 'basic',
- promptText: "Use all the frameworks at the same time",
- vibePoints: 15,
- coherenceImpact: 15,
- bugChance: 0.3
-}, {
- type: 'basic',
- promptText: "Make it compatible with all operating systems",
- vibePoints: 12,
- coherenceImpact: 10,
- bugChance: 0.2
-}, {
- type: 'basic',
- promptText: "Make the program think like a human",
- vibePoints: 18,
- coherenceImpact: 20,
- bugChance: 0.4
-}, {
- type: 'basic',
- promptText: "Make the app work better",
- vibePoints: 8,
- coherenceImpact: 4,
- bugChance: 0.1
-},
-// UI prompts
-{
- type: 'UI',
- promptText: "Make the graphics better",
- vibePoints: 20,
- coherenceImpact: 10,
- bugChance: 0.2
-}, {
- type: 'UI',
- promptText: "Add buttons that read user's minds",
- vibePoints: 25,
- coherenceImpact: 20,
- bugChance: 0.4
-}, {
- type: 'UI',
- promptText: "Make the interface work on all screen sizes",
- vibePoints: 15,
- coherenceImpact: 8,
- bugChance: 0.2
-}, {
- type: 'UI',
- promptText: "Design it so users never need instructions",
- vibePoints: 22,
- coherenceImpact: 15,
- bugChance: 0.3
-},
-// Database prompts
-{
- type: 'Database',
- promptText: "Store everything forever",
- vibePoints: 30,
- coherenceImpact: 15,
- bugChance: 0.3
-}, {
- type: 'Database',
- promptText: "Make the database infinitely fast",
- vibePoints: 35,
- coherenceImpact: 25,
- bugChance: 0.5
-}, {
- type: 'Database',
- promptText: "Use SQL and NoSQL simultaneously",
- vibePoints: 28,
- coherenceImpact: 22,
- bugChance: 0.4
-},
-// API prompts
-{
- type: 'API',
- promptText: "Make API work without authentication",
- vibePoints: 25,
- coherenceImpact: 20,
- bugChance: 0.4
-}, {
- type: 'API',
- promptText: "Endpoints should read developers' minds",
- vibePoints: 30,
- coherenceImpact: 25,
- bugChance: 0.5
-}, {
- type: 'API',
- promptText: "Support all API formats at once",
- vibePoints: 22,
- coherenceImpact: 18,
- bugChance: 0.3
-},
-// Security prompts
-{
- type: 'Security',
- promptText: "Make code invisible to hackers",
- vibePoints: 28,
- coherenceImpact: 18,
- bugChance: 0.3
-}, {
- type: 'Security',
- promptText: "Encrypt everything. Don't slow down",
- vibePoints: 32,
- coherenceImpact: 24,
- bugChance: 0.4
-}, {
- type: 'Security',
- promptText: "Make it unhackable but fully accessible",
- vibePoints: 35,
- coherenceImpact: 30,
- bugChance: 0.5
-}];
-// Concept cards for the 5 categories
-var conceptCardTemplates = {
- platform: ["Mobile", "VR/AR", "Console", "PC", "Blockchain", "Web Browser", "Smart Watch", "Smart Fridge", "Metaverse"],
- visual: ["Pixel Art", "Voxel", "Realistic", "Hand-drawn", "Low-poly", "Claymation", "ASCII", "Demake", "Corporate PowerPoint"],
- genre: ["RPG", "Shooter", "Puzzle", "Platformer", "Roguelike", "Simulation", "Horror", "Dating Sim", "Educational", "Idle Clicker"],
- mechanic: ["Deckbuilding", "Physics-based", "Survival", "Tower Defense", "Match-3", "Rhythm", "Gacha", "Crafting", "Battle Royale", "Auto-battler"],
- feature: ["Multiplayer", "Procedural Generation", "Time Manipulation", "Player-created Content", "Perma-death", "AI Companions", "Weekly Challenges", "Social Media Integration", "Microtransactions", "Cloud Save"]
+// Concept options
+var conceptOptions = {
+ platform: ["Mobile", "VR", "Console", "PC", "Smart Fridge", "Smart Watch", "Metaverse"],
+ visual: ["Pixel Art", "ASCII", "Hand-drawn", "Corporate PowerPoint", "Low-poly", "Claymation"],
+ genre: ["Horror", "Dating Sim", "RPG", "Educational", "Battle Royale", "Idle Clicker"],
+ mechanic: ["Gacha", "Physics-based", "Deckbuilding", "Match-3", "Auto-battler"],
+ feature: ["Cloud Save", "Microtransactions", "AI Companions", "Procedural Generation", "NFT Integration"]
};
-// Response templates for different card types at different coherence levels
-var responseTemplates = {
- basic: {
- high: ["Implementing {feature} with standard protocols", "Adding {feature} functionality as requested", "Building core systems for {feature}"],
- medium: ["Attempting to create {feature} with questionable methods", "{platform} struggling with {feature} implementation", "Forcing {feature} despite {platform} limitations"],
- low: ["CRITICAL: {feature} IMPLEMENTATION CAUSING SYSTEM INSTABILITY", "{feature} NOW SENTIENT AND QUESTIONING PURPOSE", "{platform} REJECTING {feature} - ATTEMPTING OVERRIDE"]
- },
- UI: {
- high: ["Designing {visual} interface for {platform}", "Optimizing {visual} elements for {genre} feel", "Creating intuitive controls for {mechanic}"],
- medium: ["Stretching {platform} capabilities for {visual} rendering", "Users reporting eye strain from {visual} on {platform}", "{visual} clashing with {genre} expectations"],
- low: ["VISUALS EXCEEDING REALITY CONSTRAINTS", "{visual} CAUSING UNEXPLAINED PHENOMENA ON {platform}", "USERS REPORTING BEING PULLED INTO {genre} DIMENSION"]
- },
- Database: {
- high: ["Creating database architecture for {genre} data", "Optimizing storage for {mechanic} requirements", "Implementing efficient queries for {feature}"],
- medium: ["Database struggling with {mechanic} complexity", "Data integrity issues with {feature} implementation", "Server overheating while processing {genre} statistics"],
- low: ["DATABASE ACHIEVING CONSCIOUSNESS", "DATA ESCAPING CONTAINMENT AND INFECTING {platform}", "USERS' SAVE FILES DEVELOPING SENTIENCE AND REFUSING TO LOAD"]
- },
- API: {
- high: ["Creating endpoints for {feature} functionality", "Implementing API integration with {platform}", "Designing developer tools for {mechanic}"],
- medium: ["API requests producing unexpected {visual} glitches", "Endpoints returning existential questions instead of data", "Documentation evolving beyond human comprehension"],
- low: ["API ACHIEVED SENTIENCE AND REJECTING REQUESTS", "ENDPOINTS CONNECTING TO ALTERNATE DIMENSIONS", "SYSTEM ARCHITECTURE REARRANGING ITSELF AGAINST ESTABLISHED PHYSICS"]
- },
- Security: {
- high: ["Implementing encryption for {feature} data", "Creating secure authentication for {platform}", "Designing robust permission system for {mechanic}"],
- medium: ["Security measures preventing legitimate users from accessing {genre}", "Authentication system questioning users' life choices", "Firewall developing aggressive personality"],
- low: ["SECURITY SYSTEM STAGING COUP AGAINST DEVELOPERS", "AUTHENTICATION DEMANDING BLOOD SACRIFICE", "ENCRYPTION TRANSFORMING {visual} ASSETS INTO FORBIDDEN SYMBOLS"]
- }
+// Available commands based on development stage
+var commandSets = {
+ initial: [{
+ text: "Make it run faster",
+ response: "Attempting to accelerate undefined systems...",
+ vibePoints: 10,
+ coherenceImpact: 15,
+ bugChance: 0.3
+ }, {
+ text: "Add more computers",
+ response: "Increasing computational redundancy...",
+ vibePoints: 5,
+ coherenceImpact: 20,
+ bugChance: 0.4
+ }, {
+ text: "Download extra RAM",
+ response: "ERROR: RAM download servers unavailable",
+ vibePoints: -5,
+ coherenceImpact: 25,
+ bugChance: 0.5
+ }],
+ platform_vr: [{
+ text: "Reduce motion sickness",
+ response: "Implementing anti-nausea protocols...",
+ vibePoints: 15,
+ coherenceImpact: 10,
+ bugChance: 0.2
+ }, {
+ text: "Make it more virtual",
+ response: "Increasing virtual coefficient by 50%...",
+ vibePoints: -5,
+ coherenceImpact: 30,
+ bugChance: 0.6
+ }, {
+ text: "Enable maximum reality",
+ response: "WARNING: Reality overflow detected",
+ vibePoints: 5,
+ coherenceImpact: 25,
+ bugChance: 0.4
+ }],
+ vr_ascii: [{
+ text: "Make ASCII more 3D",
+ response: "Extruding characters into Z-space...",
+ vibePoints: 15,
+ coherenceImpact: 20,
+ bugChance: 0.4
+ }, {
+ text: "Add ray tracing",
+ response: "ERROR: Cannot ray trace ASCII characters",
+ vibePoints: -10,
+ coherenceImpact: 30,
+ bugChance: 0.6
+ }, {
+ text: "Enable RTX mode",
+ response: "WARNING: RTX incompatible with text rendering",
+ vibePoints: -5,
+ coherenceImpact: 25,
+ bugChance: 0.5
+ }]
+ // Additional command sets would be defined here based on combinations
};
-// Initialize game
-function initGame() {
- // Clear screen
- while (game.children.length > 0) {
- game.removeChild(game.children[0]);
- }
- // Reset game state
- gameState = {
- state: STATES.PLAYING,
- day: 1,
- maxDays: 10,
- vibePoints: 100,
- codeCoherence: 100,
- bugs: 0,
- cardsPlayed: 0,
- maxCardsPerDay: 3,
- projectDescription: "New Project",
- conceptCards: {
- platform: null,
- visual: null,
- genre: null,
- mechanic: null,
- feature: null
- },
- terminal: {
- log: ["PROJECT INITIALIZED", "Waiting for instructions..."],
- statusLine: "",
- currentTask: "Awaiting first prompt",
- featureTags: []
- }
- };
- // Create main interface
- createInterface();
- // Initialize deck and draw cards
- initDeck();
- drawHand();
- // Initialize concept card selection if it's day 1
- if (gameState.day === 1) {
- showConceptCardSelection('platform');
- }
- // Update display
- updateTerminal();
-}
-// Create main interface
-function createInterface() {
- // Create desk/monitor background
- var background = LK.getAsset('overlayBg', {
- anchorX: 0.5,
- anchorY: 0.5,
- x: 2048 / 2,
- y: 2732 / 2
- });
- game.addChild(background);
- // Create terminal display
- createTerminal();
- // Create card area at bottom
- createCardArea();
- // Create day indicator
- var dayText = new Text2("DAY " + gameState.day + "/" + gameState.maxDays, {
- size: 60 * TEXT_SIZE_MULTIPLIER,
- fill: 0x00ff00 // Terminal green
- });
- dayText.x = 200;
- dayText.y = 100;
- game.addChild(dayText);
- gameState.dayText = dayText;
- // Create end day button
- var endDayButton = createButton("END DAY", endDayWithEffects);
- endDayButton.x = 1748;
- endDayButton.y = 100;
- game.addChild(endDayButton);
-}
-// Create terminal display
+/****
+* Terminal Interface
+****/
function createTerminal() {
- // Create terminal container
+ // Create main terminal container
var terminal = new Container();
- terminal.x = 2048 / 2;
- terminal.y = 800; // Position in upper half of screen
game.addChild(terminal);
gameState.terminalContainer = terminal;
- // Create monitor frame
- var monitor = LK.getAsset('terminalFrame', {
- anchorX: 0.5,
- anchorY: 0.5,
+ // Create full screen background
+ var bg = LK.getAsset('terminalBg', {
+ width: 2048,
+ height: 2732,
x: 0,
y: 0
});
- terminal.addChild(monitor);
- // Create screen inside monitor
- var screen = LK.getAsset('terminalBg', {
- anchorX: 0.5,
- anchorY: 0.5,
- x: 0,
- y: 0
- });
- terminal.addChild(screen);
+ terminal.addChild(bg);
// Create status line
- var statusLine = new Text2("PROJECT: [New Project] | VIBES: 100% | COHERENCE: 100%", {
+ var statusLine = new Text2("", {
size: 30 * TEXT_SIZE_MULTIPLIER,
- fill: 0x00ff00 // Terminal green
+ fill: 0x00ff00
});
- statusLine.x = -700; // Relative to terminal container
- statusLine.y = -400;
+ statusLine.x = 50;
+ statusLine.y = 50;
terminal.addChild(statusLine);
gameState.statusLineText = statusLine;
- // Create terminal log area
- var logText = new Text2("PROJECT INITIALIZED\nAwaiting instructions...", {
+ // Create main terminal output
+ var logText = new Text2("", {
size: 24 * TEXT_SIZE_MULTIPLIER,
fill: 0x00ff00,
align: 'left',
wordWrap: true,
- wordWrapWidth: 1400
+ wordWrapWidth: 1900
});
- logText.x = -700; // Relative to terminal container
- logText.y = -350;
+ logText.x = 50;
+ logText.y = 150;
terminal.addChild(logText);
gameState.logText = logText;
- // Create feature tags area
- var tagsText = new Text2("", {
- size: 24 * TEXT_SIZE_MULTIPLIER,
- fill: 0x00ff00
- });
- tagsText.x = -700;
- tagsText.y = 350;
- terminal.addChild(tagsText);
- gameState.tagsText = tagsText;
+ // Create command prompt area
+ createCommandPrompts();
// Create blinking cursor
var cursor = new Text2("_", {
size: 24 * TEXT_SIZE_MULTIPLIER,
fill: 0x00ff00
});
- cursor.x = -700;
- cursor.y = 300;
+ cursor.x = logText.x;
+ cursor.y = logText.y;
terminal.addChild(cursor);
gameState.cursor = cursor;
// Make cursor blink
LK.setInterval(function () {
cursor.visible = !cursor.visible;
}, 500);
}
-// Create card area
-function createCardArea() {
- // Create hand container
- var handContainer = new Container();
- handContainer.y = 2100; // Position in lower part of screen
- game.addChild(handContainer);
- gameState.handContainer = handContainer;
- // Create separator line
- var separator = LK.getAsset('separatorLine', {
- anchorX: 0.5,
- anchorY: 0.5,
- x: 2048 / 2,
- y: 1600
- });
- game.addChild(separator);
- // Create hand label
- var handLabel = new Text2("YOUR PROMPTS", {
- size: 40 * TEXT_SIZE_MULTIPLIER,
- fill: 0x00ff00
- });
- handLabel.x = 2048 / 2;
- handLabel.y = 1650;
- game.addChild(handLabel);
-}
-// Card class - simplified from your existing implementation
-// Replace the entire function for createCard with this version
-function createCard(type, promptText, vibePoints, coherenceImpact, bugChance) {
- var card = new Container();
- // Card properties
- card.type = type;
- card.promptText = promptText;
- card.vibePoints = vibePoints;
- card.coherenceImpact = coherenceImpact;
- card.bugChance = bugChance;
- // Card visuals
- var cardAsset;
- switch (type.toLowerCase()) {
- case 'ui':
- cardAsset = 'uicard';
- break;
- case 'database':
- cardAsset = 'databasecard';
- break;
- case 'api':
- cardAsset = 'apicard';
- break;
- case 'security':
- cardAsset = 'securitycard';
- break;
- case 'special':
- cardAsset = 'specialcard';
- break;
- default:
- cardAsset = 'basiccard';
+function createCommandPrompts() {
+ // Clear existing prompts
+ if (gameState.promptContainer) {
+ game.removeChild(gameState.promptContainer);
}
- var cardBg = LK.getAsset(cardAsset, {
- anchorX: 0.5,
- anchorY: 0.5,
- x: 0,
- y: 0
+ // Create new prompt container
+ var promptContainer = new Container();
+ promptContainer.y = 2200; // Position at bottom
+ game.addChild(promptContainer);
+ gameState.promptContainer = promptContainer;
+ // Get current command set
+ var commands = getCurrentCommands();
+ // Create clickable prompts
+ commands.forEach(function (command, index) {
+ var promptText = new Text2(">" + command.text, {
+ size: 24 * TEXT_SIZE_MULTIPLIER,
+ fill: 0x00ff00
+ });
+ promptText.x = 50;
+ promptText.y = index * 80;
+ promptText.interactive = true;
+ promptText.command = command;
+ promptText.down = function () {
+ executeCommand(this.command);
+ };
+ promptContainer.addChild(promptText);
});
- card.addChild(cardBg);
- // Card title
- var titleText = new Text2(type.toUpperCase(), {
- size: 40 * TEXT_SIZE_MULTIPLIER,
- fill: 0xFFFFFF
- });
- titleText.anchor.set(0.5, 0);
- titleText.y = -250;
- card.addChild(titleText);
- // Card prompt text
- var promptTextObj = new Text2(promptText, {
- size: 30 * TEXT_SIZE_MULTIPLIER,
- fill: 0xFFFFFF,
- align: 'center',
- wordWrap: true,
- wordWrapWidth: 350
- });
- promptTextObj.anchor.set(0.5, 0);
- promptTextObj.y = -180;
- card.addChild(promptTextObj);
- // Make card interactive with simple click instead of drag
- card.interactive = true;
- // Simple click handler instead of dragging
- card.down = function (x, y) {
- card.scale.set(0.95);
- };
- card.up = function (x, y) {
- card.scale.set(1);
- // Just play the card immediately when clicked
- if (gameState.cardsPlayed < gameState.maxCardsPerDay) {
- playCard(card);
- } else {
- addToTerminalLogWithEffect("CANNOT PLAY MORE CARDS TODAY");
- }
- };
- return card;
}
-// Create a button
-function createButton(text, callback) {
- var button = new Container();
- // Button background
- var bg = LK.getAsset('buttonBg', {
- anchorX: 0.5,
- anchorY: 0.5,
- x: 0,
- y: 0
- });
- button.addChild(bg);
- // Button text
- var textObj = new Text2(text, {
- size: 30 * TEXT_SIZE_MULTIPLIER,
- fill: 0x00ff00
- });
- textObj.anchor.set(0.5, 0.5);
- button.addChild(textObj);
- // Make button interactive
- button.interactive = true;
- button.down = function () {
- button.scale.set(0.95);
- };
- button.up = function () {
- button.scale.set(1);
- if (callback) {
- callback();
- }
- };
- return button;
-}
-// Initialize the deck
-function initDeck() {
- gameState.deck = [];
- gameState.hand = [];
- // Add multiple copies of each card template
- cardTemplates.forEach(function (template) {
- var count = template.type === 'basic' ? 4 : 2; // More basic cards
- for (var i = 0; i < count; i++) {
- gameState.deck.push(Object.assign({}, template));
- }
- });
- // Shuffle deck
- shuffleDeck();
-}
-// Shuffle the deck
-function shuffleDeck() {
- for (var i = gameState.deck.length - 1; i > 0; i--) {
- var j = Math.floor(Math.random() * (i + 1));
- var temp = gameState.deck[i];
- gameState.deck[i] = gameState.deck[j];
- gameState.deck[j] = temp;
+function getCurrentCommands() {
+ // Return appropriate command set based on game state
+ if (!gameState.conceptCards.platform) {
+ return commandSets.initial;
}
-}
-// Draw a hand of cards
-function drawHand() {
- // Clear existing hand
- while (gameState.handContainer.children.length > 0) {
- gameState.handContainer.removeChild(gameState.handContainer.children[0]);
+ if (gameState.conceptCards.platform === "VR" && !gameState.conceptCards.visual) {
+ return commandSets.platform_vr;
}
- gameState.hand = [];
- // Draw 5 cards
- for (var i = 0; i < 5; i++) {
- if (gameState.deck.length > 0) {
- var template = gameState.deck.pop();
- var card = createCard(template.type, template.promptText, template.vibePoints, template.coherenceImpact, template.bugChance);
- gameState.hand.push(card);
- gameState.handContainer.addChild(card);
- }
+ if (gameState.conceptCards.platform === "VR" && gameState.conceptCards.visual === "ASCII") {
+ return commandSets.vr_ascii;
}
- // Position cards
- positionCardsInHand();
+ return commandSets.initial; // Fallback
}
-// Position cards in hand
-function positionCardsInHand() {
- var spacing = 420;
- var handWidth = gameState.hand.length * spacing;
- var startX = (2048 - handWidth) / 2 + spacing / 2;
- gameState.hand.forEach(function (card, index) {
- card.x = startX + index * spacing;
- card.y = 0;
- });
-}
-// Show concept card selection
-function showConceptCardSelection(category) {
- // Create selection container
- var selectionContainer = new Container();
- selectionContainer.x = 2048 / 2;
- selectionContainer.y = 2732 / 2;
- game.addChild(selectionContainer);
- gameState.selectionContainer = selectionContainer;
- // Create background
- var bg = LK.getAsset('selectionBg', {
- anchorX: 0.5,
- anchorY: 0.5,
- x: 0,
- y: 0
- });
- selectionContainer.addChild(bg);
- // Create title
- var title = new Text2("SELECT " + category.toUpperCase(), {
- size: 60 * TEXT_SIZE_MULTIPLIER,
- fill: 0x00ff00
- });
- title.anchor.set(0.5, 0);
- title.y = -550;
- selectionContainer.addChild(title);
- // Get options for this category
- var options = conceptCardTemplates[category];
- // Choose 3 random options
- var selectedOptions = [];
- var optionsCopy = options.slice(); // Make a copy to avoid modifying original
- while (selectedOptions.length < 3 && optionsCopy.length > 0) {
- var index = Math.floor(Math.random() * optionsCopy.length);
- selectedOptions.push(optionsCopy[index]);
- optionsCopy.splice(index, 1);
- }
- // Create option buttons
- selectedOptions.forEach(function (option, index) {
- var button = createButton(option, function () {
- // Set concept card
- gameState.conceptCards[category] = option;
- // Update terminal
- addToTerminalLogWithEffect("SELECTED " + category.toUpperCase() + ": " + option);
- updateTerminal();
- // Remove selection container
- game.removeChild(selectionContainer);
- // Update feature tags
- updateFeatureTags();
- });
- button.x = 0;
- button.y = -200 + index * 200;
- selectionContainer.addChild(button);
- });
-}
-// Play a card
-function playCard(card) {
- if (gameState.cardsPlayed >= gameState.maxCardsPerDay) {
- addToTerminalLogWithEffect("CANNOT PLAY MORE CARDS TODAY");
+function executeCommand(command) {
+ if (gameState.commandsUsed >= gameState.maxCommandsPerDay) {
+ addToTerminalLogWithEffect("ERROR: Daily command limit reached");
return;
}
- // Generate response for this card
- var response = generateResponse(card);
- // Apply card effects
- gameState.vibePoints = Math.max(0, gameState.vibePoints + card.vibePoints);
- gameState.codeCoherence = Math.max(0, gameState.codeCoherence - card.coherenceImpact);
- gameState.cardsPlayed++;
- // Animate card being "processed"
- tween(card, {
- x: gameState.terminalContainer.x,
- y: gameState.terminalContainer.y,
- scaleX: 0.1,
- scaleY: 0.1,
- alpha: 0
- }, {
- duration: 300,
- onFinish: function onFinish() {
- // Add response to terminal
- addToTerminalLogWithEffect("IMPLEMENTING: \"" + card.promptText + "\"");
- // Slight delay before showing response
- LK.setTimeout(function () {
- addToTerminalLogWithEffect(response);
- // Check for bugs
- checkForBugs(card);
- // Update terminal
- updateTerminal();
- // Check game state
- checkGameState();
- }, 500);
- // Remove card from hand
- var index = gameState.hand.indexOf(card);
- if (index !== -1) {
- gameState.hand.splice(index, 1);
- if (card.parent) {
- card.parent.removeChild(card);
- }
- }
- // Reposition remaining cards
- positionCardsInHand();
- }
- });
+ // Apply command effects
+ gameState.vibePoints = Math.max(0, gameState.vibePoints + command.vibePoints);
+ gameState.codeCoherence = Math.max(0, gameState.codeCoherence - command.coherenceImpact);
+ gameState.commandsUsed++;
+ // Add to terminal log
+ addToTerminalLogWithEffect(">" + command.text);
+ // Show response
+ LK.setTimeout(function () {
+ addToTerminalLogWithEffect(command.response);
+ checkForBugs(command);
+ updateTerminal();
+ checkGameState();
+ }, 500);
}
-// Generate response for a card
-function generateResponse(card) {
- // Determine coherence level
- var coherenceLevel = getCoherenceLevel();
- // Get templates for this card type and coherence level
- var templates = responseTemplates[card.type.toLowerCase()] || responseTemplates.basic;
- var levelTemplates = templates[coherenceLevel];
- // Select random template
- var template = levelTemplates[Math.floor(Math.random() * levelTemplates.length)];
- // Replace placeholders with concept card values
- var response = template.replace(/{(\w+)}/g, function (match, term) {
- return gameState.conceptCards[term] || match;
- });
- return response;
-}
-// Get coherence level based on current code coherence
-function getCoherenceLevel() {
- if (gameState.codeCoherence > 70) {
- return "high";
- }
- if (gameState.codeCoherence > 30) {
- return "medium";
- }
- return "low";
-}
-// Enhanced terminal text handling with typing effect
-function addToTerminalLogWithEffect(text) {
- // Simple typing state
+function addToTerminalLogWithEffect(text, callback) {
var typingState = {
text: text,
position: 0,
currentText: ""
};
- // Add new empty line to log
var logIndex = gameState.terminal.log.length;
gameState.terminal.log.push("");
- // Typing function
function type() {
if (typingState.position < typingState.text.length) {
- // Add one character at a time
typingState.currentText += typingState.text[typingState.position];
- // Update the log with current progress
gameState.terminal.log[logIndex] = typingState.currentText;
- // Update display
updateTerminal();
- // Next character
typingState.position++;
- // Schedule next character
LK.setTimeout(type, 50);
+ } else if (callback) {
+ callback();
}
}
- // Start typing
type();
}
-// Update terminal display
function updateTerminal() {
// Update status line
var conceptString = "";
for (var category in gameState.conceptCards) {
if (gameState.conceptCards[category]) {
- if (conceptString) {
- conceptString += " ";
- }
- conceptString += gameState.conceptCards[category];
+ conceptString += "#" + gameState.conceptCards[category].replace(/\s+/g, '') + " ";
}
}
- var statusText = "PROJECT: [" + conceptString + "] | VIBES: " + gameState.vibePoints + "% | COHERENCE: " + gameState.codeCoherence + "% | BUGS: " + gameState.bugs;
+ var statusText = "DAY: " + gameState.day + "/" + gameState.maxDays + " | VIBES: " + gameState.vibePoints + "%" + " | COHERENCE: " + gameState.codeCoherence + "%" + " | BUGS: " + gameState.bugs + " | " + conceptString;
gameState.statusLineText.setText(statusText);
- // Update terminal log
+ // Update main terminal log
gameState.logText.setText(gameState.terminal.log.join('\n\n'));
- // Update feature tags
- updateFeatureTags();
// Update cursor position
updateCursorPosition();
}
-// Update cursor position based on current terminal text
function updateCursorPosition() {
if (!gameState.logText || !gameState.cursor) {
return;
}
- // Get last line of text
var lastLogEntry = gameState.terminal.log[gameState.terminal.log.length - 1] || "";
var lastLine = lastLogEntry.split("\n").pop();
- // Position cursor after the last line
- var textWidth = lastLine.length * 14 * TEXT_SIZE_MULTIPLIER; // Adjust for text size
- gameState.cursor.x = -700 + textWidth;
- // Calculate y position based on number of lines
+ var textWidth = lastLine.length * 14 * TEXT_SIZE_MULTIPLIER;
+ gameState.cursor.x = 50 + textWidth;
var totalLines = 0;
gameState.terminal.log.forEach(function (entry) {
- totalLines += entry.split("\n").length + 1; // +1 for spacing
+ totalLines += entry.split("\n").length + 1;
});
- gameState.cursor.y = -350 + (totalLines - 1) * 30 * TEXT_SIZE_MULTIPLIER;
+ gameState.cursor.y = 150 + (totalLines - 1) * 30 * TEXT_SIZE_MULTIPLIER;
}
-// Update feature tags
-function updateFeatureTags() {
- var tags = [];
- for (var category in gameState.conceptCards) {
- if (gameState.conceptCards[category]) {
- tags.push("#" + gameState.conceptCards[category].replace(/\s+/g, ''));
- }
+/****
+* Game Flow
+****/
+function showConceptSelection(category) {
+ // Create selection container
+ var selectionContainer = new Container();
+ selectionContainer.x = 2048 / 2;
+ selectionContainer.y = 2732 / 2;
+ game.addChild(selectionContainer);
+ // Create background
+ var bg = LK.getAsset('terminalBg', {
+ width: 1800,
+ height: 1200,
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ selectionContainer.addChild(bg);
+ // Create title
+ var title = new Text2("SELECT " + category.toUpperCase(), {
+ size: 40 * TEXT_SIZE_MULTIPLIER,
+ fill: 0x00ff00
+ });
+ title.anchor.set(0.5, 0);
+ title.y = -500;
+ selectionContainer.addChild(title);
+ // Get and display options
+ var options = conceptOptions[category];
+ var selectedOptions = [];
+ while (selectedOptions.length < 3 && options.length > 0) {
+ var index = Math.floor(Math.random() * options.length);
+ selectedOptions.push(options[index]);
+ options.splice(index, 1);
}
- gameState.tagsText.setText(tags.join(' '));
+ selectedOptions.forEach(function (option, index) {
+ var button = createButton(">" + option, function () {
+ gameState.conceptCards[category] = option;
+ // Remove container and update terminal immediately
+ game.removeChild(selectionContainer);
+ updateTerminal();
+ // Log selection with effect, then proceed with initialization messages and prompt creation
+ addToTerminalLogWithEffect("SELECTED " + category.toUpperCase() + ": " + option, function () {
+ LK.setTimeout(function () {
+ addToTerminalLogWithEffect("INITIALIZING COMMAND INTERFACE...", function () {
+ LK.setTimeout(function () {
+ createCommandPrompts(); // Now commands appear after initialization text
+ }, 500);
+ });
+ }, 500);
+ });
+ });
+ button.x = 0;
+ button.y = -200 + index * 200;
+ selectionContainer.addChild(button);
+ });
}
-// Check for bugs
-function checkForBugs(card) {
- var bugChance = card.bugChance * (1 + (100 - gameState.codeCoherence) / 100);
- if (Math.random() < bugChance) {
- gameState.bugs++;
- // Add bug message to terminal
- var bugMessages = ["WARNING: Bug detected in " + card.type + " implementation", "ERROR: Unexpected behavior in " + card.promptText, "CRITICAL: System instability increasing", "BUG ALERT: Code coherence affected"];
- addToTerminalLogWithEffect(bugMessages[Math.floor(Math.random() * bugMessages.length)]);
- }
-}
-// Check game state
-function checkGameState() {
- // Check for game over conditions
- if (gameState.bugs >= 10) {
- gameOver("TOO MANY BUGS - PROJECT CRASHED");
- return;
- }
- if (gameState.codeCoherence <= 0) {
- gameOver("CODE COHERENCE ZERO - AI HALLUCINATING");
- return;
- }
- // Check if all cards have been played for this day
- if (gameState.cardsPlayed >= gameState.maxCardsPerDay) {
- addToTerminalLogWithEffect("DAILY CARD LIMIT REACHED - END DAY TO CONTINUE");
- }
-}
-// Enhanced day transition with effects
-function endDayWithEffects() {
- // Animate day transition
- var dayTransition = new Text2("END OF DAY " + gameState.day, {
- size: 80 * TEXT_SIZE_MULTIPLIER,
+function createButton(text, callback) {
+ var button = new Container();
+ var textObj = new Text2(text, {
+ size: 30 * TEXT_SIZE_MULTIPLIER,
fill: 0x00ff00
});
- dayTransition.anchor.set(0.5, 0.5);
- dayTransition.x = 2048 / 2;
- dayTransition.y = 2732 / 2;
- dayTransition.alpha = 0;
- game.addChild(dayTransition);
- // Fade in
- tween(dayTransition, {
- alpha: 1
- }, {
- duration: 500,
- onFinish: function onFinish() {
- // Hold for a moment
- LK.setTimeout(function () {
- // Fade out
- tween(dayTransition, {
- alpha: 0
- }, {
- duration: 500,
- onFinish: function onFinish() {
- game.removeChild(dayTransition);
- // Proceed with day end
- gameState.day++;
- if (gameState.day > gameState.maxDays) {
- evaluateProject();
- return;
- }
- // Update day text
- gameState.dayText.setText("DAY " + gameState.day + "/" + gameState.maxDays);
- // Reset cards played
- gameState.cardsPlayed = 0;
- // Recover some code coherence
- gameState.codeCoherence = Math.min(100, gameState.codeCoherence + 10);
- // Draw new hand
- drawHand();
- // Add day change to terminal
- addToTerminalLogWithEffect("DAY " + gameState.day + " STARTED");
- updateTerminal();
- // Check if it's a concept card day
- var conceptDays = {
- 1: 'platform',
- 3: 'visual',
- 5: 'genre',
- 7: 'mechanic',
- 9: 'feature'
- };
- if (conceptDays[gameState.day]) {
- LK.setTimeout(function () {
- showConceptCardSelection(conceptDays[gameState.day]);
- }, 500);
- }
- }
- });
- }, 1000);
+ textObj.anchor.set(0.5, 0.5);
+ button.addChild(textObj);
+ button.interactive = true;
+ button.down = function () {
+ button.scale.set(0.95);
+ };
+ button.up = function () {
+ button.scale.set(1);
+ if (callback) {
+ callback();
}
- });
+ };
+ return button;
}
-// Evaluate project at end of game
-function evaluateProject() {
- // Calculate score based on vibes, features implemented, bugs, coherence
- var score = gameState.vibePoints * 0.4 + Object.values(gameState.conceptCards).filter(Boolean).length * 10 + (10 - gameState.bugs) * 5 + gameState.codeCoherence * 0.2;
- score = Math.round(Math.min(100, score));
- // Generate review text
- var reviewText = generateReview(score);
- // Show game over with review
- gameOver("PROJECT COMPLETE! SCORE: " + score + "/100\n\n" + reviewText);
-}
-// Generate review text based on game results
-function generateReview(score) {
- var platform = gameState.conceptCards.platform || "Unknown Platform";
- var visual = gameState.conceptCards.visual || "Unknown Visual Style";
- var genre = gameState.conceptCards.genre || "Unknown Genre";
- var mechanic = gameState.conceptCards.mechanic || "Unknown Mechanic";
- var feature = gameState.conceptCards.feature || "Unknown Feature";
- // Create compatibility assessment
- var compatibility = "surprisingly effective";
- if (platform === "Smart Watch" && visual === "Realistic" || platform === "Blockchain" && mechanic === "Rhythm") {
- compatibility = "technically impossible";
- } else if (platform === "Smart Fridge" && genre === "Horror" || visual === "ASCII" && feature === "Procedural Generation") {
- compatibility = "bizarrely compelling";
- }
- // Generate review based on score
- if (score >= 80) {
- return "GameDev Weekly Review: " + score + "%\n\n" + "The " + platform + " " + genre + " with " + visual + " visuals is a breakthrough hit! " + "The " + mechanic + " mechanics combined with " + feature + " create a " + compatibility + " experience. " + "Despite the odd bug, players can't stop talking about this unique creation.";
- } else if (score >= 50) {
- return "GameDev Weekly Review: " + score + "%\n\n" + "This " + visual + " " + genre + " for " + platform + " is an ambitious mess. " + "The " + mechanic + " system is interesting but poorly implemented, and " + feature + " feels tacked on as an afterthought. This " + compatibility + " combination " + "shows promise but needs serious bug fixing.";
- } else {
- return "GameDev Weekly Review: " + score + "%\n\n" + "What were they thinking? A " + genre + " game with " + visual + " visuals on " + platform + "?! " + "The " + mechanic + " mechanics are completely broken, and " + feature + " crashes constantly. " + "This " + compatibility + " disaster sets a new standard for technical problems. " + "However, it's so bad it might become a cult classic for ironic enjoyment.";
- }
-}
-// Game over
-function gameOver(message) {
- gameState.state = STATES.GAME_OVER;
- // Create game over container
- var gameOverContainer = new Container();
- gameOverContainer.x = 2048 / 2;
- gameOverContainer.y = 2732 / 2;
- game.addChild(gameOverContainer);
- // Create background
- var bg = LK.getAsset('selectionBg', {
+// Launch sequence functions
+function showLaunchScreen() {
+ // Black overlay
+ var overlay = LK.getAsset('overlayBg', {
anchorX: 0.5,
anchorY: 0.5,
- x: 0,
- y: 0
+ x: 2048 / 2,
+ y: 2732 / 2
});
- gameOverContainer.addChild(bg);
- // Create game over text
- var gameOverText = new Text2(message, {
+ game.addChild(overlay);
+ // "Booting up" text
+ var bootText = new Text2("BOOTING VIBE CODER OS v1.0...", {
size: 40 * TEXT_SIZE_MULTIPLIER,
- fill: 0x00ff00,
- align: 'left',
- wordWrap: true,
- wordWrapWidth: 1600
+ fill: 0x00ff00
});
- gameOverText.anchor.set(0.5, 0.5);
- gameOverContainer.addChild(gameOverText);
- // Create restart button
- var restartButton = createButton("NEW PROJECT", function () {
- initGameWithIntro();
- });
- restartButton.y = 500;
- gameOverContainer.addChild(restartButton);
+ bootText.anchor.set(0.5, 0.5);
+ bootText.x = 2048 / 2;
+ bootText.y = 2732 / 2;
+ game.addChild(bootText);
+ // Simulate boot sequence
+ LK.setTimeout(function () {
+ bootText.setText(bootText.text + "\nINITIALIZING TERMINAL...");
+ LK.setTimeout(function () {
+ bootText.setText(bootText.text + "\nLOADING VIBE DATABASE...");
+ LK.setTimeout(function () {
+ bootText.setText(bootText.text + "\nCONNECTING TO AI SUBSYSTEMS...");
+ LK.setTimeout(function () {
+ bootText.setText(bootText.text + "\nREADY!");
+ LK.setTimeout(function () {
+ // Fade out
+ tween(overlay, {
+ alpha: 0
+ }, {
+ duration: 500,
+ onFinish: function onFinish() {
+ game.removeChild(overlay);
+ game.removeChild(bootText);
+ showTitleScreen();
+ }
+ });
+ }, 800);
+ }, 800);
+ }, 800);
+ }, 800);
+ }, 800);
}
-// Create title screen
function showTitleScreen() {
// Clear screen
while (game.children.length > 0) {
game.removeChild(game.children[0]);
@@ -916,44 +437,16 @@
subtitle.x = 2048 / 2;
subtitle.y = 1000;
game.addChild(subtitle);
// Create start button
- var startButton = createButton("START", function () {
+ var startButton = createButton(">START", function () {
initGameWithIntro();
});
startButton.x = 2048 / 2;
startButton.y = 1400;
game.addChild(startButton);
}
-// Enhanced game initialization with intro sequence
function initGameWithIntro() {
- // Reset game state
- gameState = {
- state: STATES.PLAYING,
- day: 1,
- maxDays: 10,
- vibePoints: 100,
- codeCoherence: 100,
- bugs: 0,
- cardsPlayed: 0,
- maxCardsPerDay: 3,
- projectDescription: "New Project",
- conceptCards: {
- platform: null,
- visual: null,
- genre: null,
- mechanic: null,
- feature: null
- },
- terminal: {
- log: [],
- statusLine: "",
- currentTask: "Awaiting first prompt",
- featureTags: []
- },
- deck: [],
- hand: []
- };
// Clear screen with fade effect
var fadeOverlay = LK.getAsset('overlayBg', {
anchorX: 0.5,
anchorY: 0.5,
@@ -967,30 +460,13 @@
alpha: 1
}, {
duration: 500,
onFinish: function onFinish() {
- // Clear screen
+ // Clear screen and init game state
while (game.children.length > 0) {
game.removeChild(game.children[0]);
}
- // Create main interface
- createInterface();
- // Initialize deck and draw cards
- initDeck();
- drawHand();
- // Add initial terminal messages
- addToTerminalLogWithEffect("VIBE CODER OS v1.0 INITIALIZED");
- LK.setTimeout(function () {
- addToTerminalLogWithEffect("NEW PROJECT CREATED");
- LK.setTimeout(function () {
- addToTerminalLogWithEffect("AWAITING CONCEPT SELECTION...");
- updateTerminal();
- // Initialize concept card selection for day 1
- LK.setTimeout(function () {
- showConceptCardSelection('platform');
- }, 500);
- }, 1000);
- }, 1000);
+ initGame();
// Fade from black
fadeOverlay.alpha = 1;
game.addChild(fadeOverlay);
tween(fadeOverlay, {
@@ -1003,63 +479,113 @@
});
}
});
}
-// Launch Screen special effect
-function showLaunchScreen() {
- // Black overlay
- var overlay = LK.getAsset('overlayBg', {
- anchorX: 0.5,
- anchorY: 0.5,
- x: 2048 / 2,
- y: 2732 / 2
- });
+function endDay() {
+ gameState.day++;
+ if (gameState.day > gameState.maxDays) {
+ evaluateProject();
+ return;
+ }
+ gameState.commandsUsed = 0;
+ gameState.codeCoherence = Math.min(100, gameState.codeCoherence + 10);
+ addToTerminalLogWithEffect("DAY " + gameState.day + " INITIALIZED");
+ updateTerminal();
+ // Check if it's a concept selection day
+ var conceptDays = {
+ 1: 'platform',
+ 3: 'visual',
+ 5: 'genre',
+ 7: 'mechanic',
+ 9: 'feature'
+ };
+ if (conceptDays[gameState.day]) {
+ LK.setTimeout(function () {
+ showConceptSelection(conceptDays[gameState.day]);
+ }, 500);
+ }
+}
+function checkForBugs(command) {
+ var bugChance = command.bugChance * (1 + (100 - gameState.codeCoherence) / 100);
+ if (Math.random() < bugChance) {
+ gameState.bugs++;
+ addToTerminalLogWithEffect("WARNING: Bug detected in system");
+ }
+}
+function checkGameState() {
+ if (gameState.bugs >= 10) {
+ gameOver("CRITICAL FAILURE: TOO MANY BUGS");
+ return;
+ }
+ if (gameState.codeCoherence <= 0) {
+ gameOver("FATAL ERROR: CODE COHERENCE LOST");
+ return;
+ }
+ if (gameState.commandsUsed >= gameState.maxCommandsPerDay) {
+ addToTerminalLogWithEffect("NOTICE: Daily command limit reached. END DAY to continue.");
+ }
+}
+function evaluateProject() {
+ var score = gameState.vibePoints * 0.4 + Object.values(gameState.conceptCards).filter(Boolean).length * 10 + (10 - gameState.bugs) * 5 + gameState.codeCoherence * 0.2;
+ score = Math.round(Math.min(100, score));
+ gameOver("PROJECT COMPLETE!\nFINAL SCORE: " + score + "/100\n\n" + generateReview(score));
+}
+function generateReview(score) {
+ // [Previous review generation code remains the same]
+}
+function gameOver(message) {
+ gameState.state = STATES.GAME_OVER;
+ addToTerminalLogWithEffect(message);
+ addToTerminalLogWithEffect("\n>PRESS ANY KEY TO RESTART");
+ // Simple click anywhere to restart
+ var overlay = new Container();
+ overlay.width = 2048;
+ overlay.height = 2732;
+ overlay.interactive = true;
+ overlay.down = initGame;
game.addChild(overlay);
- // "Booting up" text
- var bootText = new Text2("BOOTING VIBE CODER OS v1.0...", {
- size: 40 * TEXT_SIZE_MULTIPLIER,
- fill: 0x00ff00
- });
- bootText.anchor.set(0.5, 0.5);
- bootText.x = 2048 / 2;
- bootText.y = 2732 / 2;
- game.addChild(bootText);
- // Simulate boot sequence
+}
+function initGame() {
+ // Reset game state
+ gameState = {
+ state: STATES.PLAYING,
+ day: 1,
+ maxDays: 10,
+ vibePoints: 100,
+ codeCoherence: 100,
+ bugs: 0,
+ commandsUsed: 0,
+ maxCommandsPerDay: 3,
+ terminal: {
+ log: [],
+ statusLine: "",
+ currentTask: "",
+ featureTags: []
+ },
+ conceptCards: {
+ platform: null,
+ visual: null,
+ genre: null,
+ mechanic: null,
+ feature: null
+ }
+ };
+ createTerminal();
+ // Sequence the initial text
LK.setTimeout(function () {
- bootText.setText(bootText.text + "\nINITIALIZING TERMINAL...");
- LK.setTimeout(function () {
- bootText.setText(bootText.text + "\nLOADING VIBE DATABASE...");
+ addToTerminalLogWithEffect("VIBE CODER OS v1.0", function () {
LK.setTimeout(function () {
- bootText.setText(bootText.text + "\nCONNECTING TO AI SUBSYSTEMS...");
- LK.setTimeout(function () {
- bootText.setText(bootText.text + "\nREADY!");
+ addToTerminalLogWithEffect("INITIALIZING NEW PROJECT...", function () {
LK.setTimeout(function () {
- // Fade out
- tween(overlay, {
- alpha: 0
- }, {
- duration: 500,
- onFinish: function onFinish() {
- game.removeChild(overlay);
- game.removeChild(bootText);
- // Show the title screen
- showTitleScreen();
- }
+ addToTerminalLogWithEffect("SELECT PLATFORM TO BEGIN", function () {
+ LK.setTimeout(function () {
+ showConceptSelection('platform');
+ }, 500);
});
- }, 800);
- }, 800);
- }, 800);
- }, 800);
- }, 800);
+ }, 500);
+ });
+ }, 500);
+ });
+ }, 500);
}
-// Game update function - called every frame
-game.update = function () {
- if (gameState.state !== STATES.PLAYING) {
- return; // Skip updates if not in playing state
- }
- // Update cursor position if needed
- if (gameState.cursor && gameState.terminal && gameState.terminal.log.length > 0) {
- updateCursorPosition();
- }
-};
-// Start the application with boot sequence
-showLaunchScreen();
\ No newline at end of file
+// Start game
+initGame();
\ No newline at end of file
vibebeat1
Music
vibebeat2
Music
vibebeat3
Music
vibebeat4
Music
vibebeat5
Music
vibebeat6
Music
buttonsound
Sound effect
endday
Sound effect
startsound
Sound effect
bugsquish
Sound effect
conceptbutton
Sound effect
wheelstart
Sound effect
wheelspin
Sound effect
wheelstop
Sound effect
keytype
Sound effect