User prompt
Let's say the price of Fish2 is 75 and the price of blonde is 65, but there is a 35% chance that the sales price will be 85.
User prompt
Add "fish2" to fish shop
User prompt
remove chocolate sprinkles from game
User prompt
A carrot turns into a "Chococarrot" with %100 possibility asset when you click on the Chocolate Sprinkler
User prompt
A carrot turns into a "Chococarrot" asset when you click on the Chocolate sprinkler
User prompt
A carrot turns into a "Chococarrot" asset when you click on the chocolatte sprinkler
User prompt
A carrot turns into a "Chococarrot" when you click on the chocosprinkler
User prompt
If we click on the chocolate sprinkler, the random carrot will turn into "Chococarrot" asset but we have to wait 1 minute for each click ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
If we click on the chocolate sprinkler, there is a 13% chance that the carrot in a 3x3 area will turn into "Chococarrot" asset
User prompt
If we click on the chocolate sprinkler, there is a 13% chance that the carrot in a 3x3 area will turn into "Chococarrot"
User prompt
If you place a carrot on the soil on the right, left, above and below the chocolate sprinkler, there is a 15% chance that the carrot will turn into "Chococarrot" asset
User prompt
If you place a carrot on the soil on the right, left, above and below the chocolate sprinkler, there is a 15% chance that the carrot will turn into "Chococarrot"
User prompt
When an apple is planted and harvested, it grows back
User prompt
If you plant carrots in the 3x3 area of the choco sprinkler, there is a 12% chance that the carrot will become Chococarrot.
User prompt
If we put carrots in the 3x3 area of the Chocolatte sprinkler, there is a 10% chance that the carrots will be Chococarrot and its price will increase 4 times.
User prompt
Play the "water" sound when you put a fish into water
User prompt
Rename Advanced sprinkler to "chocolate sprinkler" reset its attribute and instead makes the fruits in the 3x3 area choco with 10% rate and the fruits with choco are worth 4 times more money ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Let the price of orange be $175 and the selling price be $125
User prompt
enlarge the icon of orange and apple in the seed shop
User prompt
undo
User prompt
Replace the apple with the dragon fruit in the seed shop
User prompt
Move the close button down in the seed shop and enlarge it.
User prompt
move the seeds in the seed switch to the left
User prompt
remove lighting from game
User prompt
Add "Lightning" to the gear shop and it will be 175$. If we buy it and put it somewhere, it will be struck by lightning every 1 minute and 55 seconds. Add new fruits to the game. If lightning strikes them, they will be shocked. So, it will be 6 times more expensive. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var AdvancedSprinkler = Container.expand(function (x, y) { var self = Container.call(this); self.x = x; self.y = y; self.type = 'chocolate'; var sprinklerGraphics = self.attachAsset('sprinkler', { anchorX: 0.5, anchorY: 0.5, tint: 0x8B4513 }); // Add chocolate-themed pulsing animation function animateChocolateSprinkler() { tween(sprinklerGraphics, { scaleX: 1.3, scaleY: 1.3, alpha: 0.7, tint: 0xD2691E }, { duration: 600, easing: tween.easeInOut, onFinish: function onFinish() { tween(sprinklerGraphics, { scaleX: 1.0, scaleY: 1.0, alpha: 1.0, tint: 0x8B4513 }, { duration: 600, easing: tween.easeInOut, onFinish: animateChocolateSprinkler }); } }); } animateChocolateSprinkler(); return self; }); var AquaticPlantSpot = Container.expand(function (x, y) { var self = Container.call(this); self.x = x; self.y = y; self.planted = false; self.plantType = null; self.plantTime = 0; self.grown = false; self.regrowTime = 0; self.isAquatic = true; var waterGraphics = self.attachAsset('water', { anchorX: 0.5, anchorY: 0.5, tint: 0x4169E1 }); // Move water graphics to the back layer self.setChildIndex(waterGraphics, 0); var plantGraphics = null; self.plantSeed = function (seedType) { if (self.planted) return false; self.planted = true; self.plantType = 'fish'; // Always spawn fish in aquatic spots self.plantTime = LK.ticks; self.grown = false; self.isColorful = false; // 5% chance for colorful fish (3x price) if (Math.random() < 0.05) { self.isColorful = true; } var finalScale = 1.0; var assetName = self.isColorful ? 'colorful_fish' : 'fish'; plantGraphics = self.attachAsset(assetName, { anchorX: 0.5, anchorY: 0.5, alpha: 0.5, scaleX: 0.3, scaleY: 0.3 }); // Add colorful tint for special fish if (self.isColorful) { plantGraphics.tint = 0xFFD700; // Golden fish } // Ensure fish graphics appear above water self.setChildIndex(plantGraphics, self.children.length - 1); // Animate fish growth over 3 seconds (faster than plants) tween(plantGraphics, { scaleX: finalScale, scaleY: finalScale }, { duration: 3000, easing: tween.easeOut }); // Add swimming animation for colorful fish if (self.isColorful) { var swimmingAnimation = function swimmingAnimation() { if (plantGraphics) { tween(plantGraphics, { x: 20 }, { duration: 1000, easing: tween.easeInOut, onFinish: function onFinish() { tween(plantGraphics, { x: -20 }, { duration: 1000, easing: tween.easeInOut, onFinish: function onFinish() { tween(plantGraphics, { x: 0 }, { duration: 1000, easing: tween.easeInOut, onFinish: swimmingAnimation }); } }); } }); } }; // Start swimming animation after growth completes LK.setTimeout(swimmingAnimation, 3000); } LK.getSound('plant').play(); LK.getSound('Water').play(); return true; }; self.harvest = function () { if (!self.grown) return null; var harvestedType = 'fish'; var isColorfulHarvest = self.isColorful; // Fish regrow like bananas if (plantGraphics) { tween(plantGraphics, { alpha: 0.3, scaleX: 0.5, scaleY: 0.5 }, { duration: 500, easing: tween.easeIn }); } self.grown = false; self.regrowTime = LK.ticks; LK.getSound('harvest').play(); return { type: harvestedType, colorful: isColorfulHarvest, chocolate: self.isChocolate || false }; }; self.update = function () { if (self.planted && !self.grown) { // Check if this spot is affected by a sprinkler var speedMultiplier = 1; for (var i = 0; i < sprinklers.length; i++) { var sprinkler = sprinklers[i]; var distanceX = Math.abs(self.x - sprinkler.x); var distanceY = Math.abs(self.y - sprinkler.y); if (sprinkler.type === 'chocolate') { // Chocolate sprinkler: 10% chance to make fish choco in 3x3 area if (distanceX <= 660 && distanceY <= 660) { // Check if fish should become chocolate (10% chance per update cycle for grown fish) if (self.grown && !self.isChocolate && Math.random() < 0.001) { // Very low per-frame chance self.isChocolate = true; if (plantGraphics) { tween(plantGraphics, { tint: 0x8B4513 }, { duration: 1000, easing: tween.easeInOut }); } } break; } } else { // Regular sprinkler: 2x speed in 3x3 area if (distanceX <= 660 && distanceY <= 660) { speedMultiplier = 2; break; } } } // Check if it's time to regrow after harvest if (self.regrowTime > 0) { if (LK.ticks - self.regrowTime > 3300 / speedMultiplier) { // 55 seconds at 60fps for fish regrow self.grown = true; self.regrowTime = 0; if (plantGraphics) { var regrowScale = 1.0; tween(plantGraphics, { alpha: 1.0, scaleX: regrowScale, scaleY: regrowScale }, { duration: 1000, easing: tween.easeOut }); } } } else if (self.regrowTime === 0 && LK.ticks - self.plantTime > 3300 / speedMultiplier) { // 55 seconds at 60fps for initial growth self.grown = true; if (plantGraphics) { plantGraphics.alpha = 1.0; } } } }; self.down = function () { if (self.grown) { var harvested = self.harvest(); if (harvested) { var harvestType = harvested.type; if (harvested.chocolate) { inventory['choco_fish'] = (inventory['choco_fish'] || 0) + 1; } else if (harvested.colorful) { inventory['colorful_fish'] = (inventory['colorful_fish'] || 0) + 1; } else { inventory[harvestType] = (inventory[harvestType] || 0) + 1; } updateInventoryDisplay(); } } else if (!self.planted && selectedSprinkler) { // Place sprinkler var sprinklerCost = selectedSprinkler === 'advanced' ? 150 : 35; if (money >= sprinklerCost) { var sprinkler; if (selectedSprinkler === 'advanced') { sprinkler = new AdvancedSprinkler(self.x, self.y); } else { sprinkler = new Sprinkler(self.x, self.y); } sprinklers.push(sprinkler); game.addChild(sprinkler); money -= sprinklerCost; updateMoneyDisplay(); selectedSprinkler = false; gearShop.visible = false; } } else if (!self.planted && selectedFish && money >= 100) { // Plant fish in aquatic spots if (self.plantSeed('fish')) { money -= 100; updateMoneyDisplay(); selectedFish = false; fishShop.visible = false; } } else if (!self.planted && selectedSeed && money >= seedPrices[selectedSeed]) { // Don't plant fruit seeds in water - this is an aquatic spot for fish only // No planting action will occur, but we can provide feedback selectedSeed = null; seedShop.visible = false; } }; return self; }); var Button = Container.expand(function (text, onClick) { var self = Container.call(this); var buttonBg = self.attachAsset('button', { anchorX: 0.5, anchorY: 0.5 }); var buttonText = new Text2(text, { size: 30, fill: 0xFFFFFF }); buttonText.anchor.set(0.5, 0.5); self.addChild(buttonText); self.down = function () { if (onClick) onClick(); }; return self; }); var FishShop = Container.expand(function () { var self = Container.call(this); var background = self.attachAsset('seedShopBg', { anchorX: 0.5, anchorY: 0.5 }); var titleText = new Text2('FISH SHOP', { size: 80, fill: 0x000000 }); titleText.anchor.set(0.5, 0.5); titleText.y = -600; self.addChild(titleText); // Fish item var fishButton = new Container(); fishButton.x = 0; fishButton.y = -200; var fishIcon = fishButton.attachAsset('fish', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.5, scaleY: 1.5 }); fishIcon.x = -300; var nameText = new Text2('Fish', { size: 70, fill: 0x000000 }); nameText.anchor.set(0, 0.5); nameText.x = -200; fishButton.addChild(nameText); var priceText = new Text2('$100', { size: 70, fill: 0xFFFF00 }); priceText.anchor.set(1, 0.5); priceText.x = 300; fishButton.addChild(priceText); var descText = new Text2('Grows in 55 seconds, sells for $120', { size: 40, fill: 0x666666 }); descText.anchor.set(0.5, 0); descText.y = 50; fishButton.addChild(descText); fishButton.down = function () { if (money >= 100) { selectedFish = true; self.visible = false; LK.getSound('Buy').play(); } }; self.addChild(fishButton); var closeButton = new Button('CLOSE', function () { self.visible = false; }); closeButton.y = 500; self.addChild(closeButton); return self; }); var GearShop = Container.expand(function () { var self = Container.call(this); var background = self.attachAsset('seedShopBg', { anchorX: 0.5, anchorY: 0.5 }); var titleText = new Text2('GEAR SHOP', { size: 80, fill: 0x000000 }); titleText.anchor.set(0.5, 0.5); titleText.y = -600; self.addChild(titleText); // Sprinkler item var sprinklerButton = new Container(); sprinklerButton.x = 0; sprinklerButton.y = -200; var sprinklerIcon = LK.getAsset('sprinkler', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.5, scaleY: 1.5 }); sprinklerIcon.x = -300; sprinklerButton.addChild(sprinklerIcon); var nameText = new Text2('Sprinkler', { size: 70, fill: 0x000000 }); nameText.anchor.set(0, 0.5); nameText.x = -200; sprinklerButton.addChild(nameText); var priceText = new Text2('$35', { size: 70, fill: 0xFFFF00 }); priceText.anchor.set(1, 0.5); priceText.x = 300; sprinklerButton.addChild(priceText); var descText = new Text2('2x growth speed in 3x3 area', { size: 40, fill: 0x666666 }); descText.anchor.set(0.5, 0); descText.y = 50; sprinklerButton.addChild(descText); sprinklerButton.down = function () { if (money >= 35) { selectedSprinkler = 'regular'; self.visible = false; LK.getSound('Buy').play(); } }; self.addChild(sprinklerButton); // Advanced Sprinkler item var advancedSprinklerButton = new Container(); advancedSprinklerButton.x = 0; advancedSprinklerButton.y = 50; var advancedSprinklerIcon = LK.getAsset('sprinkler', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.5, scaleY: 1.5, tint: 0x00ff00 }); advancedSprinklerIcon.x = -300; advancedSprinklerButton.addChild(advancedSprinklerIcon); var advancedNameText = new Text2('Chocolate Sprinkler', { size: 70, fill: 0x000000 }); advancedNameText.anchor.set(0, 0.5); advancedNameText.x = -200; advancedSprinklerButton.addChild(advancedNameText); var advancedPriceText = new Text2('$150', { size: 70, fill: 0xFFFF00 }); advancedPriceText.anchor.set(1, 0.5); advancedPriceText.x = 300; advancedSprinklerButton.addChild(advancedPriceText); var advancedDescText = new Text2('Makes fruits choco in 3x3 area (10% chance)', { size: 40, fill: 0x666666 }); advancedDescText.anchor.set(0.5, 0); advancedDescText.y = 50; advancedSprinklerButton.addChild(advancedDescText); advancedSprinklerButton.down = function () { if (money >= 150) { selectedSprinkler = 'advanced'; self.visible = false; LK.getSound('Buy').play(); } }; self.addChild(advancedSprinklerButton); var closeButton = new Button('CLOSE', function () { self.visible = false; }); closeButton.y = 400; self.addChild(closeButton); return self; }); var PlantSpot = Container.expand(function (x, y) { var self = Container.call(this); self.x = x; self.y = y; self.planted = false; self.plantType = null; self.plantTime = 0; self.grown = false; self.regrowTime = 0; var dirtGraphics = self.attachAsset('dirt', { anchorX: 0.5, anchorY: 0.5 }); // Move dirt graphics to the back layer self.setChildIndex(dirtGraphics, 0); var plantGraphics = null; self.plantSeed = function (seedType) { if (self.planted) return false; self.planted = true; self.plantType = seedType; self.plantTime = LK.ticks; self.grown = false; self.isColorful = false; // 5% chance for colorful fruit (3x price) if (Math.random() < 0.05) { self.isColorful = true; self.plantType = 'colorful_' + seedType; } var finalScale = 1.0; plantGraphics = self.attachAsset(self.plantType, { anchorX: 0.5, anchorY: 0.5, alpha: 0.5, scaleX: 0.3, scaleY: 0.3 }); // Ensure plant graphics appear above soil, especially for giant fruits self.setChildIndex(plantGraphics, self.children.length - 1); // Animate plant growth over 5 seconds tween(plantGraphics, { scaleX: finalScale, scaleY: finalScale }, { duration: 5000, easing: tween.easeOut }); // Add rainbow tint animation for colorful fruits if (self.isColorful) { var colorfulAnimation = function colorfulAnimation() { var colors = [0xff0000, 0x00ff00, 0x0000ff, 0xffff00, 0xff00ff, 0x00ffff]; var currentColor = 0; var _animateColor = function animateColor() { if (plantGraphics) { tween(plantGraphics, { tint: colors[currentColor] }, { duration: 800, easing: tween.easeInOut, onFinish: function onFinish() { currentColor = (currentColor + 1) % colors.length; _animateColor(); } }); } }; _animateColor(); }; // Start colorful animation after growth completes LK.setTimeout(colorfulAnimation, 5000); } LK.getSound('plant').play(); return true; }; self.harvest = function () { if (!self.grown) return null; var harvestedType = self.plantType; var isColorfulHarvest = self.isColorful; // Check if this is a regrowing fruit (banana, dragon fruit, or coconut) var isBanana = harvestedType === 'banana' || harvestedType === 'colorful_banana'; var isDragonFruit = harvestedType === 'dragonfruit' || harvestedType === 'colorful_dragonfruit'; var isCoconut = harvestedType === 'coconut' || harvestedType === 'colorful_coconut'; if (isBanana || isDragonFruit || isCoconut) { // Hide the plant graphics with animation for regrowing fruits if (plantGraphics) { tween(plantGraphics, { alpha: 0.3, scaleX: 0.5, scaleY: 0.5 }, { duration: 500, easing: tween.easeIn }); } self.grown = false; self.regrowTime = LK.ticks; } else { // For carrots and strawberries, reset the plant completely if (plantGraphics) { plantGraphics.destroy(); plantGraphics = null; } self.planted = false; self.plantType = null; self.plantTime = 0; self.grown = false; self.isColorful = false; self.regrowTime = 0; } LK.getSound('harvest').play(); return { type: harvestedType, colorful: isColorfulHarvest, chocolate: self.isChocolate || false }; }; self.update = function () { if (self.planted && !self.grown) { // Check if this spot is affected by a sprinkler var speedMultiplier = 1; for (var i = 0; i < sprinklers.length; i++) { var sprinkler = sprinklers[i]; var distanceX = Math.abs(self.x - sprinkler.x); var distanceY = Math.abs(self.y - sprinkler.y); if (sprinkler.type === 'chocolate') { // Chocolate sprinkler: 10% chance to make fruits choco in 3x3 area if (distanceX <= 660 && distanceY <= 660) { // Check if fruit should become chocolate (10% chance per update cycle for grown fruits) if (self.grown && !self.isChocolate && Math.random() < 0.001) { // Very low per-frame chance self.isChocolate = true; if (plantGraphics) { tween(plantGraphics, { tint: 0x8B4513 }, { duration: 1000, easing: tween.easeInOut }); } } break; } } else { // Regular sprinkler: 2x speed in 3x3 area (660px = 3 * 220px spacing) if (distanceX <= 660 && distanceY <= 660) { speedMultiplier = 2; break; } } } // Check if it's time to regrow after harvest (for bananas, dragon fruit, and coconut) if (self.regrowTime > 0) { var isBanana = self.plantType === 'banana' || self.plantType === 'colorful_banana'; var isDragonFruit = self.plantType === 'dragonfruit' || self.plantType === 'colorful_dragonfruit'; var isCoconut = self.plantType === 'coconut' || self.plantType === 'colorful_coconut'; var regrowReady = false; if (isBanana && LK.ticks - self.regrowTime > 1140 / speedMultiplier) { // 19 seconds at 60fps for banana regrow (halved with sprinkler) regrowReady = true; } else if ((isDragonFruit || isCoconut) && LK.ticks - self.regrowTime > 1320 / speedMultiplier) { // 22 seconds at 60fps for dragon fruit and coconut regrow (halved with sprinkler) regrowReady = true; } if (regrowReady) { self.grown = true; self.regrowTime = 0; if (plantGraphics) { var regrowScale = 1.0; tween(plantGraphics, { alpha: 1.0, scaleX: regrowScale, scaleY: regrowScale }, { duration: 1000, easing: tween.easeOut }); } } } else if (self.regrowTime === 0 && LK.ticks - self.plantTime > 300 / speedMultiplier) { // 5 seconds at 60fps for initial growth (halved with sprinkler) self.grown = true; if (plantGraphics) { plantGraphics.alpha = 1.0; } } } }; self.down = function () { if (self.grown) { var harvested = self.harvest(); if (harvested) { var harvestType = harvested.type; if (harvested.chocolate) { // Store chocolate fruits separately for 4x price var baseType = harvestType.replace('colorful_', ''); inventory['choco_' + baseType] = (inventory['choco_' + baseType] || 0) + 1; } else if (harvested.colorful) { // Store colorful fruits separately for 3x price var baseType = harvestType.replace('colorful_', ''); inventory['colorful_' + baseType] = (inventory['colorful_' + baseType] || 0) + 1; } else { inventory[harvestType] = (inventory[harvestType] || 0) + 1; } updateInventoryDisplay(); } } else if (!self.planted && selectedSprinkler) { // Place sprinkler var sprinklerCost = selectedSprinkler === 'advanced' ? 150 : 35; if (money >= sprinklerCost) { var sprinkler; if (selectedSprinkler === 'advanced') { sprinkler = new AdvancedSprinkler(self.x, self.y); } else { sprinkler = new Sprinkler(self.x, self.y); } sprinklers.push(sprinkler); game.addChild(sprinkler); money -= sprinklerCost; updateMoneyDisplay(); selectedSprinkler = false; gearShop.visible = false; } } else if (!self.planted && selectedSeed && money >= seedPrices[selectedSeed]) { if (self.plantSeed(selectedSeed)) { money -= seedPrices[selectedSeed]; updateMoneyDisplay(); selectedSeed = null; seedShop.visible = false; } } }; return self; }); var SeedShop = Container.expand(function () { var self = Container.call(this); var background = self.attachAsset('seedShopBg', { anchorX: 0.5, anchorY: 0.5 }); var titleText = new Text2('SEED SHOP', { size: 80, fill: 0x000000 }); titleText.anchor.set(0.5, 0.5); titleText.y = -600; self.addChild(titleText); var seedTypes = ['carrot', 'strawberry', 'banana', 'coconut', 'dragonfruit', 'apple', 'orange']; var seedNames = ['Carrot', 'Strawberry', 'Banana', 'Coconut', 'Dragon Fruit', 'Apple', 'Orange']; // Use uniform medium size for all seeds in shop var uniformScale = 0.5; // Medium size for all seeds for (var i = 0; i < seedTypes.length; i++) { var seedButton = new Container(); seedButton.x = 0; seedButton.y = -400 + i * 150; // Use larger scale for orange and apple icons var iconScale = uniformScale; if (seedTypes[i] === 'orange' || seedTypes[i] === 'apple') { iconScale = 0.8; // Larger size for orange and apple } var seedIcon = LK.getAsset(seedTypes[i], { anchorX: 0.5, anchorY: 0.5, scaleX: iconScale, scaleY: iconScale }); seedIcon.x = -400; seedButton.addChild(seedIcon); var nameText = new Text2(seedNames[i], { size: 70, fill: 0x000000 }); nameText.anchor.set(0, 0.5); nameText.x = -250; seedButton.addChild(nameText); var priceText = new Text2('$' + seedPrices[seedTypes[i]], { size: 70, fill: 0xFFFF00 }); priceText.anchor.set(1, 0.5); priceText.x = 300; seedButton.addChild(priceText); seedButton.seedType = seedTypes[i]; seedButton.down = function () { if (money >= seedPrices[this.seedType]) { selectedSeed = this.seedType; self.visible = false; LK.getSound('Buy').play(); } }; self.addChild(seedButton); } var closeButton = new Button('CLOSE', function () { self.visible = false; }); closeButton.y = 650; closeButton.scaleX = 1.5; closeButton.scaleY = 1.5; self.addChild(closeButton); return self; }); var Sprinkler = Container.expand(function (x, y) { var self = Container.call(this); self.x = x; self.y = y; self.type = 'regular'; var sprinklerGraphics = self.attachAsset('sprinkler', { anchorX: 0.5, anchorY: 0.5 }); // Add pulsing animation to show it's active function animateSprinkler() { tween(sprinklerGraphics, { scaleX: 1.2, scaleY: 1.2, alpha: 0.7 }, { duration: 1000, easing: tween.easeInOut, onFinish: function onFinish() { tween(sprinklerGraphics, { scaleX: 1.0, scaleY: 1.0, alpha: 1.0 }, { duration: 1000, easing: tween.easeInOut, onFinish: animateSprinkler }); } }); } animateSprinkler(); return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x228B22 }); /**** * Game Code ****/ // Add grass background var grassBackground = game.attachAsset('grass_bg', { anchorX: 0, anchorY: 0, x: 0, y: 0 }); var money = 0; var inventory = {}; var selectedSeed = null; var selectedSprinkler = false; var selectedFish = false; var sprinklers = []; var seedPrices = { carrot: 10, strawberry: 50, banana: 80, coconut: 160, dragonfruit: 250, apple: 30, orange: 175 }; var sellPrices = { carrot: 15, strawberry: 40, banana: 60, coconut: 135, dragonfruit: 200, fish: 110, apple: 35, orange: 125, colorful_carrot: 45, colorful_strawberry: 120, colorful_banana: 180, colorful_coconut: 405, colorful_dragonfruit: 600, colorful_fish: 330, colorful_apple: 105, colorful_orange: 375, choco_carrot: 60, choco_strawberry: 160, choco_banana: 240, choco_coconut: 540, choco_dragonfruit: 800, choco_fish: 440, choco_apple: 140, choco_orange: 500 }; // Create plant spots in a grid - start with 64 lands arranged in a grid (32 top + 32 bottom) var plantSpots = []; var spacing = 220; var landsPerRow = 8; var totalRows = 8; // 4 rows for top + 4 rows for bottom var totalWidth = (landsPerRow - 1) * spacing; var startX = (2048 - totalWidth) / 2; // Center horizontally on screen var startY = 600; // Move starting Y up to accommodate bottom section // Create 32 initial plant spots in 8 columns, 4 rows (top section) for (var i = 0; i < 32; i++) { var col = i % 8; var row = Math.floor(i / 8); var spot = new PlantSpot(startX + col * spacing, startY + row * spacing); plantSpots.push(spot); game.addChild(spot); } // Create another 32 plant spots at the bottom (8 columns, 4 rows) var bottomStartY = startY + 4 * spacing + 100; // Add gap between top and bottom sections for (var i = 0; i < 32; i++) { var col = i % 8; var row = Math.floor(i / 8); var spot; // Make the bottom 16 spots (last 2 rows) aquatic if (i >= 16) { spot = new AquaticPlantSpot(startX + col * spacing, bottomStartY + row * spacing); } else { spot = new PlantSpot(startX + col * spacing, bottomStartY + row * spacing); } plantSpots.push(spot); game.addChild(spot); } // Plant initial carrots plantSpots[0].plantSeed('carrot'); plantSpots[1].plantSeed('carrot'); // UI Elements var moneyText = new Text2('Money: $0', { size: 50, fill: 0x000000 }); moneyText.anchor.set(0, 0); moneyText.x = 150; moneyText.y = 50; LK.gui.topLeft.addChild(moneyText); var inventoryText = new Text2('Inventory: Empty', { size: 50, fill: 0x000000 }); inventoryText.anchor.set(0, 1); inventoryText.x = 100; inventoryText.y = -100; LK.gui.bottomLeft.addChild(inventoryText); // Make inventory alive with pulsing animation function animateInventory() { tween(inventoryText, { scaleX: 1.1, scaleY: 1.1 }, { duration: 1000, easing: tween.easeInOut, onFinish: function onFinish() { tween(inventoryText, { scaleX: 1.0, scaleY: 1.0 }, { duration: 1000, easing: tween.easeInOut, onFinish: animateInventory }); } }); } animateInventory(); var sellButton = new Button('SELL ALL', function () { var totalSale = 0; // Check if we get the 10% price boost (30% chance) var priceBoost = Math.random() < 0.3 ? 1.1 : 1.0; for (var itemType in inventory) { if (inventory[itemType] > 0) { var basePrice; basePrice = sellPrices[itemType]; // 25% chance for strawberries to sell for 50 instead of 40 if (itemType === 'strawberry' && Math.random() < 0.25) { basePrice = 50; } // 25% chance for colorful strawberries to sell for 150 instead of 120 (proportional increase) if (itemType === 'colorful_strawberry' && Math.random() < 0.25) { basePrice = 150; } basePrice *= priceBoost; totalSale += inventory[itemType] * basePrice; inventory[itemType] = 0; } } if (totalSale > 0) { money += totalSale; updateMoneyDisplay(); updateInventoryDisplay(); LK.getSound('sell').play(); } }); sellButton.x = 600; sellButton.y = 100; sellButton.scaleX = 1.3; sellButton.scaleY = 1.3; LK.gui.topLeft.addChild(sellButton); var seedButton = new Button('SEEDS', function () { seedShop.visible = true; }); seedButton.x = 900; seedButton.y = 100; seedButton.scaleX = 1.3; seedButton.scaleY = 1.3; LK.gui.topLeft.addChild(seedButton); var freeCoinsButton = new Button('FREE COINS', function () { money += 500; updateMoneyDisplay(); }); freeCoinsButton.x = 1200; freeCoinsButton.y = 100; freeCoinsButton.scaleX = 1.3; freeCoinsButton.scaleY = 1.3; LK.gui.topLeft.addChild(freeCoinsButton); var gearButton = new Button('GEAR SHOP', function () { gearShop.visible = true; }); gearButton.x = 600; gearButton.y = 250; gearButton.scaleX = 1.3; gearButton.scaleY = 1.3; LK.gui.topLeft.addChild(gearButton); var fishButton = new Button('FISH SHOP', function () { fishShop.visible = true; }); fishButton.x = 900; fishButton.y = 250; fishButton.scaleX = 1.3; fishButton.scaleY = 1.3; LK.gui.topLeft.addChild(fishButton); var seedShop = new SeedShop(); seedShop.x = 1024; seedShop.y = 1366; seedShop.visible = false; game.addChild(seedShop); var gearShop = new GearShop(); gearShop.x = 1024; gearShop.y = 1366; gearShop.visible = false; game.addChild(gearShop); var fishShop = new FishShop(); fishShop.x = 1024; fishShop.y = 1366; fishShop.visible = false; game.addChild(fishShop); // Button sliding variables var topButtons = [sellButton, seedButton, freeCoinsButton, gearButton, fishButton]; var buttonBasePositions = [600, 900, 1200, 600, 900]; var slideOffset = 0; var maxSlideOffset = 400; // Maximum pixels to slide // Sliding functions function slideButtonsLeft() { slideOffset = Math.min(slideOffset + 100, maxSlideOffset); updateButtonPositions(); } function slideButtonsRight() { slideOffset = Math.max(slideOffset - 100, -maxSlideOffset); updateButtonPositions(); } function updateButtonPositions() { for (var i = 0; i < topButtons.length; i++) { tween(topButtons[i], { x: buttonBasePositions[i] + slideOffset }, { duration: 300, easing: tween.easeOut }); } } function updateMoneyDisplay() { moneyText.setText('Money: $' + money); } function updateInventoryDisplay() { var inventoryStr = 'Inventory: '; var hasItems = false; for (var itemType in inventory) { if (inventory[itemType] > 0) { if (hasItems) inventoryStr += ', '; inventoryStr += itemType + ' x' + inventory[itemType]; hasItems = true; } } if (!hasItems) { inventoryStr += 'Empty'; } inventoryText.setText(inventoryStr); } function expandLands(targetCount) { var currentCount = plantSpots.length; if (targetCount === 12 && currentCount === 6) { // Expand from 6 to 12 lands - add 6 more in 3 columns, 4 rows total for (var i = currentCount; i < targetCount; i++) { var col = i % 3; var row = Math.floor(i / 3); var newSpot = new PlantSpot(startX + col * spacing, startY + row * spacing); plantSpots.push(newSpot); game.addChild(newSpot); } } else if (targetCount === 18 && currentCount === 12) { // Expand from 12 to 18 lands - rearrange to left column and add right column var leftStartY = 800; // First, move existing 12 lands to left side (3 columns, up to 4 rows) for (var i = 0; i < currentCount; i++) { var spot = plantSpots[i]; var newX = startX + i % 3 * spacing; var newY = leftStartY + Math.floor(i / 3) * spacing; tween(spot, { x: newX, y: newY }, { duration: 1000, easing: tween.easeInOut }); } // Add 6 new lands to the right side var rightStartX = startX + 4 * spacing; for (var i = currentCount; i < targetCount; i++) { var rightIndex = i - currentCount; var col = rightIndex % 3; var row = Math.floor(rightIndex / 3); var newSpot = new PlantSpot(rightStartX + col * spacing, leftStartY + row * spacing); plantSpots.push(newSpot); game.addChild(newSpot); } } } function expandLandsForDragonFruit() { var currentCount = plantSpots.length; // Calculate center positioning for all lands var totalLands = currentCount + 12; // Current lands + 12 new lands var landsPerRow = 6; // 6 lands per row for better centering var totalRows = Math.ceil(totalLands / landsPerRow); var totalWidth = (landsPerRow - 1) * spacing; var totalHeight = (totalRows - 1) * spacing; var centerStartX = (2048 - totalWidth) / 2; // Center horizontally on screen var centerStartY = 800; // Move all existing lands to center positions for (var i = 0; i < currentCount; i++) { var spot = plantSpots[i]; var col = i % landsPerRow; var row = Math.floor(i / landsPerRow); var newX = centerStartX + col * spacing; var newY = centerStartY + row * spacing; tween(spot, { x: newX, y: newY }, { duration: 1000, easing: tween.easeInOut }); } // Add 12 new lands continuing from center positions for (var i = 0; i < 12; i++) { var landIndex = currentCount + i; var col = landIndex % landsPerRow; var row = Math.floor(landIndex / landsPerRow); var newX = centerStartX + col * spacing; var newY = centerStartY + row * spacing; var newSpot = new PlantSpot(newX, newY); plantSpots.push(newSpot); game.addChild(newSpot); } } // Play background music LK.playMusic('Music'); // Touch controls for sliding buttons var touchStartX = 0; var isDraggingButtons = false; game.down = function (x, y, obj) { // Check if touch is in the top button area if (y < 200) { touchStartX = x; isDraggingButtons = true; } }; game.up = function (x, y, obj) { if (isDraggingButtons) { var deltaX = x - touchStartX; if (Math.abs(deltaX) > 50) { // Minimum swipe distance if (deltaX > 0) { slideButtonsLeft(); } else { slideButtonsRight(); } } isDraggingButtons = false; } }; game.update = function () { // Plant spots update automatically through their update methods };
===================================================================
--- original.js
+++ change.js
@@ -127,8 +127,9 @@
// Start swimming animation after growth completes
LK.setTimeout(swimmingAnimation, 3000);
}
LK.getSound('plant').play();
+ LK.getSound('Water').play();
return true;
};
self.harvest = function () {
if (!self.grown) return null;
8 bit dragon fruit tree. In-Game asset. 2d. High contrast. No shadows
8 bit carrot. In-Game asset. 2d. High contrast. No shadows
background grass 8 bit. In-Game asset. 2d. High contrast. No shadows
8 bit Straw berry. In-Game asset. 2d. High contrast. No shadows
8 bit banana tree. In-Game asset. 2d. High contrast. No shadows
8 bit coconut tree. In-Game asset. 2d. High contrast. No shadows
Neon
Neon
Neon
Neon
Neon
Stone 8 bit. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
8 bit fish. In-Game asset. 2d. High contrast. No shadows
Neon
8 bit orange. In-Game asset. 2d. High contrast. No shadows
Neon
Apple tree 8 bit. In-Game asset. 2d. High contrast. No shadows
Choco
Choco but all parts of the carrot are visible and only the carrot is painted brown
Neon
different color