Code edit (5 edits merged)
Please save this source code
User prompt
so currently is at the top right and part of it is outside the screen. Move it to be bottom middle under the player asset.
User prompt
Move stress bar to the top middle
User prompt
Move the stress bar to the left
User prompt
## Where to Make Changes You should make the following changes: 1. **Create a Container for the Stress UI Elements**: - Create a new Container that will hold all stress-related UI elements (progressBarBackground, progressBarFill, and statusLabel) - This container can be added to LK.gui and positioned as needed 2. **Modify the Current Initialization Code**: - Find where progressBarBackground, progressBarFill, and statusLabel are created (around lines where they are defined) - Instead of adding them directly to LK.gui, add them to your new container - Make their positions relative to the container (0,0) instead of absolute screen positions 3. **Add Drag Functionality to the Container**: - Similar to how the Clock class has drag functionality, add down, up, and move handlers to your stress UI container - Implement the same logic to track dragOffsetX and dragOffsetY and handle the dragging 4. **Update the updateStressBar Function**: - Make sure the updateStressBar function still works with the new container structure
User prompt
make the problems text larger so that it can be seen
User prompt
on the right make the length of the line varied
User prompt
The code i still outside the box that I aske it to be in ?
User prompt
The code should be in that small window not outside it !
User prompt
create a small window with code. Colored lines added at the bottom and moving the upper ones. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
create a screen that looks like there is a program running. Just colored lines.
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'toGlobal')' in or related to this line: 'var globalPos = obj.parent.toGlobal(obj.position);' Line Number: 120
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'toGlobal')' in or related to this line: 'var globalPos = obj.parent.toGlobal(obj.position);' Line Number: 120
User prompt
make the clock so that I can drag it !
Code edit (1 edits merged)
Please save this source code
Code edit (12 edits merged)
Please save this source code
User prompt
make the background of the clock transparent
User prompt
The clock frame is a circle !
User prompt
Update clock. The shape is a circle !
User prompt
It's not a square It's round. There are four sigs like in a cloc
User prompt
It's round and the indicators move rapidly !
User prompt
ON the background create a round object that has two indicators and looks like a clock and the indicators move ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
User prompt
Nothing changed !
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
var Clock = Container.expand(function () {
var self = Container.call(this);
// Create clock face
var clockFace = LK.getAsset('progressBar', {
anchorX: 0.5,
anchorY: 0.5,
width: 400,
height: 400,
tint: 0xFFFFFF
//alpha: 0 // Make it transparent
});
// Make sure clock face is circular by setting borderRadius
clockFace.shape = 'ellipse';
self.addChild(clockFace);
// Create four indicators like in a typical clock at 12, 3, 6, and 9 positions
// 12 o'clock indicator
var indicator12 = LK.getAsset('progressBar', {
anchorX: 0.5,
anchorY: 0.5,
width: 20,
height: 40,
tint: 0x000000
});
indicator12.x = 0;
indicator12.y = -150; // Top
self.addChild(indicator12);
// 3 o'clock indicator
var indicator3 = LK.getAsset('progressBar', {
anchorX: 0.5,
anchorY: 0.5,
width: 40,
height: 20,
tint: 0x000000
});
indicator3.x = 150; // Right
indicator3.y = 0;
self.addChild(indicator3);
// 6 o'clock indicator
var indicator6 = LK.getAsset('progressBar', {
anchorX: 0.5,
anchorY: 0.5,
width: 20,
height: 40,
tint: 0x000000
});
indicator6.x = 0;
indicator6.y = 150; // Bottom
self.addChild(indicator6);
// 9 o'clock indicator
var indicator9 = LK.getAsset('progressBar', {
anchorX: 0.5,
anchorY: 0.5,
width: 40,
height: 20,
tint: 0x000000
});
indicator9.x = -150; // Left
indicator9.y = 0;
self.addChild(indicator9);
// Create hour hand
var hourHand = LK.getAsset('progressBar', {
anchorX: 0.5,
anchorY: 0,
width: 15,
height: 120,
tint: 0x000000
});
self.addChild(hourHand);
// Create minute hand
var minuteHand = LK.getAsset('progressBar', {
anchorX: 0.5,
anchorY: 0,
width: 8,
height: 180,
tint: 0x555555
});
self.addChild(minuteHand);
// Clock center dot
var centerDot = LK.getAsset('progressBar', {
anchorX: 0.5,
anchorY: 0.5,
width: 20,
height: 20,
tint: 0x000000,
shape: 'ellipse'
});
self.addChild(centerDot);
// Add interactive capabilities for dragging
self.interactive = true;
var isDragging = false;
var dragOffsetX = 0;
var dragOffsetY = 0;
// Event handler for when pressed down on the clock
self.down = function (x, y, obj) {
isDragging = true;
// Calculate offset between touch point and clock center
var globalPos = obj.parent.toGlobal(obj.position);
var localPos = game.toLocal(globalPos);
dragOffsetX = x - localPos.x;
dragOffsetY = y - localPos.y;
// Play sound feedback when starting to drag
LK.getSound('tap').play();
};
// Event handler for when released
self.up = function () {
isDragging = false;
};
// Event handler for movement
self.move = function (x, y, obj) {
if (isDragging) {
self.x = x - dragOffsetX;
self.y = y - dragOffsetY;
// Make sure clock stays within the screen bounds
self.x = Math.max(200, Math.min(self.x, 2048 - 200));
self.y = Math.max(200, Math.min(self.y, 2732 - 200));
}
};
// Initialize hands
self.updateClock = function () {
// Make the clock hands move rapidly by using LK.ticks
var ticks = LK.ticks;
// Hour hand completes full rotation every 1 second (60 frames)
var hourAngle = ticks % 60 / 60 * 2 * Math.PI;
hourHand.rotation = hourAngle;
// Minute hand rotates even faster (complete rotation in 0.25 seconds)
var minuteAngle = ticks % 15 / 15 * 2 * Math.PI;
minuteHand.rotation = minuteAngle;
};
// Initial update
self.updateClock();
return self;
});
var Player = Container.expand(function () {
var self = Container.call(this);
var playerGraphic = self.attachAsset('player', {
anchorX: 0.5,
anchorY: 0.5
});
// Create status text once
self.statusText = new Text2("I'm fine!", {
size: 200,
fill: 0x000000,
lineHeight: 60,
stroke: 0x000000,
strokeThickness: 5
});
// Initialize the style object properly
self.statusText.style = {
fill: 0x000000,
fontSize: 40
};
self.statusText.anchor.set(0.5);
// Position relative to self, not self.player which doesn't exist
self.statusText.x = 0; // Center relative to player
self.statusText.y = -2000; // 50px above player
self.addChild(self.statusText);
// Update appearance based on stress level
self.updateAppearance = function (stress) {
// Visual changes based on stress
if (stress < 30) {
playerGraphic.tint = 0x3498db; // Normal blue
self.statusText.setText("I'm fine!");
self.statusText.style.fill = 0x000000;
self.statusText.style.fontSize = 40;
tween.stop(self);
tween(self, {
rotation: 0,
scaleX: 1,
scaleY: 1
}, {
duration: 300,
easing: tween.easeOut
});
} else if (stress < 60) {
playerGraphic.tint = 0x9b59b6; // Purple - getting stressed
self.statusText.setText("I'm FINE!");
self.statusText.style.fill = 0x660000;
self.statusText.style.fontSize = 45;
tween.stop(self);
tween(self, {
rotation: 0,
scaleX: 1,
scaleY: 1
}, {
duration: 300,
easing: tween.easeOut
});
} else if (stress < 90) {
playerGraphic.tint = 0xe74c3c; // Red - very stressed
self.statusText.setText("I'M FINE!!");
self.statusText.style.fill = 0xFF0000;
self.statusText.style.fontSize = 50;
// Add slight wobble
tween.stop(self);
tween(self, {
rotation: 0.05
}, {
duration: 300,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(self, {
rotation: -0.05
}, {
duration: 300,
easing: tween.easeInOut,
onFinish: function onFinish() {
if (stressLevel >= 60) {
self.updateAppearance(stressLevel);
}
}
});
}
});
} else {
playerGraphic.tint = 0xff0000; // Bright red - about to lose it
self.statusText.setText("I'M FINE!!!");
self.statusText.style.fill = 0xFF0000;
self.statusText.style.fontSize = 55;
// Add more dramatic wobble
tween.stop(self);
tween(self, {
rotation: 0.1,
scaleX: 1.1,
scaleY: 0.9
}, {
duration: 200,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(self, {
rotation: -0.1,
scaleX: 0.9,
scaleY: 1.1
}, {
duration: 200,
easing: tween.easeInOut,
onFinish: function onFinish() {
if (stressLevel >= 90) {
self.updateAppearance(stressLevel);
}
}
});
}
});
}
};
return self;
});
var Problem = Container.expand(function () {
var self = Container.call(this);
// Different problem types with text and color
var problemTypes = [{
text: "WiFi Down!",
color: 0xff4d4d,
fontSize: 200
}, {
text: "Coffee Spill!",
color: 0x8b4513
}, {
text: "Deadline Changed!",
color: 0xff9900
}, {
text: "Surprise Meeting!",
color: 0x9933cc
}, {
text: "Traffic Jam!",
color: 0x666666,
fontSize: 200
}, {
text: "Phone Died!",
color: 0x000000,
fontSize: 200
}, {
text: "Email Overload!",
color: 0x3366ff,
fontSize: 200
}, {
text: "Printer Error!",
color: 0xcc0000,
fontSize: 200
}, {
text: "Noisy Neighbors!",
color: 0x99cc00,
fontSize: 200
}, {
text: "Low Battery!",
color: 0xff6600,
fontSize: 200
}];
// Choose random problem type
var typeIndex = Math.floor(Math.random() * problemTypes.length);
var type = problemTypes[typeIndex];
// Create problem visual
var problemGraphic = self.attachAsset('problem', {
anchorX: 0.5,
anchorY: 0.5,
tint: type.color
});
// Add problem text
var problemText = new Text2(type.text, {
size: 24,
fill: 0xFFFFFF,
align: 'center',
wordWrap: true,
wordWrapWidth: 130
});
problemText.anchor.set(0.5, 0.5);
self.addChild(problemText);
// Problem properties
self.fallSpeed = 2 + Math.random() * 3;
self.rotationSpeed = (Math.random() - 0.5) * 0.05;
self.stressValue = Math.ceil(Math.random() * 3);
self.active = true;
// Handle tap
self.down = function (x, y, obj) {
if (!self.active) {
return;
}
self.active = false;
LK.getSound('tap').play();
// Tween to make it disappear
tween(self, {
alpha: 0,
scaleX: 0.2,
scaleY: 0.2
}, {
duration: 300,
easing: tween.easeOut,
onFinish: function onFinish() {
self.destroy();
}
});
// Award more points at higher levels
if (gameLevel < 10) {
score += 1;
} else {
score += 2;
}
scoreText.setText("SCORE: " + score);
};
// Update method called each frame
self.update = function () {
if (!self.active) {
return;
}
// Move problem downward
self.y += self.fallSpeed;
self.rotation += self.rotationSpeed;
// Check if problem hit the floor
if (self.y > 2732) {
stressLevel += self.stressValue;
updateStressBar();
LK.getSound('stress').play();
// Visual feedback
LK.effects.flashScreen(0xff0000, 200, 0.3);
self.destroy();
}
};
return self;
});
var ProgramDisplay = Container.expand(function () {
var self = Container.call(this);
// Configuration
self.lineHeight = 15;
self.gapBetweenLines = 5;
self.totalWidth = 1800;
self.colors = [0x00ff00, 0x66ff66, 0x00ccff, 0xff9900, 0xff3366, 0xcc66ff, 0xffff00];
self.lines = [];
self.speedRanges = [0.5, 1, 1.5, 2, 2.5, 3];
// Create lines with different colors and lengths
self.createLines = function (numLines) {
// Clear existing lines
for (var i = 0; i < self.lines.length; i++) {
if (self.lines[i].parent) {
self.removeChild(self.lines[i]);
}
}
self.lines = [];
// Create new lines
for (var i = 0; i < numLines; i++) {
var lineColor = self.colors[Math.floor(Math.random() * self.colors.length)];
var lineLength = Math.random() * self.totalWidth * 0.8 + self.totalWidth * 0.2;
var line = LK.getAsset('progressBar', {
anchorX: 0,
anchorY: 0.5,
width: lineLength,
height: self.lineHeight,
tint: lineColor
});
line.x = -lineLength; // Start off-screen to the left
line.y = i * (self.lineHeight + self.gapBetweenLines);
line.speed = self.speedRanges[Math.floor(Math.random() * self.speedRanges.length)];
line.totalDistance = self.totalWidth + lineLength;
line.currentPosition = 0;
self.addChild(line);
self.lines.push(line);
}
};
// Update animation
self.update = function () {
for (var i = 0; i < self.lines.length; i++) {
var line = self.lines[i];
line.currentPosition += line.speed;
line.x = -line.width + line.currentPosition % line.totalDistance;
}
};
// Initialize with default number of lines
self.createLines(100);
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0xe8f4f8 // Light blue background
});
/****
* Game Code
****/
// Replace with actual ID
// Replace with actual ID
// Replace with actual ID
// Replace with actual ID
// Replace with actual ID
// Replace with actual ID
// Game state variables
var score = 0;
var stressLevel = 0;
var gameLevel = 1;
var problems = [];
var problemSpawnTime = 2000; // ms
var lastProblemTime = 0;
var player;
var scoreText;
var levelText;
var progressBarBackground;
var progressBarFill;
var gameRunning = true;
// Set up background
var background = LK.getAsset('background', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2,
y: 2732 / 2
});
game.addChild(background);
// Set up player
player = new Player();
player.x = 2048 / 2;
player.y = 2732 - 300;
game.addChild(player);
// Set up score text
scoreText = new Text2("SCORE: 0", {
size: 60,
fill: 0x000000
});
scoreText.anchor.set(0.5, 0);
scoreText.x = 2048 / 2;
scoreText.y = 20;
LK.gui.top.addChild(scoreText);
// Set up level text
levelText = new Text2("LEVEL: 1", {
size: 40,
fill: 0x000000
});
levelText.anchor.set(0, 0);
levelText.x = 150; // Leave space for the top-left menu icon
levelText.y = 30;
LK.gui.addChild(levelText);
// Game title
var titleText = new Text2("I'M FINE!", {
size: 70,
fill: 0xff4d4d,
fontWeight: 'bold'
});
titleText.anchor.set(1, 0);
titleText.x = 2048 - 150;
titleText.y = 50;
LK.gui.addChild(titleText);
// Stress bar
progressBarBackground = LK.getAsset('progressBar', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2,
y: 120
});
LK.gui.addChild(progressBarBackground);
progressBarFill = LK.getAsset('progressFill', {
anchorX: 0,
anchorY: 0.5,
x: (2048 - 1000) / 2,
y: 120,
width: 0 // Start with 0 width
});
LK.gui.addChild(progressBarFill);
// Status label
var statusLabel = new Text2("STRESS LEVEL", {
size: 30,
fill: 0x000000
});
statusLabel.anchor.set(0.5, 1);
statusLabel.x = 2048 / 2;
statusLabel.y = progressBarBackground.y - 35;
LK.gui.addChild(statusLabel);
// Update stress bar based on current stress level
function updateStressBar() {
// Update stress bar width based on stress level
var maxWidth = 1000;
var newWidth = stressLevel / 100 * maxWidth;
// Tween the progress bar fill
tween(progressBarFill, {
width: newWidth
}, {
duration: 300,
easing: tween.easeOut
});
// Update player appearance based on stress
player.updateAppearance(stressLevel);
// Game over if stress level reaches 100
if (stressLevel >= 100 && gameRunning) {
gameRunning = false;
LK.effects.flashScreen(0xff0000, 1000);
// Create game over text
var gameOverText = new Text2("YOU'RE NOT FINE!", {
size: 100,
fill: 0xff0000,
stroke: 0xffffff,
strokeThickness: 5
});
gameOverText.anchor.set(0.5, 0.5);
gameOverText.x = 2048 / 2;
gameOverText.y = 2732 / 2 - 200;
// Add fun meme text
var memeText = new Text2("(But we've all been there...)", {
size: 50,
fill: 0xffffff
});
memeText.anchor.set(0.5, 0.5);
memeText.x = 2048 / 2;
memeText.y = 2732 / 2 - 100;
LK.gui.addChild(gameOverText);
LK.gui.addChild(memeText);
LK.setTimeout(function () {
LK.showGameOver();
}, 3000);
}
}
// Spawn a new problem
function spawnProblem() {
var problem = new Problem();
problem.x = Math.random() * (2048 - 200) + 100; // Random x position
problem.y = -100; // Start above screen
game.addChild(problem);
problems.push(problem);
}
// Check if level should be increased based on score
function checkLevelProgress() {
// Level up based on score
var newLevel = Math.floor(score / 10) + 1;
if (newLevel > gameLevel) {
gameLevel = newLevel;
levelText.setText("LEVEL: " + gameLevel);
// Make problems spawn faster as level increases
problemSpawnTime = Math.max(500, 2000 - gameLevel * 150);
// Visual and audio feedback for level up
LK.effects.flashScreen(0x00ff00, 500, 0.3);
LK.getSound('levelup').play();
// Show level up text
var levelUpText = new Text2("LEVEL UP!", {
size: 80,
fill: 0x00cc00
});
levelUpText.anchor.set(0.5, 0.5);
levelUpText.x = 2048 / 2;
levelUpText.y = 2732 / 2;
LK.gui.addChild(levelUpText);
// Animate and remove text
tween(levelUpText, {
scaleX: 1.5,
scaleY: 1.5,
alpha: 0
}, {
duration: 1000,
easing: tween.easeOut,
onFinish: function onFinish() {
levelUpText.destroy();
}
});
}
}
// Clean up problems that have been destroyed
function cleanupProblems() {
for (var i = problems.length - 1; i >= 0; i--) {
if (!problems[i].parent) {
problems.splice(i, 1);
}
}
}
// Spawn tutorial text at start
function showTutorial() {
var tutorialText = new Text2("TAP THE PROBLEMS BEFORE THEY HIT THE GROUND!", {
size: 60,
fill: 0xffffff,
align: 'center',
wordWrap: true,
wordWrapWidth: 1800,
stroke: 0x000000,
strokeThickness: 5
});
tutorialText.anchor.set(0.5, 0.5);
tutorialText.x = 1048 / 2;
tutorialText.y = 2732 / 2;
LK.gui.addChild(tutorialText);
LK.setTimeout(function () {
tween(tutorialText, {
alpha: 0
}, {
duration: 1000,
easing: tween.easeOut,
onFinish: function onFinish() {
tutorialText.destroy();
}
});
}, 3000);
}
// Show tutorial at start
showTutorial();
// Game update function
game.update = function () {
if (!gameRunning) {
return;
}
// Check if it's time to spawn a new problem
if (LK.ticks * (1000 / 60) - lastProblemTime > problemSpawnTime) {
spawnProblem();
lastProblemTime = LK.ticks * (1000 / 60);
}
// Update all problems
for (var i = 0; i < problems.length; i++) {
problems[i].update();
}
// Update the program display animation
if (programDisplay) {
programDisplay.update();
}
// Check if player should level up
checkLevelProgress();
// Clean up any destroyed problems
cleanupProblems();
// Randomly reduce stress by a small amount (chance for slight recovery)
if (Math.random() < 0.001 && stressLevel > 0) {
stressLevel = Math.max(0, stressLevel - 1);
updateStressBar();
}
};
// Add shake effect to entire game when stress is high
LK.setInterval(function () {
if (stressLevel >= 70 && gameRunning) {
var intensity = (stressLevel - 70) / 30; // 0 to 1 based on stress from 70-100
var shake = 10 * intensity;
tween(game, {
x: Math.random() * shake - shake / 2
}, {
duration: 50,
easing: tween.linear,
onFinish: function onFinish() {
tween(game, {
x: 0
}, {
duration: 50,
easing: tween.linear
});
}
});
}
}, 1000);
// Initial stress bar update
updateStressBar();
// Create program display that looks like running code
var programDisplay = new ProgramDisplay();
programDisplay.x = 200;
programDisplay.y = 400;
game.addChild(programDisplay);
// Add clock to background
var clock = new Clock();
clock.x = 1750; // Position in top right area
clock.y = 250;
clock.scale.set(0.8); // Size the clock appropriately
game.addChild(clock);
// Animate clock hands
LK.setInterval(function () {
if (clock && gameRunning) {
clock.updateClock();
}
}, 10); // Update more frequently for extra rapid movement
// Occasionally change the program display patterns
LK.setInterval(function () {
if (programDisplay && gameRunning) {
var numLines = 80 + Math.floor(Math.random() * 40); // Random number of lines between 80-120
programDisplay.createLines(numLines);
}
}, 5000); // Change pattern every 5 seconds
// Start the music
LK.playMusic('bgmusic');
// Add instructions button
var instructionsButton = new Container();
// Use LK.getAsset instead of Graphics for the button background
var instructionsButtonBg = LK.getAsset('problem', {
anchorX: 0.5,
anchorY: 0.5,
width: 60,
height: 60,
tint: 0x333333,
alpha: 0.7
});
instructionsButtonBg.x = 30;
instructionsButtonBg.y = 30;
instructionsButton.addChild(instructionsButtonBg);
var questionText = new Text2("?", {
size: 40,
fill: 0xffffff
});
questionText.anchor.set(0.5, 0.5);
questionText.x = 30;
questionText.y = 30;
instructionsButton.addChild(questionText);
instructionsButton.x = 50;
instructionsButton.y = 50;
instructionsButton.interactive = true;
LK.gui.addChild(instructionsButton);
instructionsButton.down = function () {
// Show instructions popup
var popup = new Container();
// Darken background using a shape asset instead of Graphics
var bg = LK.getAsset('background', {
anchorX: 0.5,
anchorY: 0.5,
width: 2048,
height: 2732,
tint: 0x000000,
alpha: 0.7
});
bg.x = 2048 / 2;
bg.y = 2732 / 2;
popup.addChild(bg);
// Instructions panel using a shape asset instead of Graphics
var panel = LK.getAsset('background', {
anchorX: 0.5,
anchorY: 0.5,
width: 1500,
height: 1000,
tint: 0xffffff,
alpha: 0.9
});
panel.x = 2048 / 2;
panel.y = 2732 / 2;
popup.addChild(panel);
// Title
var title = new Text2("HOW TO PLAY", {
size: 80,
fill: 0xff4d4d,
fontWeight: 'bold'
});
title.anchor.set(0.5, 0);
title.x = panel.x;
title.y = panel.y - 400;
popup.addChild(title);
// Instructions
var instructions = new Text2("1. Tap on the falling problems before they hit the ground\n\n" + "2. Each problem that hits the ground increases your stress\n\n" + "3. Don't let your stress meter reach 100%\n\n" + "4. Score points by tapping problems\n\n" + "5. Level up every 10 points\n\n" + "6. Higher levels = faster problems\n\n" + "7. Just keep telling yourself, \"I'M FINE!\"", {
size: 50,
fill: 0x000000,
align: 'center',
lineHeight: 60,
wordWrap: true,
wordWrapWidth: panel.width * 0.9 // Wrap to 90% of panel width
});
// Anchor and position at top center
instructions.anchor.set(0.5, 0);
instructions.x = panel.x + panel.width / 2; // Center horizontally
instructions.y = 20; // Near top of screen
popup.addChild(instructions);
// Close button
var closeButton = new Container();
var closeBg = LK.getAsset('background', {
anchorX: 0.5,
anchorY: 0.5,
width: 300,
height: 100,
tint: 0xff4d4d
});
closeButton.addChild(closeBg);
var closeText = new Text2("CLOSE", {
size: 50,
fill: 0xffffff
});
closeText.anchor.set(0.5, 0.5);
closeText.x = 0;
closeText.y = 0;
closeButton.addChild(closeText);
closeButton.x = panel.x;
closeButton.y = panel.y + 350;
closeButton.interactive = true;
popup.addChild(closeButton);
closeButton.down = function () {
popup.destroy();
};
LK.gui.addChild(popup);
}; ===================================================================
--- original.js
+++ change.js
@@ -14,10 +14,9 @@
anchorX: 0.5,
anchorY: 0.5,
width: 400,
height: 400,
- tint: 0xFFFFFF,
- shape: 'ellipse'
+ tint: 0xFFFFFF
//alpha: 0 // Make it transparent
});
// Make sure clock face is circular by setting borderRadius
clockFace.shape = 'ellipse';
@@ -366,8 +365,58 @@
}
};
return self;
});
+var ProgramDisplay = Container.expand(function () {
+ var self = Container.call(this);
+ // Configuration
+ self.lineHeight = 15;
+ self.gapBetweenLines = 5;
+ self.totalWidth = 1800;
+ self.colors = [0x00ff00, 0x66ff66, 0x00ccff, 0xff9900, 0xff3366, 0xcc66ff, 0xffff00];
+ self.lines = [];
+ self.speedRanges = [0.5, 1, 1.5, 2, 2.5, 3];
+ // Create lines with different colors and lengths
+ self.createLines = function (numLines) {
+ // Clear existing lines
+ for (var i = 0; i < self.lines.length; i++) {
+ if (self.lines[i].parent) {
+ self.removeChild(self.lines[i]);
+ }
+ }
+ self.lines = [];
+ // Create new lines
+ for (var i = 0; i < numLines; i++) {
+ var lineColor = self.colors[Math.floor(Math.random() * self.colors.length)];
+ var lineLength = Math.random() * self.totalWidth * 0.8 + self.totalWidth * 0.2;
+ var line = LK.getAsset('progressBar', {
+ anchorX: 0,
+ anchorY: 0.5,
+ width: lineLength,
+ height: self.lineHeight,
+ tint: lineColor
+ });
+ line.x = -lineLength; // Start off-screen to the left
+ line.y = i * (self.lineHeight + self.gapBetweenLines);
+ line.speed = self.speedRanges[Math.floor(Math.random() * self.speedRanges.length)];
+ line.totalDistance = self.totalWidth + lineLength;
+ line.currentPosition = 0;
+ self.addChild(line);
+ self.lines.push(line);
+ }
+ };
+ // Update animation
+ self.update = function () {
+ for (var i = 0; i < self.lines.length; i++) {
+ var line = self.lines[i];
+ line.currentPosition += line.speed;
+ line.x = -line.width + line.currentPosition % line.totalDistance;
+ }
+ };
+ // Initialize with default number of lines
+ self.createLines(100);
+ return self;
+});
/****
* Initialize Game
****/
@@ -599,8 +648,12 @@
// Update all problems
for (var i = 0; i < problems.length; i++) {
problems[i].update();
}
+ // Update the program display animation
+ if (programDisplay) {
+ programDisplay.update();
+ }
// Check if player should level up
checkLevelProgress();
// Clean up any destroyed problems
cleanupProblems();
@@ -632,8 +685,13 @@
}
}, 1000);
// Initial stress bar update
updateStressBar();
+// Create program display that looks like running code
+var programDisplay = new ProgramDisplay();
+programDisplay.x = 200;
+programDisplay.y = 400;
+game.addChild(programDisplay);
// Add clock to background
var clock = new Clock();
clock.x = 1750; // Position in top right area
clock.y = 250;
@@ -644,8 +702,15 @@
if (clock && gameRunning) {
clock.updateClock();
}
}, 10); // Update more frequently for extra rapid movement
+// Occasionally change the program display patterns
+LK.setInterval(function () {
+ if (programDisplay && gameRunning) {
+ var numLines = 80 + Math.floor(Math.random() * 40); // Random number of lines between 80-120
+ programDisplay.createLines(numLines);
+ }
+}, 5000); // Change pattern every 5 seconds
// Start the music
LK.playMusic('bgmusic');
// Add instructions button
var instructionsButton = new Container();
Modern office/workspace with subtle chaotic elements Include desk with scattered papers, coffee stains, overflowing inbox, sticky notes Light, neutral color palette (pale blue/gray) with professional appearance Should look slightly overwhelming but clean enough to not distract from gameplay. In-Game asset. 2d. High contrast. No shadows
Fullscreen modern App Store landscape banner, 16:9, high definition, for a game titled "FOMO Simulator: The Meeting That Could've Been An Email" and with the description "A fast-paced office simulator where you collect meetings, emails, and notifications while managing your energy levels. Strategic decisions must be made about which workplace items to prioritize as your energy depletes. Grab coffee for boosts, avoid missing important meetings, and survive the chaotic 60-second workday!". No text on banner!. In-Game asset. 2d. High contrast. No shadows
Modern App Store icon, high definition, square with rounded corners, for a game titled "FOMO Simulator: The Meeting That Could've Been An Email" and with the description "A fast-paced office simulator where you collect meetings, emails, and notifications while managing your energy levels. Strategic decisions must be made about which workplace items to prioritize as your energy depletes. Grab coffee for boosts, avoid missing important meetings, and survive the chaotic 60-second workday!". No text on icon!. In-Game asset. 2d. High contrast. No shadows