User prompt
display a string of 10 objects at the top of the screen.
User prompt
display a string of 10 characters at the top of the screen.
User prompt
display a string of 10 characters at the top of the screen.
User prompt
put symbol2 in the upper right corner of the screen, when the second red apple hits the player and player2 moves symbol1 to the left.
User prompt
display symbol1 in the upper right corner of the screen, the first time a red apple hits player and player2
User prompt
Fix Bug: 'ReferenceError: symbol1Displayed is not defined' in this line: 'if (!symbol1Displayed) {' Line Number: 102
User prompt
Fix Bug: 'ReferenceError: symbol1Displayed is not defined' in this line: 'if (!symbol1Displayed) {' Line Number: 102
User prompt
display symbol1 in the upper right corner of the screen, the first time a red apple hits player and player2
User prompt
display symbol1 in the upper right corner of the screen, the first time a red apple hits player and player2
User prompt
display symbol1, symbol2, symbol3, symbol4, symbol5, symbol6, symbol7, symbol8, symbol9, symbol10, one after another on the same line in the upper right corner of the screen.
User prompt
display symbol1, symbol2, symbol3, symbol4, symbol5, symbol6, symbol7, symbol8, symbol9, symbol10, one after another on the same line in the upper right corner of the screen.
User prompt
display symbol1, symbol2, symbol3, symbol4, symbol5, symbol6, symbol7, symbol8, symbol9, symbol10, one after another on the same line in the upper right corner of the screen.
User prompt
create create output in the upper right corner of the screen symbol1, symbol2, symbol3, symbol4, symbol5, symbol6, symbol7, symbol8, symbol9, symbol10,
User prompt
when the second red apple hits player and player2, move scoreObject to the left and add scoreObject2 in its place.
User prompt
Fix Bug: 'TypeError: game.getChildByName is not a function' in this line: 'var scoreObj = game.getChildByName('scoreObject');' Line Number: 236
User prompt
Fix Bug: 'TypeError: game.getChildByName is not a function' in this line: 'var scoreObj = game.getChildByName('scoreObject');' Line Number: 234
User prompt
scoreObject should be moved, not copied
User prompt
when the second red apple hits player and player2, move scoreObject to the left and add scoreObject2 in its place.
User prompt
when a red apple hits player and player2 for the second time, move object 1 to the left and add object 2 in its former place
User prompt
when a red apple hits player and player2 for the second time, move object 1 to the left and add object 2 in its former place
User prompt
Fix Bug: 'ReferenceError: scoreObj is not defined' in this line: 'object2.y = scoreObj.height / 2;' Line Number: 224
User prompt
place object 2 on the right side of the screen in line with object1.
User prompt
when player and player2 are hit for the second time by a red apple, add object 2 to the upper right corner of the screen
User prompt
when player and player2 are hit by a red apple, add object 1 to the upper right corner of the screen.
User prompt
after the end of health show the object "end" on the place of player and player2, hide player and player2
===================================================================
--- original.js
+++ change.js
@@ -40,8 +40,14 @@
self.destroy();
}, 500);
};
});
+// Symbol1 class
+var Symbol1 = Container.expand(function () {
+ var self = Container.call(this);
+ var symbolGraphics = self.createAsset('symbol1', 'Symbol1 display', 1, 0);
+ self.visible = false;
+});
// Player class
var Player = Container.expand(function () {
var self = Container.call(this);
var playerGraphics = self.createAsset('player', 'Player character', 0.5, 1);
@@ -92,8 +98,12 @@
explosion.x = self.x;
explosion.y = self.y;
game.addChild(explosion);
explosion.animate();
+ if (!symbol1Displayed) {
+ symbol1.visible = true;
+ symbol1Displayed = true;
+ }
return true;
}
return false;
};
@@ -229,9 +239,16 @@
apples[i].destroy();
apples.splice(i, 1);
}
}
+ // Initialize symbol1
+ var symbol1 = game.addChild(new Symbol1());
+ symbol1.x = 2048 - symbol1.width / 2;
+ symbol1.y = symbol1.height / 2;
+ // Flag to track if symbol1 has been displayed
+ var symbol1Displayed = false;
+
// Spawn apples less frequently
if (LK.ticks % 120 == 0) {
// Every two seconds
var appleType = Math.random() < 0.25 ? new Apple() : new GreenApple(); // 25% chance for red apple, 75% for green apple
@@ -240,14 +257,5 @@
newApple.y = 2732 / 2; // Start at the middle of the screen in height
apples.push(newApple);
game.addChild(newApple);
}
-
- // Display symbol1 when a red apple hits player or player2 for the first time
- if (!game.symbol1Displayed && (player.visible || player2.visible) && newApple instanceof Apple) {
- var symbol1 = LK.getAsset('symbol1', 'Symbol1 display', 1, 0);
- symbol1.x = 2048 - symbol1.width / 2;
- symbol1.y = symbol1.height / 2;
- LK.gui.topRight.addChild(symbol1);
- game.symbol1Displayed = true;
- }
});
\ No newline at end of file
grass
the fields of Britain, cartoon style. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
green apple. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
red apple. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
eureka moment, cartoon style, light, no people. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
heart. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
stars flying on an ellipse, cartoon style, side view , no people. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
white "=" on a green apple.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a white "F" on a red apple.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
the "G" sign on the red apple. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
white " (M" on a red apple. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a white sign with a small "m" on a red apple.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
white " /" on a green apple. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a white "R" on a red apple.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
green
a white " 2" on a red apple.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.