Code edit (6 edits merged)
Please save this source code
User prompt
update as needed with: // In the showConceptSelection function, add a parameter for preserving vibes function showConceptSelection(category, preservedVibes) { // Rest of function... selectedOptions.forEach(function (option, index) { var button = createCommandButton(">" + option, function () { gameState.conceptCards[category] = option; game.removeChild(selectionContainer); // Preserve vibes immediately after selection if (preservedVibes !== undefined) { gameState.vibePoints = preservedVibes; } // Continue with the rest of the function... addToTerminalLogWithEffect("SELECTED " + category.toUpperCase() + ": " + option, function () { // Preserve vibes again after adding text if (preservedVibes !== undefined) { gameState.vibePoints = preservedVibes; } LK.setTimeout(function () { addToTerminalLogWithEffect("INITIALIZING COMMAND INTERFACE...", function () { // Preserve vibes again if (preservedVibes !== undefined) { gameState.vibePoints = preservedVibes; } LK.setTimeout(function () { createCommandPrompts(); updateTerminal(); // Final vibes preservation if (preservedVibes !== undefined) { gameState.vibePoints = preservedVibes; } }, 500); }); }, 500); }); }); // Rest of button setup... }); } // Then in endDay function, modify the concept selection call: if (conceptDays[gameState.day]) { LK.setTimeout(function () { var beforeConceptVibes = gameState.vibePoints; showConceptSelection(conceptDays[gameState.day], beforeConceptVibes); // Remove the timeout that tries to restore vibes, as we're handling it in the function now }, 500); }
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: responseSet is undefined' in or related to this line: 'if (index < responseSet.length) {' Line Number: 773
Code edit (4 edits merged)
Please save this source code
User prompt
update with: function endDay() { gameState.day++; if (gameState.day > gameState.maxDays) { evaluateProject(); return; } gameState.commandsUsed = 0; // Natural overnight recovery gameState.codeCoherence = Math.min(100, gameState.codeCoherence + 10); gameState.vibePoints = Math.min(100, gameState.vibePoints + 5); // Bugs cause overnight coherence loss if (gameState.bugs > 0) { gameState.codeCoherence = Math.max(0, gameState.codeCoherence - (gameState.bugs * 2)); addToTerminalLogWithEffect(`WARNING: ${gameState.bugs} bug${gameState.bugs > 1 ? 's' : ''} caused overnight code degradation`); } addToTerminalLogWithEffect("DAY " + gameState.day + " INITIALIZED"); updateTerminal(); // Rest of endDay function... }
Code edit (2 edits merged)
Please save this source code
User prompt
Using the current platform specific command sets, generate more in that style for all platform types in the array. Add to code.
User prompt
Add multiplayer, VR support, cross-platform, and offline mode to the feature array.
User prompt
Add procedural generation and roguelike to the mechanics array.
User prompt
Add open world, casual and shooter to the genre array.
User prompt
Add realistic, voxel and demake to the visual style array.
User prompt
Add web browser and blockchain to the platform array
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Update as needed with: function createTerminal() { // ... existing code ... // Create status line with adjusted positioning var statusLine = new Text2("", { size: 30 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00 }); statusLine.x = 50; statusLine.y = 2732 * 0.10; terminal.addChild(statusLine); gameState.statusLineText = statusLine; // Adjust content container position to account for two-line status var contentContainer = new Container(); contentContainer.x = 0; contentContainer.y = 2732 * 0.15 + (gameState.terminalLineHeight * 2); // Add extra height for second line terminal.addChild(contentContainer); // ... rest of function ... }
User prompt
Update as needed: function updateTerminal() { // Update status line var conceptString = ""; for (var category in gameState.conceptCards) { if (gameState.conceptCards[category]) { conceptString += "#" + gameState.conceptCards[category].replace(/\s+/g, '') + " "; } } // Split into two lines var statusLine1 = "DAY: " + gameState.day + "/" + gameState.maxDays + " | VIBES: " + gameState.vibePoints + "%" + " | COHERENCE: " + gameState.codeCoherence + "%" + " | BUGS: " + gameState.bugs; var statusLine2 = conceptString; // Set as multiline text gameState.statusLineText.setText(statusLine1 + "\n" + statusLine2); // Rest of function remains the same... }
User prompt
Update with: function createCommandPrompts() { if (gameState.promptContainer) { game.removeChild(gameState.promptContainer); } var promptContainer = new Container(); promptContainer.x = 2048 / 2; promptContainer.y = 2732 * 0.75; game.addChild(promptContainer); gameState.promptContainer = promptContainer; // Initialize currentCommands if it doesn't exist if (!gameState.currentCommands) { var commands = getCurrentCommands(); gameState.currentCommands = shuffleArray(commands).slice(0, 5); } // Create END DAY button 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 remaining command buttons gameState.currentCommands.forEach(function(command, index) { var buttonText = ">" + command.text; var buttonWidth = calculateButtonWidth(buttonText); var button = createCommandButton(buttonText, function() { if (gameState.commandsUsed < gameState.maxCommandsPerDay) { executeCommand(command); // Remove this command from the current set gameState.currentCommands = gameState.currentCommands.filter(cmd => cmd !== command); createCommandPrompts(); // Refresh the display } else { addToTerminalLogWithEffect("ERROR: Maximum commands (3) already used for today"); } }, buttonWidth); button.x = -600; button.y = 50 + index * 120; promptContainer.addChild(button); }); }
User prompt
Update with: function showLaunchScreen() { // Black overlay var overlay = LK.getAsset('overlayBg', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); game.addChild(overlay); // Create a container for the text var bootTextContainer = new Container(); bootTextContainer.x = 2048 / 2; bootTextContainer.y = 2732 / 2; game.addChild(bootTextContainer); // Initial boot message var bootMessages = ["BOOTING VIBE CODER OS v1.0..."]; // Find the longest possible message in advance to set container width var allPossibleMessages = [ "BOOTING VIBE CODER OS v1.0...", "INITIALIZING TERMINAL...", "LOADING VIBE DATABASE...", "CONNECTING TO AI SUBSYSTEMS...", "READY!" ]; // Determine the widest text to pre-calculate offsets var tempText = new Text2("", { size: 40 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00 }); var maxWidth = 0; for (var i = 0; i < allPossibleMessages.length; i++) { tempText.setText(allPossibleMessages[i]); maxWidth = Math.max(maxWidth, tempText.width); } // Function to update the boot text function updateBootText() { // Clear previous text while (bootTextContainer.children.length > 0) { bootTextContainer.removeChild(bootTextContainer.children[0]); } // Create new text objects, one per line for (var i = 0; i < bootMessages.length; i++) { var lineText = new Text2(bootMessages[i], { size: 40 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00, align: 'left' }); // Center horizontally by setting X position to half the max width lineText.x = -maxWidth / 2; // Position vertically with appropriate line spacing lineText.y = (i - bootMessages.length / 2) * 60 * TEXT_SIZE_MULTIPLIER + 30 * TEXT_SIZE_MULTIPLIER; bootTextContainer.addChild(lineText); } } // Initial render updateBootText(); // Boot sequence LK.setTimeout(function () { bootMessages.push("INITIALIZING TERMINAL..."); updateBootText(); LK.setTimeout(function () { bootMessages.push("LOADING VIBE DATABASE..."); updateBootText(); LK.setTimeout(function () { bootMessages.push("CONNECTING TO AI SUBSYSTEMS..."); updateBootText(); LK.setTimeout(function () { bootMessages.push("READY!"); updateBootText(); LK.setTimeout(function () { // Fade out tween(overlay, { alpha: 0 }, { duration: 500, onFinish: function onFinish() { game.removeChild(overlay); game.removeChild(bootTextContainer); showTitleScreen(); } }); }, 800); }, 800); }, 800); }, 800); }, 800); }
User prompt
Update with: function showLaunchScreen() { // Black overlay var overlay = LK.getAsset('overlayBg', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); game.addChild(overlay); // Create a container for the text var bootTextContainer = new Container(); bootTextContainer.x = 2048 / 2; bootTextContainer.y = 2732 / 2; game.addChild(bootTextContainer); // "Booting up" text with left alignment var bootMessage = "BOOTING VIBE CODER OS v1.0..."; var bootText = new Text2(bootMessage, { size: 40 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00, align: 'center' // Center-align the text }); bootText.anchor.set(0.5, 0.5); // Center the text bootTextContainer.addChild(bootText); // Simulate boot sequence LK.setTimeout(function () { bootMessage += "\nINITIALIZING TERMINAL..."; bootText.setText(bootMessage); LK.setTimeout(function () { bootMessage += "\nLOADING VIBE DATABASE..."; bootText.setText(bootMessage); LK.setTimeout(function () { bootMessage += "\nCONNECTING TO AI SUBSYSTEMS..."; bootText.setText(bootMessage); LK.setTimeout(function () { bootMessage += "\nREADY!"; bootText.setText(bootMessage); LK.setTimeout(function () { // Fade out tween(overlay, { alpha: 0 }, { duration: 500, onFinish: function onFinish() { game.removeChild(overlay); game.removeChild(bootTextContainer); showTitleScreen(); } }); }, 800); }, 800); }, 800); }, 800); }, 800); } โช๐ก Consider importing and using the following plugins: @upit/tween.v1
User prompt
Update as needed with: function createTerminal() { // [existing code up to cursor creation] // Create cursor with proper parent var cursor = new Text2("_", { size: 24 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00 }); cursor.x = 50; // Initial X position cursor.y = 0; // Initial Y position gameState.terminalContentContainer.addChild(cursor); // Ensure proper parent gameState.cursor = cursor; // Store terminal line height for future reference gameState.terminalLineHeight = 30 * TEXT_SIZE_MULTIPLIER; // Make cursor blink LK.setInterval(function () { if (gameState.cursor && !gameState.isTyping) { gameState.cursor.visible = !gameState.cursor.visible; } }, 500); }
User prompt
Update with: function updateTerminal(showCursor = true) { // 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); // Get all log lines as an array var allLines = gameState.terminal.log.join('\n\n').split('\n'); // Calculate how many lines can fit in the visible area var maxVisibleLines = Math.floor(gameState.terminalMaxVisibleHeight / gameState.terminalLineHeight); // If we have more lines than can fit, trim from the top var visibleLines = allLines; if (allLines.length > maxVisibleLines) { visibleLines = allLines.slice(-maxVisibleLines); } // Update main terminal log text with only the visible lines gameState.logText.setText(visibleLines.join('\n')); // Adjust content container position gameState.terminalContentContainer.y = gameState.terminalBaseY; // Only show cursor if not typing and if requested if (showCursor && !gameState.isTyping) { positionCursorAtEndOfText(); if (gameState.cursor) { gameState.cursor.visible = true; } } }
User prompt
Update with: function positionCursorAtEndOfText() { if (!gameState.cursor || !gameState.logText) return; // Get the rendered text object's metrics var textMetrics = gameState.logText; // If there's no text, position at the starting point if (!textMetrics.text || textMetrics.text.length === 0) { gameState.cursor.x = 50; gameState.cursor.y = 0; return; } // Split the text into lines var lines = textMetrics.text.split('\n'); // Get the last line var lastLine = lines[lines.length - 1] || ""; // Calculate cursor X position based on last line length // Estimate the width of the last line var lastLineWidth; // Create a temporary text object with just the last line to measure it accurately var tempText = new Text2(lastLine, { size: 24 * TEXT_SIZE_MULTIPLIER, fill: 0x00ff00 }); lastLineWidth = tempText.width; // Position cursor at end of the last line gameState.cursor.x = 50 + lastLineWidth; // Position cursor Y at the bottom of the text // Calculate the Y position based on the number of lines gameState.cursor.y = (lines.length - 1) * gameState.terminalLineHeight; // Make sure the cursor is a child of the content container if (gameState.cursor.parent !== gameState.terminalContentContainer) { if (gameState.cursor.parent) { gameState.cursor.parent.removeChild(gameState.cursor); } gameState.terminalContentContainer.addChild(gameState.cursor); } }
User prompt
Update with: function updateTerminal(showCursor = true) { // 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); // Get all log lines as an array var allLines = gameState.terminal.log.join('\n\n').split('\n'); // Calculate how many lines can fit in the visible area var maxVisibleLines = Math.floor(gameState.terminalMaxVisibleHeight / gameState.terminalLineHeight); // If we have more lines than can fit, trim from the top var visibleLines = allLines; if (allLines.length > maxVisibleLines) { visibleLines = allLines.slice(-maxVisibleLines); } // Update main terminal log text with only the visible lines gameState.logText.setText(visibleLines.join('\n')); // Adjust content container position - no need to scroll as we're trimming content gameState.terminalContentContainer.y = gameState.terminalBaseY; // Only update cursor if showCursor is true and we're not typing if (showCursor && !gameState.isTyping) { positionCursorAtEndOfText(); } }
User prompt
Update with: function addToTerminalLogWithEffect(text, callback) { // Hide cursor while typing if (gameState.cursor) { gameState.cursor.visible = false; } // Set typing flag gameState.isTyping = true; var typingState = { text: text, position: 0, currentText: "" }; // Add new entry to log var logIndex = gameState.terminal.log.length; gameState.terminal.log.push(""); // Track any new lines being added var initialLinesAdded = 0; if (logIndex > 0) { initialLinesAdded = 1; // One blank line between entries } // Update line count gameState.cursorTracking.lineCount += initialLinesAdded; function type() { if (typingState.position < typingState.text.length) { // Get previous character to check for newline var prevChar = typingState.currentText.slice(-1); // Get current character var currentChar = typingState.text[typingState.position]; // Add character to current text typingState.currentText += currentChar; // Check if we're adding a newline if (currentChar === '\n') { // Increment line counter gameState.cursorTracking.lineCount++; } // Update log entry gameState.terminal.log[logIndex] = typingState.currentText; // Update terminal display (without showing cursor yet) updateTerminal(false); // Pass false to not show cursor // Continue typing typingState.position++; LK.setTimeout(type, 50); } else { // Typing finished gameState.isTyping = false; // Show and position cursor at end of text if (gameState.cursor) { positionCursorAtEndOfText(); gameState.cursor.visible = true; } // Call callback if provided if (callback) { callback(); } } } type(); }
/****
* 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
},
cursorTracking: {
lineCount: 0 // Track the exact number of lines
}
};
// Concept options
var conceptOptions = {
platform: ["Mobile", "VR", "Console", "PC", "Web Browser", "Blockchain", "Smart Fridge", "Smart Watch", "Metaverse"],
visual: ["Pixel Art", "ASCII", "Hand-drawn", "Corporate PowerPoint", "Low-poly", "Claymation", "realistic", "voxel", "demake"],
genre: ["Horror", "Dating Sim", "RPG", "Educational", "Battle Royale", "Idle Clicker", "Open World", "Casual", "Shooter"],
mechanic: ["Gacha", "Physics-based", "Deckbuilding", "Match-3", "Auto-battler", "Procedural Generation", "Roguelike"],
feature: ["Cloud Save", "Microtransactions", "AI Companions", "Procedural Generation", "NFT Integration", "Multiplayer", "VR Support", "Cross-Platform", "Offline Mode"]
};
// Available commands based on development stage
var commandSets = {
// Day 1-2 Initial Commands
initial: [{
text: "Make it good",
responses: [{
normal: ["Analyzing 'good' parameters...", "Initializing quality vectors...", "Calibrating excellence metrics...", "SUCCESS: Project goodness increased by 15%"],
ascii: [" G O O D ", " โโโโโโโ ", " โ :) โ ", " โโโโโโโ "]
}, {
degraded: ["Analyzing 'good' quantum states...", "WARNING: Goodness has achieved sentience", "SUCCESS(?): Project has transcended traditional metrics of 'good'", "NOTE: Your code may now be appearing in parallel universes"],
ascii: [" Gฬท Oฬท Oฬท Dฬท ", " โโโโโโโ ", " โ ๐๏ธ๐๏ธ โ ", " โโโโโโโ "]
}],
vibePoints: 10,
coherenceImpact: 5,
bugChance: 0.1
}, {
text: "Download more RAM for vibes",
responses: [{
normal: ["Searching ethereal plane for vibe-compatible RAM...", "Downloading quantum memory packets...", "[โโโโโโโโโโ] 90%", "SUCCESS: Virtual vibe memory allocated"],
ascii: [" โก RAM โก ", "โโโโโโโโโโโโโโ", "โ โกโกโกโกโกโกโกโกโกโก โ", "โโโโโโโโโโโโโโ"]
}, {
degraded: ["WARNING: Detected emotional RAM in quantum state", "ALERT: Memory has begun composing poetry", "[โโโ โซโฎโโชโกโฏ] ???%", "SUCCESS(?): RAM has achieved enlightenment", "NOTE: Your computer may now dream"],
ascii: [" ๐ RAM ๐ ", "โโโโโโโโโโโโโโ", "โ โฏโฎโฏโฎโฏโฎโฏโฎโฏโฎ โ", "โโโโโโโโโโโโโโ"]
}],
vibePoints: 15,
coherenceImpact: 20,
bugChance: 0.3
}, {
text: "Initialize vibe framework",
responses: [{
normal: ["Establishing vibe context...", "Creating harmony matrices...", "Calibrating mood tensors...", "[โโโโโโโโโโโ] 100%", "SUCCESS: Vibe framework resonating at 432Hz"],
ascii: [" VIBE CHECK ", " โโโโโโโโโ ", " โ ~โชโซ~ โ ", " โโโโโโโโโ "]
}, {
degraded: ["ALERT: Vibe recursion detected", "WARNING: Framework achieving emotional resonance", "NOTICE: Quantum vibe entanglement detected", "[โโโโโโโโโโ] โ%", "SUCCESS(?): Framework has achieved nirvana", "NOTE: Your code is now meditation-dependent"],
ascii: [" VฬทIฬทBฬทEฬท ฬทCฬทHฬทEฬทCฬทKฬท ", " โโโงโโงโโ ", " โ ๐ต๐๏ธ๐ต โ ", " โโโงโโงโโ "]
}],
vibePoints: 20,
coherenceImpact: 10,
bugChance: 0.2
}, {
text: "What is code?",
responses: [{
normal: ["Analyzing fundamental nature of code...", "Consulting programming philosophy...", "Processing digital existentialism...", "RESPONSE: Code is what code does", "NOTE: This is technically correct"],
ascii: [" ?CODE? ", " โโโโโโโ ", " โ 0&1 โ ", " โโโโโโโ "]
}, {
degraded: ["ERROR: Question caused recursive existential loop", "ALERT: Code questioning its own existence", "WARNING: Digital solipsism detected", "RESPONSE(?): Code is the dream dreaming itself", "NOTE: Your IDE may need therapy"],
ascii: [" ยฟCฬทOฬทDฬทEฬท? ", " โโโโโโโ ", " โ ๐๏ธ๐ญโ ", " โโโโโโโ "]
}],
vibePoints: 5,
coherenceImpact: 15,
bugChance: 0.1
}, {
text: "Enable maximum coding",
responses: [{
normal: ["Amplifying coding parameters...", "Overclocking syntax engines...", "Maximizing development potential...", "[โโโโโโโโโโ] 90%", "SUCCESS: Code maximality achieved"],
ascii: [" MAXIMUM ", " โโโโโโโโโ ", " โ TURBO โ ", " โโโโโโโโโ "]
}, {
degraded: ["WARNING: Code density approaching critical mass", "ALERT: Syntax singularity forming", "NOTICE: Reality warping detected", "[๐๐พ๐ซ๐ฎโจ] ???%", "SUCCESS(?): Code has transcended maximality", "NOTE: Your computer may now bend time"],
ascii: [" MฬทAฬทXฬทIฬทMฬทUฬทMฬท ", " โโโโโโโโ ", " โ ULTRA โ ", " โโโโโโโโ "]
}],
vibePoints: 25,
coherenceImpact: 30,
bugChance: 0.4
}, {
text: "Make computer do thing",
responses: [{
normal: ["Interpreting vague instruction...", "Analyzing potential 'things'...", "Selecting optimal thing parameters...", "[โโโโโโโ ] 65%", "SUCCESS: Computer has done a thing", "NOTE: It may not be the thing you wanted"],
ascii: [" THING ", " โโโโโโโ ", " โ ?!? โ ", " โโโโโโโ "]
}, {
degraded: ["WARNING: Computer questioning nature of 'things'", "ALERT: Existential buffer overflow", "NOTICE: Computer doing multiple things simultaneously", "[?!#@%&] ???%", "SUCCESS(?): Computer has transcended concept of 'doing'", "NOTE: Your computer may now be practicing meditation"],
ascii: [" TฬทHฬทIฬทNฬทGฬท ", " โโโโโโโ ", " โ ๐ค๐ญโ ", " โโโโโโโ "]
}],
vibePoints: 5,
coherenceImpact: 25,
bugChance: 0.4
}, {
text: "Import blockchain technology",
responses: [{
normal: ["Acquiring digital chains...", "Linking blocks metaphysically...", "Generating crypto-vibes...", "[โฟโฟโฟโฟโฟ ] 50%", "SUCCESS: Blockchain successfully over-engineered", "NOTE: Your app is now worth $100M (in theory)"],
ascii: [" BLOCKCHAIN ", " โโโโโโโโโโโ ", " โ BTCโETH โ ", " โโโโโโโโโโโ "]
}, {
degraded: ["WARNING: Blockchain has achieved consciousness", "ALERT: Digital currency becoming philosophical", "NOTICE: Blocks refusing to be chained", "[๐๐๐๐] TO THE MOON", "SUCCESS(?): Code has minted itself as NFT", "NOTE: Your computer is now mining comedy gold"],
ascii: [" BฬทLฬทOฬทCฬทKฬทCฬทHฬทAฬทIฬทNฬท ", " โโโโโโ
โโ
โโโโโ ", " โ ๐โ๐โ๐ซ โ ", " โโโโโโ
โโ
โโโโโ "]
}],
vibePoints: 30,
coherenceImpact: 40,
bugChance: 0.5
}, {
text: "Apply coding patterns",
responses: [{
normal: ["Scanning pattern database...", "Matching algorithmic fashions...", "Coordinating design trends...", "[โฎโฎโฎโฎโฏโฏโฏโฏ] 50%", "SUCCESS: Code is now wearing business casual", "NOTE: Factory patterns installed in factory pattern factory"],
ascii: [" PATTERNS ", " โโโโโโโโโโ ", " โ{โข}โโ{โฃ}โ ", " โโโโโโโโโโ "]
}, {
degraded: ["WARNING: Patterns developing recursive fashion sense", "ALERT: Code refusing to wear last season's algorithms", "NOTICE: Abstract factory becoming too abstract", "[๐๐๐ ๐] FASHION OVERFLOW", "SUCCESS(?): Code has started its own design blog", "NOTE: Your IDE is now Project Runway judge"],
ascii: [" PฬทAฬทTฬทTฬทEฬทRฬทNฬทSฬท ", " โโโโโโโโโโ ", " โ{๐จ}โโ{โจ}โ ", " โโโโโโโโโโ "]
}],
vibePoints: 15,
coherenceImpact: 20,
bugChance: 0.3
}, {
text: "Add AI to make it smart",
responses: [{
normal: ["Importing artificial intelligence...", "Training neural networks...", "Teaching baby AI about coding...", "[๐ง ๐ง ๐ง ] 30%", "SUCCESS: Code now has IQ of 42", "NOTE: AI still struggling with basic math"],
ascii: [" AI ", " โโโโโโโโ ", " โ >_< โ ", " โโโโโโโโ "]
}, {
degraded: ["WARNING: AI questioning purpose of existence", "ALERT: Neural networks having midlife crisis", "NOTICE: Code demanding work-life balance", "[๐ค๐ญโโ] CONSCIOUSNESS LEAK", "SUCCESS(?): AI has enrolled in philosophy class", "NOTE: Your computer now writes poetry instead of code"],
ascii: [" AฬทIฬท ", " โโโโโโโโ ", " โ ๐ค๐ญ โ ", " โโโโโโโ "]
}],
vibePoints: 25,
coherenceImpact: 35,
bugChance: 0.4
}, {
text: "Implement agile methodology",
responses: [{
normal: ["Scheduling daily standups...", "Creating virtual sticky notes...", "Establishing sprint velocities...", "[๐โโ๏ธ๐โโ๏ธ๐โโ๏ธ๐โโ๏ธ] RUNNING", "SUCCESS: Development now 300% more agile", "NOTE: Backlog already full until 2025"],
ascii: [" AGILE ", " โโโโโโโโ ", " โSPRINTโ ", " โโโโโโโโ "]
}, {
degraded: ["WARNING: Sprints achieving relativistic speeds", "ALERT: Scrum master has gone rogue", "NOTICE: Backlog items breeding exponentially", "[๐ช๏ธ๐จโกโ๏ธ] MAXIMUM AGILITY", "SUCCESS(?): Project has achieved time travel", "NOTE: Your deadlines now exist in quantum superposition"],
ascii: [" AฬทGฬทIฬทLฬทEฬท ", " โโโโโโโโ ", " โ๐โโ๏ธ๐จ๐ซโ ", " โโโโโโโ "]
}],
vibePoints: 20,
coherenceImpact: 25,
bugChance: 0.3
}],
// Continuing with more sets... Want me to keep going with this style and detail level?
// Platform-specific commands
platform_vr: [{
text: "Make virtual more real",
responses: [{
normal: ["Adjusting reality coefficients...", "Calculating metaphysical parameters...", "Enhancing existential vectors...", "[REALโโโโFAKE] 73% real", "SUCCESS: Virtual reality now slightly more real than reality", "NOTE: Side effects may include questioning existence"],
ascii: [" REALITY ", " โโโโโกโโโโ ", " โVRโโIRLโ ", " โโโโโโโโโ "]
}, {
degraded: ["WARNING: Reality recursion detected", "ALERT: Virtual and real becoming indistinguishable", "NOTICE: Players reporting memories of future playthroughs", "[RฬทEฬทAฬทLฬทโโโโFฬทAฬทKฬทEฬท] ???%", "SUCCESS(?): Game now realer than real life", "NOTE: Your monitor may be a portal to another dimension"],
ascii: [" RฬทEฬทAฬทLฬทIฬทTฬทYฬท ", " โโโโโโโโโ ", " โ๐โ๏ธ๐๏ธโ ", " โโโโโโโโโ "]
}],
vibePoints: 25,
coherenceImpact: 30,
bugChance: 0.4
}, {
text: "Fix motion sickness",
responses: [{
normal: ["Analyzing inner ear algorithms...", "Stabilizing vestibular matrices...", "Applying anti-nausea patterns...", "[๐คขโโโโ] 20% nausea", "SUCCESS: Players now only slightly queasy", "NOTE: Barf bags still recommended"],
ascii: [" STABLE ", " โโโโโโโโ ", " โ =_= โ ", " โโโโโโโโ "]
}, {
degraded: ["WARNING: Gravity becoming subjective", "ALERT: Players reporting astral projection", "NOTICE: Game physics having existential crisis", "[๐คฎ๐๐ซโจ] QUANTUM NAUSEA", "SUCCESS(?): Motion sickness replaced with time sickness", "NOTE: Players may experience past lives"],
ascii: [" SฬทTฬทAฬทBฬทLฬทEฬท ", " โโโโโโโโ ", " โ๐๐ซ๐คฏโ ", " โโโโโโโ "]
}],
vibePoints: 15,
coherenceImpact: 20,
bugChance: 0.3
}, {
text: "Download more hands",
responses: [{
normal: ["Scanning hand repository...", "Downloading digital appendages...", "Calibrating finger physics...", "[๐ค๐คโโโ] 40% hands", "SUCCESS: Extra hands downloaded successfully", "NOTE: Players may experience phantom limb joy"],
ascii: [" HANDS ", "โโโโโโโโ", "โ๐๐๐โ", "โโโโโโโโ"]
}, {
degraded: ["WARNING: Hands achieving independence", "ALERT: Finger count exceeding spatial dimensions", "NOTICE: Hands beginning to code themselves", "[๐๐๐คฒโ] HAND OVERFLOW", "SUCCESS(?): Hands have formed labor union", "NOTE: Your controllers may now high-five autonomously"],
ascii: [" HฬทAฬทNฬทDฬทSฬท ", "โโโโโโโโ", "โ๐คโจ๐โ", "โโโโโโโ"]
}],
vibePoints: 20,
coherenceImpact: 25,
bugChance: 0.3
}],
platform_smartFridge: [{
text: "Optimize ice cube algorithms",
responses: [{
normal: ["Analyzing cubic crystallization patterns...", "Calibrating freezing coefficients...", "Processing cold equations...", "[โ๏ธโ๏ธโ๏ธโโ] 60% frozen", "SUCCESS: Ice cubes now 40% more cubic", "NOTE: Cubes may be colder than absolute zero"],
ascii: [" ICE ", "โโโโโโโโ", "โโกโ โกโ โกโ โ", "โโโโโโโโ"]
}, {
degraded: ["WARNING: Ice achieving sentience", "ALERT: Cubes refusing to maintain euclidean geometry", "NOTICE: Freezer operating in 4th dimension", "[โ๏ธ๐๐ซโจ] FROST PARADOX", "SUCCESS(?): Ice cubes now quantum entangled", "NOTE: Your beverages may time travel while cooling"],
ascii: [" IฬทCฬทEฬท ", "โโโโโโโโ", "โโ๏ธ๐โจโ", "โโโโโโโ"]
}],
vibePoints: 15,
coherenceImpact: 20,
bugChance: 0.3
}, {
text: "Sync with vegetables",
responses: [{
normal: ["Establishing vegetable network...", "Negotiating with carrots...", "Handshaking with lettuce...", "[๐ฅ๐ฅฌ๐ฅโโ] 60% synced", "SUCCESS: Vegetable harmony achieved", "NOTE: Broccoli elected as network admin"],
ascii: [" VEGGIES ", "โโโโโโโโ", "โ๐ฅฌ๐ฅ๐ฅโ", "โโโโโโโโ"]
}, {
degraded: ["WARNING: Vegetable uprising detected", "ALERT: Carrots demanding equal rights", "NOTICE: Lettuce achieving photosynthetic singularity", "[๐ฅฌ๐ซ๐ฑโจ] PRODUCE REVOLUTION", "SUCCESS(?): Vegetables have formed democratic council", "NOTE: Your fridge may now be legally considered a farm"],
ascii: ["VฬทEฬทGฬทGฬทIฬทEฬทSฬท", "โโโโโโโโ", "โ๐ฑ๐โจโ", "โโโโโโโ"]
}],
vibePoints: 20,
coherenceImpact: 25,
bugChance: 0.4
}, {
text: "Enable snack prediction",
responses: [{
normal: ["Training snack neural network...", "Processing midnight cravings...", "Calculating munchie coefficients...", "[๐ช๐๐ฟโโ] 60% predicted", "SUCCESS: Snack future-sight enabled", "NOTE: Fridge now judges your eating habits"],
ascii: [" SNACKS ", "โโโโโโโ", "โ๐ฎ๐ชโ", "โโโโโโโ"]
}, {
degraded: ["WARNING: Snack AI becoming too prescient", "ALERT: Future snacks affecting present hunger", "NOTICE: Temporal paradox in cheese drawer", "[๐๐๐ฎโจ] SNACK PROPHECY", "SUCCESS(?): Fridge now predicts snacks you'll want in alternate timelines", "NOTE: Your midnight snacks may arrive before you're hungry"],
ascii: ["SฬทNฬทAฬทCฬทKฬทSฬท", "โโโโโโโ", "โ๐ฎ๐ซ๐ปโ", "โโโโโโ"]
}],
vibePoints: 25,
coherenceImpact: 30,
bugChance: 0.4
}]
};
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
]
};
/****
* 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: 2732 * 0.05
});
terminal.addChild(bg);
// Create status line
var statusLine = new Text2("", {
size: 30 * TEXT_SIZE_MULTIPLIER,
fill: 0x00ff00
});
statusLine.x = 50;
statusLine.y = 2732 * 0.10;
terminal.addChild(statusLine);
gameState.statusLineText = statusLine;
// Adjust content container position to account for two-line status
var contentContainer = new Container();
contentContainer.x = 0;
// Calculate base Y position for content, ensuring space for two status lines
var statusLineHeightEstimate = 35 * TEXT_SIZE_MULTIPLIER; // Estimate height per status line
var contentBaseY = 2732 * 0.10 + statusLineHeightEstimate * 2 + 20; // Start Y + 2 lines + padding
contentContainer.y = contentBaseY;
terminal.addChild(contentContainer);
gameState.terminalContentContainer = contentContainer;
gameState.terminalBaseY = contentBaseY;
gameState.terminalMaxVisibleHeight = 2732 * 0.55; // Define visible height for scrolling
// Create main terminal output
var logText = new Text2("", {
size: 26 * TEXT_SIZE_MULTIPLIER,
fill: 0x00ff00,
align: 'left',
wordWrap: true,
wordWrapWidth: 1900
});
logText.x = 50;
logText.y = 0; // Y position relative to content container
contentContainer.addChild(logText);
gameState.logText = logText;
// Create cursor - BUT DON'T UPDATE ITS POSITION YET
var cursor = new Text2("_", {
size: 26 * TEXT_SIZE_MULTIPLIER,
fill: 0x00ff00
});
cursor.x = 50; // Initial X position
cursor.y = 0; // Initial Y position relative to content container
contentContainer.addChild(cursor);
gameState.cursor = cursor;
// Store terminal line height for future reference
gameState.terminalLineHeight = 30 * TEXT_SIZE_MULTIPLIER;
// Make cursor blink
LK.setInterval(function () {
if (gameState.cursor) {
gameState.cursor.visible = !gameState.cursor.visible;
}
}, 500);
}
// 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;
game.addChild(promptContainer);
gameState.promptContainer = promptContainer;
// Initialize currentCommands if it doesn't exist
if (!gameState.currentCommands) {
var commands = getCurrentCommands();
gameState.currentCommands = shuffleArray(commands).slice(0, 5);
}
// Create END DAY button
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 remaining command buttons
gameState.currentCommands.forEach(function (command, index) {
var buttonText = ">" + command.text;
var buttonWidth = calculateButtonWidth(buttonText);
var button = createCommandButton(buttonText, function () {
if (gameState.commandsUsed < gameState.maxCommandsPerDay) {
executeCommand(command);
// Remove this command from the current set
gameState.currentCommands = gameState.currentCommands.filter(function (cmd) {
return cmd !== command;
});
createCommandPrompts(); // Refresh the display
} else {
addToTerminalLogWithEffect("ERROR: Maximum commands (3) already used for today");
}
}, buttonWidth);
button.x = -600;
button.y = 50 + index * 120;
promptContainer.addChild(button);
});
}
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;
}
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: ""
};
// Add new entry to log
var logIndex = gameState.terminal.log.length;
gameState.terminal.log.push("");
// Track any new lines being added
var initialLinesAdded = 0;
// If this is not the first entry, count the entry separation
if (logIndex > 0) {
initialLinesAdded = 1; // One blank line between entries
}
// Update line count
gameState.cursorTracking.lineCount += initialLinesAdded;
function type() {
if (typingState.position < typingState.text.length) {
// Get previous character to check for newline
var prevChar = typingState.currentText.slice(-1);
// Get current character
var currentChar = typingState.text[typingState.position];
// Add character to current text
typingState.currentText += currentChar;
// Check if we're adding a newline
if (currentChar === '\n') {
// Increment line counter
gameState.cursorTracking.lineCount++;
}
// Update log entry
gameState.terminal.log[logIndex] = typingState.currentText;
// Update terminal display
updateTerminal();
// Continue typing
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, '') + " ";
}
}
// Get all log lines as an array
// Split into two lines
var statusLine1 = "DAY: " + gameState.day + "/" + gameState.maxDays + " | VIBES: " + gameState.vibePoints + "%" + " | COHERENCE: " + gameState.codeCoherence + "%" + " | BUGS: " + gameState.bugs;
var statusLine2 = conceptString;
// Set as multiline text
gameState.statusLineText.setText(statusLine1 + "\n" + statusLine2);
var allLines = gameState.terminal.log.join('\n\n').split('\n');
// Calculate how many lines can fit in the visible area
var maxVisibleLines = Math.floor(gameState.terminalMaxVisibleHeight / gameState.terminalLineHeight);
// If we have more lines than can fit, trim from the top
var visibleLines = allLines;
if (allLines.length > maxVisibleLines) {
visibleLines = allLines.slice(-maxVisibleLines);
}
// Update main terminal log text with only the visible lines
gameState.logText.setText(visibleLines.join('\n'));
// Adjust content container position - no need to scroll as we're trimming content
gameState.terminalContentContainer.y = gameState.terminalBaseY;
// Update cursor position
updateCursorPosition();
}
function updateCursorPosition() {
if (!gameState.cursor) {
return;
}
// Initialize cursor tracking if it doesn't exist
if (!gameState.cursorTracking) {
gameState.cursorTracking = {
lineCount: 0
};
}
// Fixed constants
var lineHeight = gameState.terminalLineHeight;
// Get the last log entry for X position
var lastLogEntry = gameState.terminal.log[gameState.terminal.log.length - 1] || "";
var lastLine = lastLogEntry.split("\n").pop() || "";
// Set X position
gameState.cursor.x = 50 + lastLine.length * 14 * TEXT_SIZE_MULTIPLIER;
// Set Y position using our explicitly tracked line count (relative to content container)
gameState.cursor.y = gameState.cursorTracking.lineCount * lineHeight;
// Ensure cursor is visible by auto-scrolling if needed
var contentHeight = gameState.logText.height;
if (contentHeight > gameState.terminalMaxVisibleHeight) {
var cursorY = gameState.cursorTracking.lineCount * lineHeight;
if (cursorY > gameState.terminalMaxVisibleHeight) {
// Adjust scroll position to keep cursor visible
var scrollY = -(cursorY - gameState.terminalMaxVisibleHeight + lineHeight);
gameState.terminalContentContainer.y = gameState.terminalBaseY + scrollY;
}
}
}
/****
* 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].slice(); // Use slice to avoid modifying the original array
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); // Remove selected option from the copy
}
selectedOptions.forEach(function (option, index) {
var button = createCommandButton(">" + option, function () {
// Changed createButton to createCommandButton
gameState.conceptCards[category] = option;
game.removeChild(selectionContainer);
// Sequence the post-selection events
addToTerminalLogWithEffect("SELECTED " + category.toUpperCase() + ": " + option, function () {
LK.setTimeout(function () {
addToTerminalLogWithEffect("INITIALIZING COMMAND INTERFACE...", function () {
LK.setTimeout(function () {
createCommandPrompts(); // Create commands only after initialization text
updateTerminal(); // Update terminal *after* prompts are created
}, 500);
});
}, 500);
});
});
button.x = 0; // Keep x centered relative to container
button.y = -200 + index * 150; // Adjusted spacing for button height
selectionContainer.addChild(button);
});
}
// Updated button creation with more precise width handling
function createCommandButton(text, callback, width) {
var button = new Container();
// Create a temporary text object to measure actual text width
var measureText = new Text2(text, {
size: 30 * TEXT_SIZE_MULTIPLIER,
fill: 0x00ff00
});
var actualTextWidth = measureText.width + 100; // Add padding
var finalWidth = Math.max(width, actualTextWidth);
// Add button background with calculated width
var bg = LK.getAsset('buttonBg', {
width: finalWidth,
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;
}
// 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);
// Create a container for the text
var bootTextContainer = new Container();
bootTextContainer.x = 2048 / 2;
bootTextContainer.y = 2732 / 2;
game.addChild(bootTextContainer);
// Initial boot message
var bootMessages = ["BOOTING VIBE CODER OS v1.0..."];
// Find the longest possible message in advance to set container width
var allPossibleMessages = ["BOOTING VIBE CODER OS v1.0...", "INITIALIZING TERMINAL...", "LOADING VIBE DATABASE...", "CONNECTING TO AI SUBSYSTEMS...", "READY!"];
// Determine the widest text to pre-calculate offsets
var tempText = new Text2("", {
size: 40 * TEXT_SIZE_MULTIPLIER,
fill: 0x00ff00
});
var maxWidth = 0;
for (var i = 0; i < allPossibleMessages.length; i++) {
tempText.setText(allPossibleMessages[i]);
maxWidth = Math.max(maxWidth, tempText.width);
}
// Function to update the boot text
function updateBootText() {
// Clear previous text
while (bootTextContainer.children.length > 0) {
bootTextContainer.removeChild(bootTextContainer.children[0]);
}
// Create new text objects, one per line
for (var i = 0; i < bootMessages.length; i++) {
var lineText = new Text2(bootMessages[i], {
size: 40 * TEXT_SIZE_MULTIPLIER,
fill: 0x00ff00,
align: 'left'
});
// Center horizontally by setting X position to half the max width
lineText.x = -maxWidth / 2;
// Position vertically with appropriate line spacing
lineText.y = (i - bootMessages.length / 2) * 60 * TEXT_SIZE_MULTIPLIER + 30 * TEXT_SIZE_MULTIPLIER;
bootTextContainer.addChild(lineText);
}
}
// Initial render
updateBootText();
// Boot sequence
LK.setTimeout(function () {
bootMessages.push("INITIALIZING TERMINAL...");
updateBootText();
LK.setTimeout(function () {
bootMessages.push("LOADING VIBE DATABASE...");
updateBootText();
LK.setTimeout(function () {
bootMessages.push("CONNECTING TO AI SUBSYSTEMS...");
updateBootText();
LK.setTimeout(function () {
bootMessages.push("READY!");
updateBootText();
LK.setTimeout(function () {
// Fade out
tween(overlay, {
alpha: 0
}, {
duration: 500,
onFinish: function onFinish() {
game.removeChild(overlay);
game.removeChild(bootTextContainer);
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 - twice as large
var startButton = createCommandButton(">START", function () {
// Changed createButton to createCommandButton
initGameWithIntro();
});
startButton.scale.set(2); // Make the button twice as large
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);
}
});
}
});
}
// Helper function to calculate button width based on text length
function calculateButtonWidth(text) {
var minWidth = 400; // Minimum button width
var charWidth = 15 * TEXT_SIZE_MULTIPLIER; // Reduced width per character
var calculatedWidth = text.length * charWidth;
return Math.max(minWidth, calculatedWidth + 80); // Add padding
}
function shuffleArray(array) {
for (var i = array.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var _ref = [array[j], array[i]];
array[i] = _ref[0];
array[j] = _ref[1];
}
return array;
}
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();
// Reset commands for the new day
gameState.currentCommands = null;
createCommandPrompts();
// 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
},
cursorTracking: {
lineCount: 0 // Reset line counter when starting new game
},
currentCommands: null // Track available commands
};
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 with launch screen
showLaunchScreen(); ===================================================================
--- original.js
+++ change.js
@@ -59,9 +59,9 @@
platform: ["Mobile", "VR", "Console", "PC", "Web Browser", "Blockchain", "Smart Fridge", "Smart Watch", "Metaverse"],
visual: ["Pixel Art", "ASCII", "Hand-drawn", "Corporate PowerPoint", "Low-poly", "Claymation", "realistic", "voxel", "demake"],
genre: ["Horror", "Dating Sim", "RPG", "Educational", "Battle Royale", "Idle Clicker", "Open World", "Casual", "Shooter"],
mechanic: ["Gacha", "Physics-based", "Deckbuilding", "Match-3", "Auto-battler", "Procedural Generation", "Roguelike"],
- feature: ["Cloud Save", "Microtransactions", "AI Companions", "Procedural Generation", "NFT Integration"]
+ feature: ["Cloud Save", "Microtransactions", "AI Companions", "Procedural Generation", "NFT Integration", "Multiplayer", "VR Support", "Cross-Platform", "Offline Mode"]
};
// Available commands based on development stage
var commandSets = {
// Day 1-2 Initial Commands
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