User prompt
Move it down more it must not hide the 'MAP' text
User prompt
Move it down more below 'MAP' text
User prompt
Set its position directly below the 'Map' text
User prompt
Add Build asset below MAP text in pages 1 2 3 4 5 6
User prompt
Add page7 to the game
User prompt
change text 'map' to 'MAP' and orange color
User prompt
Make it more close
User prompt
Set the 'map' text directly below the map asset & close to it
User prompt
Add text 'map' below the map asset size 90 brown color for the page1 2 3 4 5 6
User prompt
Add event click to map asset if i click it go to page0
User prompt
Make the same map and same position in the other pages page2 3 4 5 6
User prompt
set its position down the pause button
User prompt
set its position below pause from left side of the screen
User prompt
Add map asset to page1 below the pause button
User prompt
change the cooldowntext from '30' sec to '3:00' min for the trees in page1.
User prompt
change the cooldown for trees from 30sec to 3min
User prompt
change the size of cooldowntext of trees in page1 from 50 to 80 and change its color to brown.
User prompt
Start decreasing the cooldowntext when trees hides.
User prompt
Show the cooldowntext of trees in page1 after they hide.
User prompt
Add text for the time of the trees in page1 make it in the middle of each tree image.
User prompt
Add statue time '30sec' in the middle image of each tree to back after that time to collect from it again.
User prompt
Remove any text of wood let only the one that work with trees
User prompt
Make the Statue text can be increased by all trees in page1
User prompt
Please fix the bug: 'Uncaught ReferenceError: statueText is not defined' in or related to this line: 'statueText.setText(totalStatueScore);' Line Number: 687
User prompt
Make the statue text count the clicks on trees each click by 5
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Page0 = Container.expand(function () { var self = Container.call(this); // Get and automatically addChild to self asset with id 'woodarea' with the anchor point set to 0.5, 0.5 var background0 = self.attachAsset('background0', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1366, scaleX: 1.5, scaleY: 1.5 }); var woodarea = self.attachAsset('woodarea', { anchorX: 4.5, anchorY: 2.5, x: background0.x, // Sync initial x position with background0 y: background0.y // Sync initial y position with background0 }); self.addChild(woodarea); self.lastX = background0.x; self.lastY = background0.y; // Add drag functionality to the background1 image self.down = function (x, y, obj) { self.dragging = true; self.data = obj.data; self.initialClick = { x: x, y: y }; self.offset = { x: background0.x - x, y: background0.y - y }; }; self.up = function () { self.dragging = false; self.data = null; }; self.move = function (x, y, obj) { if (self.dragging) { // Check if we reached the Y position 1000 right now as we were not there before if (self.lastY <= 1000 && background0.y > 1000) { console.log("Background0 reached Y position 1000"); } // Check if woodarea reached the Y position 1500 right now as it was not there before if (self.lastY <= 1500 && woodarea.y > 1500) { console.log("Woodarea reached Y position 1500"); } // Check if we reached the X position 500 right now as we were not there before if (self.lastX <= 500 && background0.x > 500) { console.log("Background0 reached X position 500"); } // Check if we reached the X position 1500 right now as we were not there before if (self.lastX <= 1500 && background0.x > 1500) { console.log("Background0 reached X position 1500"); } var dx = x - self.initialClick.x; var dy = y - self.initialClick.y; background0.x = x + self.offset.x; background0.y = y + self.offset.y; woodarea.x = background0.x; // Sync woodarea's x position with background0 woodarea.y = background0.y; // Sync woodarea's y position with background0 gate1.x = background0.x; // Sync gate1's x position with background0 gate1.y = background0.y; // Sync gate1's y position with background0 gate2.x = background0.x; // Sync gate2's x position with background0 gate2.y = background0.y; // Sync gate2's y position with background0 gate3.x = background0.x; // Sync gate3's x position with background0 gate3.y = background0.y; // Sync gate3's y position with background0 gate4.x = background0.x; // Sync gate4's x position with background0 gate4.y = background0.y; // Sync gate4's y position with background0 gate5.x = background0.x; // Sync gate5's x position with background0 gate5.y = background0.y; // Sync gate5's y position with background0 gate6.x = background0.x; // Sync gate6's x position with background0 gate6.y = background0.y; // Sync gate6's y position with background0 self.initialClick = { x: x, y: y }; self.lastX = background0.x; self.lastY = background0.y; } }; // Get and automatically addChild to self asset with id 'gate1' with the anchor point set to 0.5, 0.5 var gate1 = self.attachAsset('gate1', { anchorX: 9.5, anchorY: 1.4, x: 1024, y: 1366 }); // Add click event to gate1 to navigate to Page1 gate1.down = function (x, y, obj) { // Navigate to Page1 game.removeChild(page); page = game.addChild(new Page1()); }; // Get and automatically addChild to self asset with id 'gate2' with the anchor point set to 0.5, 0.5 var gate2 = self.attachAsset('gate2', { anchorX: 5.5, anchorY: 0.8, x: 1024, y: 1366 }); // Add click event to gate2 to navigate to Page2 gate2.down = function (x, y, obj) { // Navigate to Page2 game.removeChild(page); page = game.addChild(new Page2()); }; // Get and automatically addChild to self asset with id 'gate3' with the anchor point set to 0.5, 0.5 var gate3 = self.attachAsset('gate3', { anchorX: 2.4, anchorY: -3.5, x: 1024, y: 1366 }); // Add click event to gate3 to navigate to Page3 gate3.down = function (x, y, obj) { // Navigate to Page3 game.removeChild(page); page = game.addChild(new Page3()); }; // Get and automatically addChild to self asset with id 'gate4' with the anchor point set to 0.5, 0.5 var gate4 = self.attachAsset('gate4', { anchorX: 9.8, anchorY: 9.8, x: 1024, y: 1366 }); gate4.x = background0.x; // Sync gate4's x position with background0 gate4.y = background0.y; // Sync gate4's y position with background0 // Add click event to gate4 to navigate to Page4 gate4.down = function (x, y, obj) { // Navigate to Page4 game.removeChild(page); page = game.addChild(new Page4()); }; // Get and automatically addChild to self asset with id 'gate5' with the anchor point set to 0.5, 0.5 var gate5 = self.attachAsset('gate5', { anchorX: 3, anchorY: 7, x: 1024, y: 1366 }); gate5.x = background0.x; // Sync gate5's x position with background0 gate5.y = background0.y; // Sync gate5's y position with background0 // Add click event to gate5 to navigate to Page5 gate5.down = function (x, y, obj) { // Navigate to Page5 game.removeChild(page); page = game.addChild(new Page5()); }; // Get and automatically addChild to self asset with id 'gate6' with the anchor point set to 0.5, 0.5 var gate6 = self.attachAsset('gate6', { anchorX: -6, anchorY: 7.5, x: 1024, y: 1366 }); gate6.x = background0.x; // Sync gate6's x position with background0 gate6.y = background0.y; // Sync gate6's y position with background0 // Add click event to gate6 to navigate to Page1 gate6.down = function (x, y, obj) { // Navigate to Page6 game.removeChild(page); page = game.addChild(new Page6()); }; }); // Create a Page1 class by using the LK expand method to extend Container. var Page1 = Container.expand(function () { var self = Container.call(this); var background1 = self.attachAsset('background1', { anchorX: 0, anchorY: 0, x: 0, y: 0 }); var wall1 = self.attachAsset('wall1', { anchorX: 0.5, anchorY: 1.0, x: 1024, // Center horizontally y: 2732 // Position at the bottom }); // Add map asset to Page1 below the pause button var map = self.attachAsset('Map', { anchorX: 0.5, anchorY: 0.5, x: 100, // Set position directly below the pause button y: 300 // Adjusted position to be directly below the pause button }); self.addChild(map); // Add wood asset to Page1 var tree1 = self.attachAsset('tree1', { anchorX: 0.5, anchorY: 0.5, x: 1500, // Center horizontally y: 500 // Position in the middle of the screen }); tree1.clickCount = 0; tree1.cooldownText = new Text2('3:00', { // Add cooldown text size: 80, fill: 0x8B4513 }); tree1.cooldownText.anchor.set(0.5, 0.5); tree1.cooldownText.x = tree1.x; tree1.cooldownText.y = tree1.y; tree1.cooldownText.visible = false; // Initially hidden self.addChild(tree1.cooldownText); tree1.down = function (x, y, obj) { handleTreeClick(tree1); statueText.setText(totalStatueScore); }; self.addChild(tree1); var tree2 = self.attachAsset('tree2', { anchorX: 0.5, anchorY: 0.5, x: 1200, // Position tree2 to the left of tree1 y: 500 // Align vertically with tree1 }); tree2.clickCount = 0; tree2.cooldownText = new Text2('3:00', { // Add cooldown text size: 80, fill: 0x8B4513 }); tree2.cooldownText.anchor.set(0.5, 0.5); tree2.cooldownText.x = tree2.x; tree2.cooldownText.y = tree2.y; tree2.cooldownText.visible = false; // Initially hidden self.addChild(tree2.cooldownText); tree2.down = function (x, y, obj) { handleTreeClick(tree2); statueText.setText(totalStatueScore); }; self.addChild(tree2); var tree3 = self.attachAsset('tree3', { anchorX: 0.5, anchorY: 0.5, x: 900, // Position tree3 to the left of tree2 y: 500 // Align vertically with tree2 }); tree3.clickCount = 0; tree3.cooldownText = new Text2('3:00', { // Add cooldown text size: 80, fill: 0x8B4513 }); tree3.cooldownText.anchor.set(0.5, 0.5); tree3.cooldownText.x = tree3.x; tree3.cooldownText.y = tree3.y; tree3.cooldownText.visible = false; // Initially hidden self.addChild(tree3.cooldownText); tree3.down = function (x, y, obj) { handleTreeClick(tree3); statueText.setText(totalStatueScore); }; self.addChild(tree3); var tree4 = self.attachAsset('tree4', { anchorX: 0.5, anchorY: 0.5, x: 600, // Position tree4 to the left of tree3 y: 500 // Align vertically with tree3 }); tree4.clickCount = 0; tree4.cooldownText = new Text2('3:00', { // Add cooldown text size: 80, fill: 0x8B4513 }); tree4.cooldownText.anchor.set(0.5, 0.5); tree4.cooldownText.x = tree4.x; tree4.cooldownText.y = tree4.y; tree4.cooldownText.visible = false; // Initially hidden self.addChild(tree4.cooldownText); tree4.down = function (x, y, obj) { handleTreeClick(tree4); statueText.setText(totalStatueScore); }; self.addChild(tree4); var tree5 = self.attachAsset('tree5', { anchorX: 0.5, anchorY: 0.5, x: 1500, // Align horizontally with tree1 y: 900 // Position tree5 below tree1 }); tree5.clickCount = 0; tree5.cooldownText = new Text2('3:00', { // Add cooldown text size: 80, fill: 0x8B4513 }); tree5.cooldownText.anchor.set(0.5, 0.5); tree5.cooldownText.x = tree5.x; tree5.cooldownText.y = tree5.y; tree5.cooldownText.visible = false; // Initially hidden self.addChild(tree5.cooldownText); tree5.down = function (x, y, obj) { handleTreeClick(tree5); statueText.setText(totalStatueScore); }; self.addChild(tree5); var tree6 = self.attachAsset('tree6', { anchorX: 0.5, anchorY: 0.5, x: 1200, // Align horizontally with tree2 y: 900 // Position tree6 below tree2 }); tree6.clickCount = 0; tree6.cooldownText = new Text2('3:00', { // Add cooldown text size: 80, fill: 0x8B4513 }); tree6.cooldownText.anchor.set(0.5, 0.5); tree6.cooldownText.x = tree6.x; tree6.cooldownText.y = tree6.y; tree6.cooldownText.visible = false; // Initially hidden self.addChild(tree6.cooldownText); tree6.down = function (x, y, obj) { handleTreeClick(tree6); statueText.setText(totalStatueScore); }; self.addChild(tree6); var tree7 = self.attachAsset('tree7', { anchorX: 0.5, anchorY: 0.5, x: 900, // Align horizontally with tree3 y: 900 // Position tree7 below tree3 }); tree7.clickCount = 0; tree7.cooldownText = new Text2('3:00', { // Add cooldown text size: 80, fill: 0x8B4513 }); tree7.cooldownText.anchor.set(0.5, 0.5); tree7.cooldownText.x = tree7.x; tree7.cooldownText.y = tree7.y; tree7.cooldownText.visible = false; // Initially hidden self.addChild(tree7.cooldownText); tree7.down = function (x, y, obj) { handleTreeClick(tree7); statueText.setText(totalStatueScore); }; self.addChild(tree7); var tree8 = self.attachAsset('tree8', { anchorX: 0.5, anchorY: 0.5, x: 600, // Align horizontally with tree4 y: 900 // Position tree8 below tree4 }); tree8.clickCount = 0; tree8.cooldownText = new Text2('3:00', { // Add cooldown text size: 80, fill: 0x8B4513 }); tree8.cooldownText.anchor.set(0.5, 0.5); tree8.cooldownText.x = tree8.x; tree8.cooldownText.y = tree8.y; tree8.cooldownText.visible = false; // Initially hidden self.addChild(tree8.cooldownText); tree8.down = function (x, y, obj) { handleTreeClick(tree8); statueText.setText(totalStatueScore); }; self.addChild(tree8); var tree9 = self.attachAsset('tree9', { anchorX: 0.5, anchorY: 0.5, x: 1500, // Align horizontally with tree5 y: 1300 // Position tree9 below tree5 }); tree9.clickCount = 0; tree9.cooldownText = new Text2('3:00', { // Add cooldown text size: 80, fill: 0x8B4513 }); tree9.cooldownText.anchor.set(0.5, 0.5); tree9.cooldownText.x = tree9.x; tree9.cooldownText.y = tree9.y; tree9.cooldownText.visible = false; // Initially hidden self.addChild(tree9.cooldownText); tree9.down = function (x, y, obj) { handleTreeClick(tree9); statueText.setText(totalStatueScore); }; self.addChild(tree9); var tree10 = self.attachAsset('tree10', { anchorX: 0.5, anchorY: 0.5, x: 1200, // Align horizontally with tree6 y: 1300 // Position tree10 below tree6 }); tree10.clickCount = 0; tree10.cooldownText = new Text2('3:00', { // Add cooldown text size: 80, fill: 0x8B4513 }); tree10.cooldownText.anchor.set(0.5, 0.5); tree10.cooldownText.x = tree10.x; tree10.cooldownText.y = tree10.y; tree10.cooldownText.visible = false; // Initially hidden self.addChild(tree10.cooldownText); tree10.down = function (x, y, obj) { handleTreeClick(tree10); statueText.setText(totalStatueScore); }; self.addChild(tree10); var tree11 = self.attachAsset('tree11', { anchorX: 0.5, anchorY: 0.5, x: 900, // Align horizontally with tree7 y: 1300 // Position tree11 below tree7 }); tree11.clickCount = 0; tree11.cooldownText = new Text2('3:00', { // Add cooldown text size: 80, fill: 0x8B4513 }); tree11.cooldownText.anchor.set(0.5, 0.5); tree11.cooldownText.x = tree11.x; tree11.cooldownText.y = tree11.y; tree11.cooldownText.visible = false; // Initially hidden self.addChild(tree11.cooldownText); tree11.down = function (x, y, obj) { handleTreeClick(tree11); statueText.setText(totalStatueScore); }; self.addChild(tree11); var tree12 = self.attachAsset('tree12', { anchorX: 0.5, anchorY: 0.5, x: 600, // Align horizontally with tree8 y: 1300 // Position tree12 below tree8 }); tree12.clickCount = 0; tree12.cooldownText = new Text2('3:00', { // Add cooldown text size: 80, fill: 0x8B4513 }); tree12.cooldownText.anchor.set(0.5, 0.5); tree12.cooldownText.x = tree12.x; tree12.cooldownText.y = tree12.y; tree12.cooldownText.visible = false; // Initially hidden self.addChild(tree12.cooldownText); tree12.down = function (x, y, obj) { handleTreeClick(tree12); statueText.setText(totalStatueScore); }; self.addChild(tree12); var tree13 = self.attachAsset('tree13', { anchorX: 0.5, anchorY: 0.5, x: 1500, // Align horizontally with tree9 y: 1700 // Position tree13 below tree9 }); tree13.clickCount = 0; tree13.cooldownText = new Text2('3:00', { // Add cooldown text size: 80, fill: 0x8B4513 }); tree13.cooldownText.anchor.set(0.5, 0.5); tree13.cooldownText.x = tree13.x; tree13.cooldownText.y = tree13.y; tree13.cooldownText.visible = false; // Initially hidden self.addChild(tree13.cooldownText); tree13.down = function (x, y, obj) { handleTreeClick(tree13); statueText.setText(totalStatueScore); }; self.addChild(tree13); var tree14 = self.attachAsset('tree14', { anchorX: 0.5, anchorY: 0.5, x: 1200, // Align horizontally with tree10 y: 1700 // Position tree14 below tree10 }); tree14.clickCount = 0; tree14.cooldownText = new Text2('3:00', { // Add cooldown text size: 80, fill: 0x8B4513 }); tree14.cooldownText.anchor.set(0.5, 0.5); tree14.cooldownText.x = tree14.x; tree14.cooldownText.y = tree14.y; tree14.cooldownText.visible = false; // Initially hidden self.addChild(tree14.cooldownText); tree14.down = function (x, y, obj) { handleTreeClick(tree14); statueText.setText(totalStatueScore); }; self.addChild(tree14); var tree15 = self.attachAsset('tree15', { anchorX: 0.5, anchorY: 0.5, x: 900, // Align horizontally with tree11 y: 1700 // Position tree15 below tree11 }); tree15.clickCount = 0; tree15.cooldownText = new Text2('3:00', { // Add cooldown text size: 80, fill: 0x8B4513 }); tree15.cooldownText.anchor.set(0.5, 0.5); tree15.cooldownText.x = tree15.x; tree15.cooldownText.y = tree15.y; tree15.cooldownText.visible = false; // Initially hidden self.addChild(tree15.cooldownText); tree15.down = function (x, y, obj) { handleTreeClick(tree15); statueText.setText(totalStatueScore); }; self.addChild(tree15); var tree16 = self.attachAsset('tree16', { anchorX: 0.5, anchorY: 0.5, x: 600, // Align horizontally with tree12 y: 1700 // Position tree16 below tree12 }); tree16.clickCount = 0; tree16.cooldownText = new Text2('3:00', { // Add cooldown text size: 80, fill: 0x8B4513 }); tree16.cooldownText.anchor.set(0.5, 0.5); tree16.cooldownText.x = tree16.x; tree16.cooldownText.y = tree16.y; tree16.cooldownText.visible = false; // Initially hidden self.addChild(tree16.cooldownText); tree16.down = function (x, y, obj) { handleTreeClick(tree16); statueText.setText(totalStatueScore); }; self.addChild(tree16); var wood = self.attachAsset('wood', { anchorX: 0.5, anchorY: 0.5, x: 1902, // Position wood in the middle of the screen y: 2510 // Position wood below the trees }); // Add woodScoreText to Page1 var statueText = new Text2('0', { size: 70, fill: 0x471e00 }); statueText.anchor.set(1, 0.5); statueText.x = 1800; // Position statueText on the screen statueText.y = 2510; // Align vertically with the wood asset self.addChild(statueText); // Hide the statue beside the wood // statue.visible = false; // Commented out as statue is not defined var silver = self.attachAsset('silver', { anchorX: 0.5, anchorY: 0.5, x: 1902, // Align horizontally with wood y: 2660 // Position silver directly below the wood }); // Add text for silver score beside silver asset var silverScoreText = new Text2('0', { size: 70, fill: 0xc0c0c0 }); silver.clickCount = 0; silver.down = function (x, y, obj) { silver.clickCount += 5; silverScoreText.setText(silver.clickCount); }; silverScoreText.anchor.set(1, 0.5); silverScoreText.x = silver.x - 90; // Position text to the left of the silver silverScoreText.y = silver.y; self.addChild(silverScoreText); var stone = self.attachAsset('stone', { anchorX: 0.5, anchorY: 0.5, x: 1220, // Position stone in the middle of the screen y: 2510 // Position stone below the wood }); // Add text for stone score beside stone asset var stoneScoreText = new Text2('0', { size: 70, fill: 0x00ff00 }); stone.clickCount = 0; stone.down = function (x, y, obj) { stone.clickCount += 5; stoneScoreText.setText(stone.clickCount); }; stoneScoreText.anchor.set(1, 0.5); stoneScoreText.x = stone.x - 90; // Position text to the left of the stone stoneScoreText.y = stone.y; self.addChild(stoneScoreText); var gold = self.attachAsset('gold', { anchorX: 0.5, anchorY: 0.5, x: 1220, // Align horizontally with stone y: 2660 // Position gold below the stone }); // Add text for gold score beside gold asset var goldScoreText = new Text2('0', { size: 70, fill: 0xffd700 }); gold.clickCount = 0; gold.down = function (x, y, obj) { gold.clickCount += 5; goldScoreText.setText(gold.clickCount); }; goldScoreText.anchor.set(1, 0.5); goldScoreText.x = gold.x - 90; // Position text to the left of the gold goldScoreText.y = gold.y; self.addChild(goldScoreText); var bronze = self.attachAsset('bronze', { anchorX: 0.5, anchorY: 0.5, x: 595, // Position bronze in the middle of the screen y: 2510 // Position bronze above the stone }); // Add text for bronze score beside bronze asset var bronzeScoreText = new Text2('0', { size: 70, fill: 0xcd7f32 }); bronze.clickCount = 0; bronze.down = function (x, y, obj) { bronze.clickCount += 5; bronzeScoreText.setText(bronze.clickCount); }; bronzeScoreText.anchor.set(1, 0.5); bronzeScoreText.x = bronze.x - 90; // Position text to the left of the bronze bronzeScoreText.y = bronze.y; self.addChild(bronzeScoreText); var crystal = self.attachAsset('crystal', { anchorX: 0.5, anchorY: 0.5, x: 595, // Align horizontally with bronze y: 2660 // Position crystal below the bronze }); // Add text for crystal score beside crystal asset var crystalScoreText = new Text2('0', { size: 70, fill: 0x00ffff }); crystal.clickCount = 0; crystal.down = function (x, y, obj) { crystal.clickCount += 5; crystalScoreText.setText(crystal.clickCount); }; crystalScoreText.anchor.set(1, 0.5); crystalScoreText.x = crystal.x - 90; // Position text to the left of the crystal crystalScoreText.y = crystal.y; self.addChild(crystalScoreText); }); var Page2 = Container.expand(function () { var self = Container.call(this); // Get and automatically addChild to self asset with id 'background2' with the anchor point set to 0, 0 var background2 = self.attachAsset('background2', { anchorX: 0.0, anchorY: 0.0, x: 0, y: 0 }); // Add map asset to Page2 below the pause button var map = self.attachAsset('Map', { anchorX: 0.5, anchorY: 0.5, x: 100, y: 300 }); self.addChild(map); }); var Page3 = Container.expand(function () { var self = Container.call(this); // Get and automatically addChild to self asset with id 'background3' with the anchor point set to 0, 0 var background3 = self.attachAsset('background3', { anchorX: 0.0, anchorY: 0.0, x: 0, y: 0 }); // Add map asset to Page3 below the pause button var map = self.attachAsset('Map', { anchorX: 0.5, anchorY: 0.5, x: 100, y: 300 }); self.addChild(map); }); var Page4 = Container.expand(function () { var self = Container.call(this); // Get and automatically addChild to self asset with id 'background4' with the anchor point set to 0, 0 var background4 = self.attachAsset('background4', { anchorX: 0.0, anchorY: 0.0, x: 0, y: 0 }); // Add map asset to Page4 below the pause button var map = self.attachAsset('Map', { anchorX: 0.5, anchorY: 0.5, x: 100, y: 300 }); self.addChild(map); }); // Create a Page5 class by using the LK expand method to extend Container. var Page5 = Container.expand(function () { var self = Container.call(this); // Get and automatically addChild to self asset with id 'background5' with the anchor point set to 0, 0 var background5 = self.attachAsset('background5', { anchorX: 0.0, anchorY: 0.0, x: 0, y: 0 }); // Add map asset to Page5 below the pause button var map = self.attachAsset('Map', { anchorX: 0.5, anchorY: 0.5, x: 100, y: 300 }); self.addChild(map); }); var Page6 = Container.expand(function () { var self = Container.call(this); // Get and automatically addChild to self asset with id 'background6' with the anchor point set to 0, 0 var background6 = self.attachAsset('background6', { anchorX: 0.0, anchorY: 0.0, x: 0, y: 0 }); // Add map asset to Page6 below the pause button var map = self.attachAsset('Map', { anchorX: 0.5, anchorY: 0.5, x: 100, y: 300 }); self.addChild(map); }); var Tree = Container.expand(function (assetId, x, y) { var self = Container.call(this); var tree = self.attachAsset(assetId, { anchorX: -1.1, anchorY: 3, x: x, y: y }); tree.clickCount = 0; self.addChild(tree); self.getClickCount = function () { return tree.clickCount; }; self.incrementClickCount = function () { tree.clickCount += 1; }; self.hide = function () { tree.visible = false; }; return self; }); var WoodScoreText = Container.expand(function () { var self = Container.call(this); var woodScoreText = new Text2('0', { size: 70, fill: 0x471e00 }); woodScoreText.anchor.set(1, 0.5); self.addChild(woodScoreText); self.setText = function (text) { woodScoreText.setText(text); }; self.getText = function () { return woodScoreText.text; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ var totalStatueScore = 0; // Initialize totalStatueScore to fix ReferenceError var statueText = new Text2('0', { size: 70, fill: 0x471e00 }); // Initialize statueText in the global scope var page = game.addChild(new Page0()); //{0.b} // Define tree variables to fix 'not defined' error LK.setTimeout(function () { //{0.b} }, 30000); // 30 seconds delay ; //{0.b}; ; //{0.b} function handleTreeClick(tree) { if (tree.clickCount < 3) { tree.clickCount++; if (tree.clickCount === 3) { tree.visible = false; // Use the visible property to hide the tree tree.cooldownText.visible = true; // Show cooldown text when tree is hidden var cooldown = 180; // 3 minutes in seconds var interval = LK.setInterval(function () { cooldown--; var minutes = Math.floor(cooldown / 60); var seconds = cooldown % 60; tree.cooldownText.setText(minutes + ':' + (seconds < 10 ? '0' : '') + seconds); if (cooldown <= 0) { LK.clearInterval(interval); tree.clickCount = 0; // Reset click count after 3 minutes tree.visible = true; // Make the tree visible again tree.cooldownText.visible = false; // Hide cooldown text when tree becomes visible } }, 1000); // Decrease every second } // Increase statueText by 5 for each tree click totalStatueScore += 5; statueText.setText(totalStatueScore); // Log the click count for the tree console.log("Tree clicked ".concat(tree.clickCount, " times.")); } }
===================================================================
--- original.js
+++ change.js
@@ -699,8 +699,16 @@
anchorY: 0.0,
x: 0,
y: 0
});
+ // Add map asset to Page2 below the pause button
+ var map = self.attachAsset('Map', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 100,
+ y: 300
+ });
+ self.addChild(map);
});
var Page3 = Container.expand(function () {
var self = Container.call(this);
// Get and automatically addChild to self asset with id 'background3' with the anchor point set to 0, 0
@@ -709,8 +717,16 @@
anchorY: 0.0,
x: 0,
y: 0
});
+ // Add map asset to Page3 below the pause button
+ var map = self.attachAsset('Map', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 100,
+ y: 300
+ });
+ self.addChild(map);
});
var Page4 = Container.expand(function () {
var self = Container.call(this);
// Get and automatically addChild to self asset with id 'background4' with the anchor point set to 0, 0
@@ -719,8 +735,16 @@
anchorY: 0.0,
x: 0,
y: 0
});
+ // Add map asset to Page4 below the pause button
+ var map = self.attachAsset('Map', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 100,
+ y: 300
+ });
+ self.addChild(map);
});
// Create a Page5 class by using the LK expand method to extend Container.
var Page5 = Container.expand(function () {
var self = Container.call(this);
@@ -730,8 +754,16 @@
anchorY: 0.0,
x: 0,
y: 0
});
+ // Add map asset to Page5 below the pause button
+ var map = self.attachAsset('Map', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 100,
+ y: 300
+ });
+ self.addChild(map);
});
var Page6 = Container.expand(function () {
var self = Container.call(this);
// Get and automatically addChild to self asset with id 'background6' with the anchor point set to 0, 0
@@ -740,8 +772,16 @@
anchorY: 0.0,
x: 0,
y: 0
});
+ // Add map asset to Page6 below the pause button
+ var map = self.attachAsset('Map', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 100,
+ y: 300
+ });
+ self.addChild(map);
});
var Tree = Container.expand(function (assetId, x, y) {
var self = Container.call(this);
var tree = self.attachAsset(assetId, {
2D wreckage of wood, square, HD colors. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
House from the front facing the screen with big sign above it have description "SHOP", Hd colors
coin with colors, have "DA", hd colors. have black circles and black line for the "DA", between the 2 circles do small black lines all around. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Modern App Store icon, square with rounded corners, HD colors for a 2d game titled "The Collector" and with the description "about building houses and trees and decorations on a map to make it look like city, which then generate "DA" coins after a countdown timer expires. Players can collect these coins to increase their score, which they can then use to purchase more houses and trees and decorations from the shop button on the middle left side of the screen". with text on the middle top of the banner "the collector"!