User prompt
place the grass in front of the character
User prompt
the player goes over the left edge of the screen, fix it.
User prompt
the player must not go beyond the left edge of the screen
User prompt
green apples should fall faster.
User prompt
Fix Bug: 'TypeError: window[appleType] is not a constructor' in this line: 'var newApple = new window[appleType]();' Line Number: 124
User prompt
Fix Bug: 'TypeError: window[appleType] is not a constructor' in this line: 'var newApple = new window[appleType]();' Line Number: 124
User prompt
add a green apple
User prompt
place the "foreground" object on the topmost layer at the very bottom of the frame and make it 200 high
User prompt
position the "foreground" object in front of the character at the very bottom of the frame and make it 200 high
User prompt
Fix Bug: 'Uncaught ReferenceError: filters is not defined' in this line: 'background2.filters = [new filters.BlurFilter(5)];' Line Number: 55
User prompt
make background2 a little blurry.
User prompt
Fix Bug: 'Uncaught ReferenceError: filters is not defined' in this line: 'background2.filters = [new filters.BlurFilter(5)];' Line Number: 55
User prompt
Fix Bug: 'Uncaught ReferenceError: filters is not defined' in this line: 'background2.filters = [new filters.BlurFilter(5)];' Line Number: 55
User prompt
make the image on background2 slightly blurred
User prompt
Fix Bug: 'Uncaught ReferenceError: filters is not defined' in this line: 'background2.filters = [new filters.BlurFilter(5)];' Line Number: 55
User prompt
make the image on background2 slightly blurred.
User prompt
make the player only interact with the apples with his head.
User prompt
make the player interact with the apples only with the top of his head.
User prompt
make the player only interact with the apples with his head.
User prompt
Fix Bug: 'TypeError: LK.Rectangle is not a constructor' in this line: 'var upperBody = new LK.Rectangle(player.x, player.y - player.height / 4, player.width, player.height / 2);' Line Number: 30
User prompt
make the player interact with the apples only with his upper body.
User prompt
make the player interact with the apples only with his upper body.
User prompt
make the player interact with the apples only with his upper body.
User prompt
Fix Bug: 'ReferenceError: playerGraphics is not defined' in this line: 'if (self.x < self.targetX && self.x < 2048 - playerGraphics.width / 2) {' Line Number: 16
User prompt
Fix Bug: 'Uncaught ReferenceError: playerGraphics is not defined' in this line: 'player.y = 2732 - playerGraphics.height; // Positioned at the very bottom of the frame' Line Number: 65
===================================================================
--- original.js
+++ change.js
@@ -45,12 +45,20 @@
var appleBottomY = self.y + self.height / 2;
return self.intersects(player) && appleBottomY < playerHeadY;
};
});
+// Grass class
+var Grass = Container.expand(function () {
+ var self = Container.call(this);
+ var grassGraphics = self.createAsset('grass', 'Grass in front of the player', 0.5, 1);
+ self.width = 2048;
+ self.height = grassGraphics.height;
+});
/****
* Initialize Game
****/
+// Initialize player
var game = new LK.Game({
backgroundColor: 0x000000 // Init game with black background
});
@@ -71,14 +79,18 @@
background.height = 2732;
background.x = 0;
background.y = 0;
background.anchor.set(0, 0);
-
// Initialize player
var player = game.addChild(new Player());
player.x = 2048 / 2;
player.y = 2732 - 50; // Positioned at the bottom of the screen
+// Initialize grass
+var grass = game.addChild(new Grass());
+grass.x = 2048 / 2;
+grass.y = player.y + player.height / 2 - grass.height / 2;
+
// Initialize apples array
var apples = [];
// Handle touch movement
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.