User prompt
Reduce the amount of land objects per row maybe about 7 per row
User prompt
Add many more below the ones you did
User prompt
Create more land objects under the ones you already have.
User prompt
Not so high
User prompt
Raise the land object a little higher
User prompt
Move the land object down
User prompt
You're not listening to me, I want Land to be under grass.
User prompt
Remember land must be under grass
User prompt
So that the land is below grass and that there are many more lands enough to fill the bottom part
User prompt
So there is land in the background where the ground it
User prompt
So the grass also goes over the trees and the red trees so it looks better
User prompt
So the grass immediately appears like soil
User prompt
Make sure that the grass does not appear under the excavator, but that the grass is the ground
User prompt
Add grass under the tractor and in front and behind to make it look like it is moving in the grass.
User prompt
As the Sky blue background
User prompt
Please fix the bug: 'TypeError: LK.Graphics is not a constructor' in or related to this line: 'var pathGraphics = new LK.Graphics();' Line Number: 119
User prompt
So the background is blue but where the excavator and trees are passing is green
User prompt
So you can't jump more than once until you touch the ground again.
User prompt
So when the excavator jumps it creates a transparent cloud That it is destroyed after a second
User prompt
The mistake was that you put cloud instead of nube
User prompt
Please fix the bug: 'ReferenceError: cloud is not defined' in or related to this line: 'cloud.update();' Line Number: 121
User prompt
So when the excavator jumps it creates a transparent nube that will disappear one second after being created.
User prompt
Add a counter that tells you how many trees you have destroyed
User prompt
Make it so that when you are in the air you can make a second smaller jump
User prompt
So there can't be two red trees in a row
/**** * Classes ****/ // Class for Birds var Bird = Container.expand(function () { var self = Container.call(this); var birdGraphics = self.attachAsset('bird', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.update = function () { self.x -= self.speed; }; }); //<Assets used in the game will automatically appear here> //<Write imports for supported plugins here> // Class for the Excavator var Excavator = Container.expand(function () { var self = Container.call(this); var excavatorGraphics = self.attachAsset('excavator', { anchorX: 0.5, anchorY: 0.5 }); self.jumpHeight = 500; self.isJumping = false; self.jumpSpeed = 20; self.originalY = 0; self.jumpCount = 0; // Initialize jump counter self.jump = function () { if (!self.isJumping) { // Check if the excavator is not jumping self.isJumping = true; self.originalY = self.y; self.jumpCount++; // Increment jump counter if (self.jumpCount === 2) { // If it's the second jump, reduce the jump height self.jumpHeight = 250; } } else if (self.jumpCount < 2) { // If the excavator is jumping and has jumped less than twice self.isJumping = true; self.originalY = self.y; self.jumpCount++; // Increment jump counter if (self.jumpCount === 2) { // If it's the second jump, reduce the jump height self.jumpHeight = 250; } } }; self.update = function () { if (self.isJumping) { self.y -= self.jumpSpeed; if (self.y <= self.originalY - self.jumpHeight * 3) { self.isJumping = false; self.jumpCount = 0; // Reset jump counter when the excavator lands self.jumpHeight = 500; // Reset jump height when the excavator lands } } else if (self.y < self.originalY) { self.y += self.jumpSpeed; } }; }); // Class for Trees var Tree = Container.expand(function () { var self = Container.call(this); var treeGraphics = self.attachAsset('tree', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.isRed = false; self.update = function () { self.x -= self.speed; }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ var excavator = game.addChild(new Excavator()); excavator.x = 200; excavator.y = 2000; var trees = []; var score = 0; var scoreTxt = new Text2('0', { size: 150, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); game.down = function (x, y, obj) { excavator.jump(); }; game.update = function () { excavator.update(); if (LK.ticks % 60 == 0) { var newTree = new Tree(); newTree.x = 2048; newTree.y = 2000; if (Math.random() < 0.2 && !(trees.length > 0 && trees[trees.length - 1].isRed)) { newTree.isRed = true; newTree.attachAsset('redTree', { anchorX: 0.5, anchorY: 0.5 }); } trees.push(newTree); game.addChild(newTree); // Add birds only if there are no red trees below and with a 50% probability if (!newTree.isRed && Math.random() < 0.5) { var newBird = new Bird(); newBird.x = 2048; newBird.y = 1000; trees.push(newBird); game.addChild(newBird); } } for (var i = trees.length - 1; i >= 0; i--) { var tree = trees[i]; tree.update(); if (tree.x < -100) { tree.destroy(); trees.splice(i, 1); continue; } if (excavator.intersects(tree)) { if (tree instanceof Bird) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); return; } else if (tree.isRed && !excavator.isJumping) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); return; } else if (!tree.isRed) { score++; scoreTxt.setText(score); tree.destroy(); trees.splice(i, 1); if (score >= 50) { LK.showYouWin(); } } } else if (tree.isRed) { for (var j = trees.length - 1; j >= 0; j--) { var normalTree = trees[j]; if (!normalTree.isRed && tree.intersects(normalTree)) { normalTree.destroy(); trees.splice(j, 1); } } } } };
===================================================================
--- original.js
+++ change.js
@@ -27,21 +27,35 @@
self.jumpSpeed = 20;
self.originalY = 0;
self.jumpCount = 0; // Initialize jump counter
self.jump = function () {
- if (!self.isJumping && self.jumpCount < 2) {
- // Check if the excavator is not jumping and has jumped less than twice
+ if (!self.isJumping) {
+ // Check if the excavator is not jumping
self.isJumping = true;
self.originalY = self.y;
self.jumpCount++; // Increment jump counter
+ if (self.jumpCount === 2) {
+ // If it's the second jump, reduce the jump height
+ self.jumpHeight = 250;
+ }
+ } else if (self.jumpCount < 2) {
+ // If the excavator is jumping and has jumped less than twice
+ self.isJumping = true;
+ self.originalY = self.y;
+ self.jumpCount++; // Increment jump counter
+ if (self.jumpCount === 2) {
+ // If it's the second jump, reduce the jump height
+ self.jumpHeight = 250;
+ }
}
};
self.update = function () {
if (self.isJumping) {
self.y -= self.jumpSpeed;
if (self.y <= self.originalY - self.jumpHeight * 3) {
self.isJumping = false;
self.jumpCount = 0; // Reset jump counter when the excavator lands
+ self.jumpHeight = 500; // Reset jump height when the excavator lands
}
} else if (self.y < self.originalY) {
self.y += self.jumpSpeed;
}
Excavator with 2d tender rockets. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Tree. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Red tree. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Nube. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Mud ground. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows