User prompt
Locker appears even after Danger Room. Also increased danger room appearance further into the game along with shorter warning timers
User prompt
Exit Now is bugged also anxiety meter cannot be seen
User prompt
Add anxiety when inside locker and add green timer for safe exiting before the entity reenters, at max anxiety player loses. Make keycard appearance randomized ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Room is set as 25, when retrying player should go back to Room 1.
User prompt
Cannot pass after all entities have passed
User prompt
Make danger rooms harder ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'Timeout.tick error: undefined is not an object (evaluating 'self.timerText.style.fill = 0xff6b35')' in or related to this line: 'self.timerText.style.fill = 0xff6b35;' Line Number: 113
User prompt
Make a new room. Danger Rooms, unlike keycard rooms, a timer is shown and a player has to hide inside a locker for the entity to pass then can exit out and continue ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Now add new types of rooms. Add Keycard rooms in which the player finds a keycard before progressing. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Improve the visuals even more! ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Improve the background even more! ↪💡 Consider importing and using the following plugins: @upit/tween.v1 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Improve visuals further ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make the entire screen have sci-fi art. Then refine the background art ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make the background procedural sci-fi style on each room press. Add downtime between each press ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make game reset on win.
Code edit (1 edits merged)
Please save this source code
User prompt
Room Runner 100
Initial prompt
Player goes through 100 rooms trying to reach room 100 using one forward arrows. About it no twists
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var ForwardButton = Container.expand(function () { var self = Container.call(this); var buttonBackground = self.attachAsset('forwardArrow', { anchorX: 0.5, anchorY: 0.5 }); var arrow = self.attachAsset('arrowTriangle', { anchorX: 0.5, anchorY: 0.5, rotation: Math.PI / 2 }); self.down = function (x, y, obj) { tween(self, { scaleX: 0.95, scaleY: 0.95 }, { duration: 100 }); LK.getSound('roomAdvance').play(); advanceRoom(); }; self.up = function (x, y, obj) { tween(self, { scaleX: 1, scaleY: 1 }, { duration: 100 }); }; return self; }); var RoomDisplay = Container.expand(function () { var self = Container.call(this); var background = self.attachAsset('roomBackground', { anchorX: 0.5, anchorY: 0.5 }); self.updateRoom = function (roomNumber) { // Simple visual feedback for room change tween(self, { alpha: 0.7 }, { duration: 150, onFinish: function onFinish() { tween(self, { alpha: 1 }, { duration: 150 }); } }); }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0xe8e8e8 }); /**** * Game Code ****/ // Game state variables var currentRoom = storage.currentRoom || 1; var maxRoom = 100; var isAdvancing = false; // Sci-fi color palette for procedural backgrounds var sciFiColors = [0x0a0a2e, 0x16213e, 0x0f3460, 0x533483, 0x7209b7, 0x2d1b69, 0x11998e, 0x38817a, 0x4a90e2, 0x6c5ce7, 0x74b9ff, 0x00b894, 0xa29bfe, 0xfd79a8, 0xfdcb6e, 0xe17055, 0x00cec9, 0x55a3ff, 0x5f27cd, 0x341f97]; // Function to get procedural background color based on room number function getSciFiBackgroundColor(roomNum) { // Use room number to create deterministic but varied color selection var baseIndex = (roomNum - 1) % sciFiColors.length; var variation = Math.floor((roomNum - 1) / sciFiColors.length) % 3; var colorIndex = (baseIndex + variation) % sciFiColors.length; return sciFiColors[colorIndex]; } // Create room display var roomDisplay = game.addChild(new RoomDisplay()); roomDisplay.x = 2048 / 2; roomDisplay.y = 2732 / 2 - 200; // Set initial sci-fi background color var initialBackgroundColor = getSciFiBackgroundColor(currentRoom); roomDisplay.children[0].tint = initialBackgroundColor; // Create forward button var forwardButton = game.addChild(new ForwardButton()); forwardButton.x = 2048 / 2; forwardButton.y = 2732 / 2 + 300; // Create room counter text var roomCounterText = new Text2('Room ' + currentRoom + '/' + maxRoom, { size: 120, fill: 0x333333 }); roomCounterText.anchor.set(0.5, 0.5); roomCounterText.x = 2048 / 2; roomCounterText.y = 2732 / 2 - 100; game.addChild(roomCounterText); // Create title text var titleText = new Text2('Room Runner 100', { size: 80, fill: 0x666666 }); titleText.anchor.set(0.5, 0); LK.gui.top.addChild(titleText); titleText.y = 150; // Function to advance to next room function advanceRoom() { if (currentRoom < maxRoom && !isAdvancing) { isAdvancing = true; forwardButton.visible = false; // Hide button during transition currentRoom++; storage.currentRoom = currentRoom; // Update room counter roomCounterText.setText('Room ' + currentRoom + '/' + maxRoom); // Get new sci-fi background color var newBackgroundColor = getSciFiBackgroundColor(currentRoom); // Animate background color change tween(roomDisplay.children[0], { tint: newBackgroundColor }, { duration: 800, easing: tween.easeInOut }); // Update room display roomDisplay.updateRoom(currentRoom); // Add downtime before allowing next press LK.setTimeout(function () { isAdvancing = false; if (currentRoom < maxRoom) { forwardButton.visible = true; // Show button again } }, 1200); // 1.2 second downtime // Check for completion if (currentRoom >= maxRoom) { LK.setTimeout(function () { // Reset game state before showing win storage.currentRoom = 1; currentRoom = 1; LK.showYouWin(); }, 500); } } } // Hide forward button if game is complete if (currentRoom >= maxRoom) { forwardButton.visible = false; roomCounterText.setText('Complete!'); // Auto-trigger win after short delay LK.setTimeout(function () { // Reset game state before showing win storage.currentRoom = 1; currentRoom = 1; LK.showYouWin(); }, 1000); } game.update = function () { // Simple idle animation for the forward button if (LK.ticks % 120 == 0 && currentRoom < maxRoom) { tween(forwardButton, { scaleX: 1.05, scaleY: 1.05 }, { duration: 300, easing: tween.easeInOut, onFinish: function onFinish() { tween(forwardButton, { scaleX: 1, scaleY: 1 }, { duration: 300, easing: tween.easeInOut }); } }); } };
===================================================================
--- original.js
+++ change.js
@@ -74,12 +74,26 @@
****/
// Game state variables
var currentRoom = storage.currentRoom || 1;
var maxRoom = 100;
+var isAdvancing = false;
+// Sci-fi color palette for procedural backgrounds
+var sciFiColors = [0x0a0a2e, 0x16213e, 0x0f3460, 0x533483, 0x7209b7, 0x2d1b69, 0x11998e, 0x38817a, 0x4a90e2, 0x6c5ce7, 0x74b9ff, 0x00b894, 0xa29bfe, 0xfd79a8, 0xfdcb6e, 0xe17055, 0x00cec9, 0x55a3ff, 0x5f27cd, 0x341f97];
+// Function to get procedural background color based on room number
+function getSciFiBackgroundColor(roomNum) {
+ // Use room number to create deterministic but varied color selection
+ var baseIndex = (roomNum - 1) % sciFiColors.length;
+ var variation = Math.floor((roomNum - 1) / sciFiColors.length) % 3;
+ var colorIndex = (baseIndex + variation) % sciFiColors.length;
+ return sciFiColors[colorIndex];
+}
// Create room display
var roomDisplay = game.addChild(new RoomDisplay());
roomDisplay.x = 2048 / 2;
roomDisplay.y = 2732 / 2 - 200;
+// Set initial sci-fi background color
+var initialBackgroundColor = getSciFiBackgroundColor(currentRoom);
+roomDisplay.children[0].tint = initialBackgroundColor;
// Create forward button
var forwardButton = game.addChild(new ForwardButton());
forwardButton.x = 2048 / 2;
forwardButton.y = 2732 / 2 + 300;
@@ -101,15 +115,33 @@
LK.gui.top.addChild(titleText);
titleText.y = 150;
// Function to advance to next room
function advanceRoom() {
- if (currentRoom < maxRoom) {
+ if (currentRoom < maxRoom && !isAdvancing) {
+ isAdvancing = true;
+ forwardButton.visible = false; // Hide button during transition
currentRoom++;
storage.currentRoom = currentRoom;
// Update room counter
roomCounterText.setText('Room ' + currentRoom + '/' + maxRoom);
+ // Get new sci-fi background color
+ var newBackgroundColor = getSciFiBackgroundColor(currentRoom);
+ // Animate background color change
+ tween(roomDisplay.children[0], {
+ tint: newBackgroundColor
+ }, {
+ duration: 800,
+ easing: tween.easeInOut
+ });
// Update room display
roomDisplay.updateRoom(currentRoom);
+ // Add downtime before allowing next press
+ LK.setTimeout(function () {
+ isAdvancing = false;
+ if (currentRoom < maxRoom) {
+ forwardButton.visible = true; // Show button again
+ }
+ }, 1200); // 1.2 second downtime
// Check for completion
if (currentRoom >= maxRoom) {
LK.setTimeout(function () {
// Reset game state before showing win