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 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 () { 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(); }, 800); } }); }; self.visible = false; 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 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 }); 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; 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.startCursorBlink(); return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ // Game state variables var currentQuestionIndex = 0; var horrorPhase = 0; var lastHorrorEventTime = 0; var playerAnswers = []; var shadowFigures = []; var maxShadowFigures = 3; var screenShakeActive = false; // 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?", "DO YOU WANT TO SEE ME?"]; // 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 })); // Terminal var terminal = game.addChild(new Terminal()); terminal.x = computerScreen.x; terminal.y = computerScreen.y - 80; // Buttons var yesButton = game.addChild(new Button("YES", 300, 120, 'yesButton')); yesButton.x = computerScreen.x - 250; yesButton.y = computerScreen.y + 420; var noButton = game.addChild(new Button("NO", 300, 120, 'noButton')); noButton.x = computerScreen.x + 250; noButton.y = computerScreen.y + 420; // 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 // Hide buttons until first question yesButton.visible = false; noButton.visible = false; // Start the game function startGame() { // Start ambient sounds 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) { // 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 brighter green to make it visible in the dark terminal.children.forEach(function (child) { if (child instanceof Text2) { tween(child, { fill: 0x00FF99 // Brighter green color }, { duration: 500 }); } }); } }); // Play creepy door opening sound LK.getSound('doorCreaking').play(); } // Move to next question currentQuestionIndex++; if (currentQuestionIndex >= questions.length) { // Trigger jumpscare for the last question regardless of answer triggerJumpscare(); } 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 LK.getSound('whisper').play(); break; case 2: // First visual distortion distortionEffect.applyEffect(800, 0.1); break; case 3: // First shadow appearance triggerRandomShadowFigure(0.2); LK.getSound('static').play(); break; case 4: // Stronger audio cue 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 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 () { // 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: LK.getSound('whisper').play(); break; case 2: triggerRandomShadowFigure(0.25); break; } } } };
===================================================================
--- original.js
+++ change.js
@@ -346,9 +346,21 @@
});
tween(terminal, {
tint: 0x111111
}, {
- duration: 1000
+ duration: 1000,
+ onFinish: function onFinish() {
+ // Change terminal text to brighter green to make it visible in the dark
+ terminal.children.forEach(function (child) {
+ if (child instanceof Text2) {
+ tween(child, {
+ fill: 0x00FF99 // Brighter green color
+ }, {
+ duration: 500
+ });
+ }
+ });
+ }
});
// Play creepy door opening sound
LK.getSound('doorCreaking').play();
}