User prompt
If they win level 5, hide the Start and Stop button
Code edit (1 edits merged)
Please save this source code
User prompt
Add to all levels: If they fail they revert to level 1
User prompt
If the player win level 4 they advance to level 5 where: 1. Title text changes to "The 60-min Game" 2. The goal is now to hit 3600 seconds to beat level 5.
User prompt
If the player win level 3 they advance to level 4 where: 1. Title text changes to "The 5-min Game" 2. The goal is now to hit 300 seconds to beat level 3.
User prompt
If the player win level 2 they advance to level 3 where: 1. Title text changes to "The 60-Second Game" 2. The goal is now to hit 60 seconds to beat level 3.
User prompt
If the player win they advance to level 2 where: 1. Title text changes to "The 20-Second Game" 2. The goal is now to hit 20 seconds to beat level 2.
User prompt
Make a level 2 if the player beats level 1 with the following changes: 1. Title text changes to "The 20-Second Game" 2. The goal is now to hit 20 seconds to beat level 2.
Code edit (1 edits merged)
Please save this source code
User prompt
move the title text 200px down
User prompt
make the title font size smaller
User prompt
Add a text label at the top of the screen with the game title "The 10-Second Game" spanning the screen width
User prompt
Make it fit the screen
User prompt
Change the game title text to The 10 Second Game
Code edit (2 edits merged)
Please save this source code
User prompt
Make a text label at the top of the game with the Title of the game
User prompt
I think it would be better to calcultate the placement of StartButton and StopButton, to be the same as timerTxt, but move the Buttons down 300px
Code edit (1 edits merged)
Please save this source code
User prompt
What if I would like the placement to be in the center of the the screen width, and buttom+200px
User prompt
Move Start/StopButton to Center.Y +300px, but keep X centered
User prompt
Move Start/StopButton to Center.Y - 200px
User prompt
Move the Start/StopButton to 2/3 of the screen height
User prompt
The Start/Stop Button is to far down
Initial prompt
10 Seconds
===================================================================
--- original.js
+++ change.js
@@ -9,8 +9,26 @@
/****
* Game Code
****/
+function advanceToLevel1() {
+ // Change title text
+ gameTitle.setText('The 10-Second Game');
+ // Reset timer
+ elapsedTime = 0;
+ timerTxt.setText('0.0');
+ // Update checkTime function for level 1
+ checkTime = function checkTime() {
+ var finalTime = elapsedTime / 1000;
+ if (Math.abs(finalTime - 10) < 0.1) {
+ LK.effects.flashScreen(0x00ff00, 1000); // Flash green for success
+ advanceToLevel2();
+ } else {
+ LK.effects.flashScreen(0xff0000, 1000); // Flash red for failure
+ advanceToLevel1();
+ }
+ };
+}
function advanceToLevel5() {
// Change title text
gameTitle.setText('The 60-min Game');
// Reset timer
@@ -137,8 +155,13 @@
LK.effects.flashScreen(0x00ff00, 1000); // Flash green for success
advanceToLevel2();
} else {
LK.effects.flashScreen(0xff0000, 1000); // Flash red for failure
+ advanceToLevel1();
+ advanceToLevel1();
+ advanceToLevel1();
+ advanceToLevel1();
+ advanceToLevel1();
}
}
// Event listener for the start button
startButton.down = function (x, y, obj) {