User prompt
change the starting screen title to youarenotalone
User prompt
add and ending screen
User prompt
don't have the yes and no button on the starting screen
User prompt
make a starting screen with the play button and the settings buttton that can turn off jumpscares or sound
User prompt
add the jumscare after the I AM WATCHING YOU message
User prompt
make the final message I AM WATCHING YOU. make the only answer ware
User prompt
Turn on the light in the game after the door creaking sound effect
User prompt
turn the light in the game after the door sound afect
User prompt
make it so you can see the text in the dark ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
make it so the player can see the terminal screen in the dark
User prompt
when the game is dark light up the text so the player can see
User prompt
Please fix the bug: 'Timeout.tick error: Cannot read properties of undefined (reading 'measureText')' in or related to this line: 'var lastLineWidth = textElement.context.measureText(lastLine).width || textWidth % maxWidth;' Line Number: 250
User prompt
Please fix the bug: 'Timeout.tick error: Cannot read properties of undefined (reading 'measureText')' in or related to this line: 'totalLines += Math.max(1, Math.ceil((textElement.context.measureText(lines[i]).width || textWidth) / maxWidth));' Line Number: 231
User prompt
keep text in terminal screen
User prompt
when the text asks are you afraid of the dark after the player answers make the game dark then play a creapy door oppening soun effect ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
keep the text on the terminal scren
User prompt
make the text stay in the computer sreen
User prompt
make the text on the computer bigger
User prompt
make the screen bigger
Code edit (1 edits merged)
Please save this source code
User prompt
You Are Not Alone
User prompt
make a game were you answer questions about you on a computer. The only answeres are two buttons. Yes or no. Creapy sounds and stuff happen behind you and a moster jumpscares you and kills you at the end with the final question with no answer. YOU ARE NOT ALONE BITCH
Initial prompt
a prequal to italian memes one: tralalero tralala
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var Button = Container.expand(function (text, width, height, color) { var self = Container.call(this); var buttonBackground = self.attachAsset(color || 'yesButton', { anchorX: 0.5, anchorY: 0.5 }); if (width) buttonBackground.width = width; if (height) buttonBackground.height = height; var buttonText = new Text2(text, { size: 60, fill: 0xFFFFFF }); buttonText.anchor.set(0.5, 0.5); self.addChild(buttonText); self.isHovered = false; self.setActive = function (active) { tween(buttonBackground, { alpha: active ? 1 : 0.5 }, { duration: 200 }); self.interactive = active; }; self.setText = function (newText) { buttonText.setText(newText); }; self.down = function (x, y, obj) { tween(buttonBackground, { scaleX: 0.95, scaleY: 0.95 }, { duration: 100 }); LK.getSound('buttonClick').play(); }; self.up = function (x, y, obj) { tween(buttonBackground, { scaleX: 1, scaleY: 1 }, { duration: 100 }); }; self.setActive(true); return self; }); var DistortionEffect = Container.expand(function () { var self = Container.call(this); var overlay = self.attachAsset('distortionOverlay', { anchorX: 0.5, anchorY: 0.5, alpha: 0 }); self.applyEffect = function (duration, intensity) { tween(overlay, { alpha: intensity || 0.15 }, { duration: duration || 500, onFinish: function onFinish() { tween(overlay, { alpha: 0 }, { duration: 300 }); } }); }; return self; }); var EndScreen = Container.expand(function () { var self = Container.call(this); // Create title text var titleText = new Text2("THE END", { size: 120, fill: 0xFF0000 }); titleText.anchor.set(0.5, 0.5); titleText.y = -300; self.addChild(titleText); // Create message text var messageText = new Text2("You have been watched.\nThere is no escape.", { size: 70, fill: 0xFFFFFF }); messageText.anchor.set(0.5, 0.5); messageText.y = -100; self.addChild(messageText); // Create play again button var playAgainButton = self.addChild(new Button("PLAY AGAIN", 500, 150)); playAgainButton.y = 100; // Create menu button var menuButton = self.addChild(new Button("MAIN MENU", 500, 150)); menuButton.y = 300; // Button handlers playAgainButton.up = function () { self.onPlayAgainClick(); }; menuButton.up = function () { self.onMenuClick(); }; self.onPlayAgainClick = function () { // Will be implemented by game }; self.onMenuClick = function () { // Will be implemented by game }; return self; }); var JumpscareMonster = Container.expand(function () { var self = Container.call(this); var monsterGraphic = self.attachAsset('jumpscareMonster', { anchorX: 0.5, anchorY: 0.5, scaleX: 0.1, scaleY: 0.1, alpha: 0 }); self.activate = function () { if (jumpscareEnabled) { if (soundEnabled) { LK.getSound('jumpscare').play(); } self.visible = true; tween(monsterGraphic, { scaleX: 1.5, scaleY: 1.5, alpha: 1 }, { duration: 150, easing: tween.easeOut, onFinish: function onFinish() { LK.setTimeout(function () { LK.showGameOver({ onGameOver: function onGameOver() { showEndScreen(); } }); }, 800); } }); } else { // If jumpscares are disabled, just show game over LK.setTimeout(function () { LK.showGameOver({ onGameOver: function onGameOver() { showEndScreen(); } }); }, 800); } }; self.visible = false; return self; }); var SettingsMenu = Container.expand(function () { var self = Container.call(this); // Create title text var titleText = new Text2("SETTINGS", { size: 100, fill: 0xFFFFFF }); titleText.anchor.set(0.5, 0.5); titleText.y = -300; self.addChild(titleText); // Jumpscares toggle var jumpscareText = new Text2("Jumpscares:", { size: 70, fill: 0xFFFFFF }); jumpscareText.anchor.set(0, 0.5); jumpscareText.x = -200; jumpscareText.y = -100; self.addChild(jumpscareText); var jumpscareToggle = self.addChild(new Button("ON", 200, 80, 'yesButton')); jumpscareToggle.x = 150; jumpscareToggle.y = -100; // Sound toggle var soundText = new Text2("Sound:", { size: 70, fill: 0xFFFFFF }); soundText.anchor.set(0, 0.5); soundText.x = -200; soundText.y = 50; self.addChild(soundText); var soundToggle = self.addChild(new Button("ON", 200, 80, 'yesButton')); soundToggle.x = 150; soundToggle.y = 50; // Back button var backButton = self.addChild(new Button("BACK", 300, 120, 'noButton')); backButton.y = 250; // Button handlers jumpscareToggle.up = function () { self.toggleJumpscares(); }; soundToggle.up = function () { self.toggleSound(); }; backButton.up = function () { self.onBackClick(); }; self.jumpscareEnabled = true; self.soundEnabled = true; self.toggleJumpscares = function () { self.jumpscareEnabled = !self.jumpscareEnabled; jumpscareToggle.setText(self.jumpscareEnabled ? "ON" : "OFF"); }; self.toggleSound = function () { self.soundEnabled = !self.soundEnabled; soundToggle.setText(self.soundEnabled ? "ON" : "OFF"); if (self.soundEnabled) { LK.playMusic('creepyBackground'); } else { LK.stopMusic(); } }; self.onBackClick = function () { // Will be implemented by game }; return self; }); var ShadowFigure = Container.expand(function () { var self = Container.call(this); var shadowShape = self.attachAsset('shadowFigure', { anchorX: 0.5, anchorY: 0.5, alpha: 0 }); self.appear = function (x, y, duration, maxAlpha) { self.x = x; self.y = y; tween(shadowShape, { alpha: maxAlpha || 0.4 }, { duration: duration || 2000, onFinish: function onFinish() { LK.setTimeout(function () { tween(shadowShape, { alpha: 0 }, { duration: 1500 }); }, 1000); } }); }; return self; }); var StartScreen = Container.expand(function () { var self = Container.call(this); // Create title text var titleText = new Text2("YOUARENOTALONE", { size: 120, fill: 0xFF0000 }); titleText.anchor.set(0.5, 0.5); titleText.y = -300; self.addChild(titleText); // Create play button var playButton = self.addChild(new Button("PLAY", 500, 150)); playButton.y = 0; // Create settings button var settingsButton = self.addChild(new Button("SETTINGS", 500, 150)); settingsButton.y = 200; // Button handlers playButton.up = function () { self.onPlayClick(); }; settingsButton.up = function () { self.onSettingsClick(); }; self.onPlayClick = function () { // Will be implemented by game }; self.onSettingsClick = function () { // Will be implemented by game }; return self; }); var Terminal = Container.expand(function () { var self = Container.call(this); var terminalBackground = self.attachAsset('terminalScreen', { anchorX: 0.5, anchorY: 0.5 }); var textContent = new Text2('', { size: 70, fill: 0x00FF00 // Bright green color for visibility in dark conditions }); textContent.anchor.set(0, 0); textContent.x = -terminalBackground.width / 2 + 50; textContent.y = -terminalBackground.height / 2 + 50; textContent.maxWidth = terminalBackground.width - 100; // Set max width to keep text inside terminal self.addChild(textContent); var cursor = self.attachAsset('cursor', { anchorX: 0, anchorY: 0 }); cursor.x = textContent.x; cursor.y = textContent.y; cursor.alpha = 1; var cursorBlinkTimer = null; self.startCursorBlink = function () { cursorBlinkTimer = LK.setInterval(function () { cursor.alpha = cursor.alpha > 0 ? 0 : 1; }, 500); }; self.stopCursorBlink = function () { if (cursorBlinkTimer) { LK.clearInterval(cursorBlinkTimer); cursorBlinkTimer = null; } cursor.alpha = 1; }; self.displayText = function (text, callback) { self.stopCursorBlink(); var currentText = ''; var index = 0; var typingInterval = LK.setInterval(function () { if (index < text.length) { currentText += text[index]; textContent.setText(currentText); // Ensure text stays within terminal boundaries textContent.maxWidth = terminalBackground.width - 100; // Keep cursor within terminal boundaries var cursorPosition = calculateCursorPosition(currentText, textContent); cursor.x = cursorPosition.x; cursor.y = cursorPosition.y; if (soundEnabled) { LK.getSound('typing').play(); } index++; } else { LK.clearInterval(typingInterval); self.startCursorBlink(); if (callback) callback(); } }, 50); // Helper function to calculate cursor position with word wrapping function calculateCursorPosition(text, textElement) { // Get the text metrics using the text element's properties var textWidth = textElement.width; var lineHeight = 75; var maxWidth = terminalBackground.width - 100; // Force text to wrap at maxWidth textContent.maxWidth = maxWidth; // Calculate total lines based on wrapped text var lines = text.split('\n'); var totalLines = 0; for (var i = 0; i < lines.length; i++) { // Account for natural line breaks // Safely access context or use fallback for text measurement var lineWidth = textWidth; if (textElement.context && typeof textElement.context.measureText === 'function') { lineWidth = textElement.context.measureText(lines[i]).width || textWidth; } totalLines += Math.max(1, Math.ceil(lineWidth / maxWidth)); } // If text fits in one line if (textWidth <= maxWidth && text.indexOf('\n') === -1) { return { x: textContent.x + textWidth + 5, y: textContent.y }; } // If text wraps to multiple lines // Calculate which line the cursor should be on var lineNumber = totalLines - 1; // Calculate cursor x position on the last line var lastLine = lines[lines.length - 1]; var lastLineWidth = textWidth % maxWidth; if (textElement.context && typeof textElement.context.measureText === 'function') { lastLineWidth = textElement.context.measureText(lastLine).width || textWidth % maxWidth; } if (lastLineWidth === 0 || lastLineWidth > maxWidth) lastLineWidth = maxWidth; // Ensure position stays within terminal bounds var xPos = textContent.x + Math.min(lastLineWidth, maxWidth - 10) + 5; var yPos = textContent.y + lineNumber * lineHeight; // Make sure cursor doesn't go outside terminal bounds xPos = Math.min(xPos, textContent.x + maxWidth - 30); return { x: xPos, y: yPos }; } }; self.clearText = function () { textContent.setText(''); cursor.x = textContent.x; cursor.y = textContent.y; }; self.displayFinalMessage = function () { self.clearText(); textContent.fill = 0xFF0000; // Change text color to red for final message var finalMessage = "I AM WATCHING YOU"; self.displayText(finalMessage, function () { LK.setTimeout(function () { // After displaying the message, trigger jumpscare instead of game over triggerJumpscare(); }, 3000); }); }; self.startCursorBlink(); return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ // Game state variables var gameState = "menu"; // "menu", "settings", "game" var currentQuestionIndex = 0; var horrorPhase = 0; var lastHorrorEventTime = 0; var playerAnswers = []; var shadowFigures = []; var maxShadowFigures = 3; var screenShakeActive = false; var jumpscareEnabled = true; var soundEnabled = true; // Questions array var questions = ["SYSTEM INITIALIZING...\nWelcome to the personality assessment test. Please answer honestly.", "Are you alone right now?", "Do you feel safe where you are?", "Do you believe in the supernatural?", "Are you afraid of the dark?", "Would you notice if something in your environment changed?", "Can you hear me breathing?", "Do you feel like someone is watching you?", "Would you know if I was standing right behind you?", "Are you sure you're still alone?", "Are you aware?"]; // Create menu screens var startScreen = game.addChild(new StartScreen()); startScreen.x = 2048 / 2; startScreen.y = 2732 / 2; var settingsMenu = game.addChild(new SettingsMenu()); settingsMenu.x = 2048 / 2; settingsMenu.y = 2732 / 2; settingsMenu.visible = false; var endScreen = game.addChild(new EndScreen()); endScreen.x = 2048 / 2; endScreen.y = 2732 / 2; endScreen.visible = false; // Create game elements - initially hidden // Create the computer setup var computerScreen = game.addChild(LK.getAsset('computerScreen', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 - 200, scaleX: 1.5, scaleY: 1.5 })); computerScreen.visible = false; // Terminal var terminal = game.addChild(new Terminal()); terminal.x = computerScreen.x; terminal.y = computerScreen.y - 80; terminal.visible = false; // Buttons var yesButton = game.addChild(new Button("YES", 300, 120, 'yesButton')); yesButton.x = computerScreen.x - 250; yesButton.y = computerScreen.y + 420; yesButton.visible = false; var noButton = game.addChild(new Button("NO", 300, 120, 'noButton')); noButton.x = computerScreen.x + 250; noButton.y = computerScreen.y + 420; noButton.visible = false; // Horror elements var distortionEffect = game.addChild(new DistortionEffect()); distortionEffect.x = 2048 / 2; distortionEffect.y = 2732 / 2; var jumpscareMonster = game.addChild(new JumpscareMonster()); jumpscareMonster.x = 2048 / 2; jumpscareMonster.y = 2732 / 2; // Initialize shadow figures for (var i = 0; i < maxShadowFigures; i++) { var shadow = new ShadowFigure(); shadowFigures.push(shadow); game.addChild(shadow); } // Display stats in top right var statsText = new Text2("", { size: 60, fill: 0xFFFFFF }); statsText.anchor.set(1, 0); statsText.x = 2048 - 30; statsText.y = 30; LK.gui.addChild(statsText); statsText.visible = false; // Hidden in release // Menu handlers startScreen.onPlayClick = function () { showGameScreen(); }; startScreen.onSettingsClick = function () { showSettingsScreen(); }; settingsMenu.onBackClick = function () { showMenuScreen(); }; endScreen.onPlayAgainClick = function () { showGameScreen(); }; endScreen.onMenuClick = function () { showMenuScreen(); }; // Show different screens function showMenuScreen() { gameState = "menu"; startScreen.visible = true; settingsMenu.visible = false; endScreen.visible = false; hideGameElements(); } function showEndScreen() { gameState = "end"; startScreen.visible = false; settingsMenu.visible = false; endScreen.visible = true; hideGameElements(); } function showSettingsScreen() { gameState = "settings"; startScreen.visible = false; settingsMenu.visible = true; hideGameElements(); } function showGameScreen() { gameState = "game"; startScreen.visible = false; settingsMenu.visible = false; showGameElements(); startGame(); } function hideGameElements() { computerScreen.visible = false; terminal.visible = false; yesButton.visible = false; noButton.visible = false; } function showGameElements() { computerScreen.visible = true; terminal.visible = true; // Buttons will be shown by the game logic } // Start the main game function startGame() { // Apply settings jumpscareEnabled = settingsMenu.jumpscareEnabled; soundEnabled = settingsMenu.soundEnabled; // Reset game state currentQuestionIndex = 0; horrorPhase = 0; lastHorrorEventTime = 0; playerAnswers = []; // Start ambient sounds if enabled if (soundEnabled) { LK.playMusic('creepyBackground'); } // Show first question displayNextQuestion(); // Set button click handlers yesButton.up = handleYesClick; noButton.up = handleNoClick; } function handleYesClick(x, y, obj) { processAnswer(true); } function handleNoClick(x, y, obj) { processAnswer(false); } function processAnswer(isYes) { // Store answer playerAnswers.push(isYes); // Hide buttons during transition yesButton.visible = false; noButton.visible = false; // Progress horror based on question number progressHorrorPhase(); // Special case for "Are you afraid of the dark?" question (index 4) if (currentQuestionIndex === 4) { // Play creepy door opening sound first if (soundEnabled) { LK.getSound('doorCreaking').play(); } // Wait for sound to play a bit before turning off the lights LK.setTimeout(function () { // Make the screen dark by applying a black tint to the computer screen and terminal tween(computerScreen, { tint: 0x111111 }, { duration: 1000 }); tween(terminal, { tint: 0x111111 }, { duration: 1000, onFinish: function onFinish() { // Change terminal text to bright neon green to make it highly visible in the dark terminal.children.forEach(function (child) { if (child instanceof Text2) { tween(child, { fill: 0x00FF00, // Bright neon green color for maximum visibility in dark alpha: 1.0 // Full opacity }, { duration: 500 }); } }); // Turn the lights back on after a brief period LK.setTimeout(function () { // Restore normal colors by removing the dark tint tween(computerScreen, { tint: 0xFFFFFF // Reset to no tint }, { duration: 1000 }); tween(terminal, { tint: 0xFFFFFF // Reset to no tint }, { duration: 1000 }); }, 3000); // Wait 3 seconds after going dark before turning lights back on } }); }, 1000); // Wait one second after door sound before turning off lights } // Move to next question currentQuestionIndex++; if (currentQuestionIndex >= questions.length) { // Display final message instead of jumpscare terminal.displayFinalMessage(); } else { // Brief pause before next question LK.setTimeout(function () { displayNextQuestion(); }, 1000); } } function displayNextQuestion() { terminal.clearText(); terminal.displayText(questions[currentQuestionIndex], function () { // Only show buttons for actual questions (not the intro) if (currentQuestionIndex > 0) { yesButton.visible = true; noButton.visible = true; // Special case for last question if (currentQuestionIndex === questions.length - 1) { // Make the buttons more ominous yesButton.setText("YES"); noButton.setText("NO"); } } else { // For intro message, auto-advance after delay LK.setTimeout(function () { currentQuestionIndex++; displayNextQuestion(); }, 3000); } }); } function progressHorrorPhase() { horrorPhase++; updateStats(); // Trigger horror effects based on phase switch (horrorPhase) { case 1: // Subtle audio cue if (soundEnabled) { LK.getSound('whisper').play(); } break; case 2: // First visual distortion distortionEffect.applyEffect(800, 0.1); break; case 3: // First shadow appearance triggerRandomShadowFigure(0.2); if (soundEnabled) { LK.getSound('static').play(); } break; case 4: // Stronger audio cue if (soundEnabled) { LK.getSound('heartbeat').play(); } // Screen glitch distortionEffect.applyEffect(1200, 0.25); break; case 5: // Multiple shadow figures triggerRandomShadowFigure(0.3); LK.setTimeout(function () { triggerRandomShadowFigure(0.3); }, 2000); break; case 6: // Heavy distortion distortionEffect.applyEffect(1500, 0.4); startScreenShake(1000, 5); break; case 7: // Combined effects if (soundEnabled) { LK.getSound('heartbeat').play(); LK.getSound('whisper').play(); } triggerRandomShadowFigure(0.5); break; case 8: // Build-up to finale distortionEffect.applyEffect(2000, 0.5); startScreenShake(1500, 10); break; case 9: // Near finale - severe distortions for (var i = 0; i < 3; i++) { LK.setTimeout(function () { distortionEffect.applyEffect(300, 0.6); if (!screenShakeActive) startScreenShake(500, 15); }, i * 800); } break; } } function triggerRandomShadowFigure(alpha) { // Choose a random position at the edge of the screen var positions = [{ x: 300, y: 500 }, // Left side { x: 2048 - 300, y: 700 }, // Right side { x: 2048 / 2, y: 2732 - 400 }, // Bottom { x: 400, y: 2732 / 2 }, // Left middle { x: 2048 - 400, y: 2732 / 2 } // Right middle ]; var position = positions[Math.floor(Math.random() * positions.length)]; // Find an available shadow figure for (var i = 0; i < shadowFigures.length; i++) { if (shadowFigures[i].alpha < 0.1) { shadowFigures[i].appear(position.x, position.y, 3000, alpha); break; } } } function startScreenShake(duration, intensity) { if (screenShakeActive) return; screenShakeActive = true; var startTime = Date.now(); var originalX = computerScreen.x; var originalY = computerScreen.y; var shakeInterval = LK.setInterval(function () { var elapsed = Date.now() - startTime; if (elapsed >= duration) { LK.clearInterval(shakeInterval); computerScreen.x = originalX; computerScreen.y = originalY; terminal.x = originalX; terminal.y = originalY - 50; screenShakeActive = false; return; } // Calculate diminishing intensity var currentIntensity = intensity * (1 - elapsed / duration); // Apply random offset var offsetX = (Math.random() - 0.5) * 2 * currentIntensity; var offsetY = (Math.random() - 0.5) * 2 * currentIntensity; computerScreen.x = originalX + offsetX; computerScreen.y = originalY + offsetY; terminal.x = originalX + offsetX; terminal.y = originalY - 50 + offsetY; }, 16); // ~60fps } function triggerJumpscare() { // Final extreme distortion distortionEffect.applyEffect(500, 0.8); // Brief pause before jumpscare LK.setTimeout(function () { // Activate the jumpscare jumpscareMonster.activate(); }, 1500); } function updateStats() { // For debugging - shows current game state statsText.setText("Phase: " + horrorPhase + "\nQuestion: " + currentQuestionIndex); } // Start the game startGame(); // Main update loop game.update = function () { // Only run game logic in game state if (gameState === "game") { // Trigger random horror events during later phases if (horrorPhase > 5) { var currentTime = Date.now(); if (currentTime - lastHorrorEventTime > 10000) { // Every 10 seconds lastHorrorEventTime = currentTime; // Random minor horror effect var effect = Math.floor(Math.random() * 3); switch (effect) { case 0: distortionEffect.applyEffect(300, 0.2); break; case 1: if (soundEnabled) { LK.getSound('whisper').play(); } break; case 2: triggerRandomShadowFigure(0.25); break; } } } } };
===================================================================
--- original.js
+++ change.js
@@ -257,9 +257,9 @@
});
var StartScreen = Container.expand(function () {
var self = Container.call(this);
// Create title text
- var titleText = new Text2("DO YOU FEEL SAFE?", {
+ var titleText = new Text2("YOUARENOTALONE", {
size: 120,
fill: 0xFF0000
});
titleText.anchor.set(0.5, 0.5);