User prompt
The fake fruit is also appearing in the middle, make the fake one to the right of the real one, and switch between real and fake from time to time
User prompt
After destroying 10 fruits you go to level 2, level two has two fruits, one real and one fake.
Code edit (1 edits merged)
Please save this source code
User prompt
It's not working
Code edit (1 edits merged)
Please save this source code
User prompt
make the pencil speed double with each fruit destroyed, the difference in speed is still very slow
User prompt
make the pencil speed increase by 50% for each fruit destroyed
User prompt
make it so that for each fruit destroyed, the pencil speed increases by 15%
User prompt
the speed difference is still very slow
User prompt
make it so that with each fruit destroyed the pencil becomes faster
User prompt
the fruit destroy trigger is still looping
User prompt
when the pencil destroys one fruit, it destroys many, fix it
User prompt
make the fruit is destroyed trigger only happens once per fruit destroyed
User prompt
create another pencil after the previous one is released
User prompt
make the pencil also be destroyed after touching a fruit
User prompt
Please fix the bug: 'ReferenceError: tween is not defined' in or related to this line: 'tween(fruit, {' Line Number: 95 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
If the fruit is hit, a bounce animation occurs and another random fruit is created. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
the fruits are too small, make them 5x bigger
User prompt
creates a random fruit in the middle of the screen (only one)
User prompt
If you miss the target with your pencil, you lose.
User prompt
the other pencils are being launched out of nowhere
User prompt
Please fix the bug: 'Uncaught TypeError: pencil.containsPoint is not a function' in or related to this line: 'if (pencil.containsPoint({' Line Number: 79
User prompt
make the next pencil not be released if you click on the screen on the previous pencil
User prompt
make it so that if you make a mistake, another pencil is created, stops for 2 seconds, and moves back and forth
User prompt
Fix bug the pencil is being launched without having clicked on the screen
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Fruit = Container.expand(function () { var self = Container.call(this); // Randomly select a fruit type var fruitTypes = ['Apple', 'Banana', 'pineapple', 'sleeve']; var randomFruit = fruitTypes[Math.floor(Math.random() * fruitTypes.length)]; // Attach the selected fruit image asset to the container var fruitGraphics = self.attachAsset(randomFruit, { anchorX: 0.5, anchorY: 0.5, scaleX: 5, // Scale fruit 5x horizontally scaleY: 5 // Scale fruit 5x vertically }); // Set initial position of the fruit in the middle of the screen self.x = 1024; // Center horizontally self.y = 1366; // Center vertically }); var Pencil = Container.expand(function () { var self = Container.call(this); // Attach the pencil image asset to the container var pencilGraphics = self.attachAsset('Pencil', { anchorX: 0.5, anchorY: 0.5 }); // Set initial position of the pencil self.x = 1024; // Center horizontally self.y = 0; // Position at the top of the screen // Add update method to move the pencil left and right self.update = function () { // Move pencil left and right if (self.x <= 0 || self.x >= 2048) { self.speed = -self.speed; // Reverse direction when hitting screen edges } self.x += self.speed; }; self.speed = 5; // Initial speed of the pencil }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ var bg = LK.getAsset('Bg', { anchorX: 0.5, anchorY: 0.5, scaleX: 2048 / 100, // Scale to fit the screen width scaleY: 2732 / 100, // Scale to fit the screen height // Scale to fit 720p height x: 2048 / 2, // Center horizontally y: 2732 / 2 // Center vertically }); game.addChild(bg); var pencil = game.addChild(new Pencil()); var fruit = game.addChild(new Fruit()); fruit.lastWasIntersecting = false; // Add event listener for screen touch to throw the pencil down game.down = function (x, y, obj) { pencil.speed = 20; // Set a downward speed for the pencil pencil.update = function () { // Move pencil down pencil.y += pencil.speed; }; }; // Ensure the game updates the pencil's position every tick game.update = function () { pencil.update(); // Check if the pencil has missed the target (e.g., gone off-screen) if (pencil.y > 2732) { // Trigger game over if the pencil misses the target LK.showGameOver(); } else if (fruit.lastWasIntersecting === false && pencil.intersects(fruit)) { // Destroy the pencil after it touches a fruit pencil.destroy(); // Increase pencil speed significantly pencil.speed += 10; // Create a new pencil pencil = game.addChild(new Pencil()); // Bounce animation on fruit hit tween(fruit, { scaleX: 6, scaleY: 6 }, { duration: 300, easing: tween.bounceOut, onFinish: function onFinish() { tween(fruit, { scaleX: 5, scaleY: 5 }, { duration: 300, easing: tween.bounceIn, onFinish: function onFinish() { // Create a new fruit after the animation finishes fruit.destroy(); fruit = game.addChild(new Fruit()); } }); } }); } fruit.lastWasIntersecting = pencil.intersects(fruit); };
===================================================================
--- original.js
+++ change.js
@@ -87,10 +87,10 @@
LK.showGameOver();
} else if (fruit.lastWasIntersecting === false && pencil.intersects(fruit)) {
// Destroy the pencil after it touches a fruit
pencil.destroy();
- // Increase pencil speed
- pencil.speed += 2;
+ // Increase pencil speed significantly
+ pencil.speed += 10;
// Create a new pencil
pencil = game.addChild(new Pencil());
// Bounce animation on fruit hit
tween(fruit, {
Pencil. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
picnic bg. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
heart icon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
mango fruit with eye and mouth animation.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Banana with eye and mouth animation.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
picnic bg in a night sky. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Watermelon with eye and mouth animation. In-Game asset. 2d. High contrast. No shadows
Orange with eye and mouth animation. In-Game asset. 2d. High contrast. No shadows
Shop icon. In-Game asset. 2d. High contrast. No shadows
Coin icon. In-Game asset. 2d. High contrast. No shadows
Emoji_shocked. In-Game asset. 2d. High contrast. No shadows
Settings icon. In-Game asset. 2d. High contrast. No shadows