User prompt
increase the initial speed
User prompt
initially start with two fruits and then increase the number of thrown fruits garadually
User prompt
throw in chunks but not at the same speed
User prompt
thrrow in chunks not single single
User prompt
Throw them till the same height
User prompt
Thrrow the fruits till the center of the screen.
User prompt
At a time max 5 fruits can be thrown
User prompt
only through the fruit when the previous thrrown fruits are came down.
User prompt
Increase the height of fruit through, also increase the size of the fruits.
User prompt
currently the fruits are spawning in the center only, i want to through the fruits from the whole bottom edge of the screen
User prompt
Gradually increse the fruit count
User prompt
Randomly throught the fruits from the bottom of the screen till the center and then fruits will come down due to gravity
User prompt
Randomly throught the fruits from the bottom of the screen till the center and then fruits will come down due to gravity
User prompt
whenever player click and drag on the screen draw a line on drag path\
User prompt
fruit should destroy in two parts when chopped
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'slash')' in or related to this line: 'if (self.slash) {' Line Number: 104
User prompt
draw a slash line when the player scrach on the screen.
User prompt
Randomly fruits jump from the bottom center of the screen and whenever player clicks on them they will get destroyed..
User prompt
Please fix the bug: 'Uncaught TypeError: fruits[i].containsPoint is not a function' in or related to this line: 'if (fruits[i].containsPoint({' Line Number: 62
Initial prompt
Fruit Chop
===================================================================
--- original.js
+++ change.js
@@ -16,8 +16,18 @@
self.destroy();
}
};
self.slice = function () {
+ // Create two fruit parts
+ var fruitPart1 = new FruitPart();
+ fruitPart1.x = self.x;
+ fruitPart1.y = self.y;
+ game.addChild(fruitPart1);
+ var fruitPart2 = new FruitPart();
+ fruitPart2.x = self.x;
+ fruitPart2.y = self.y;
+ game.addChild(fruitPart2);
+ // Destroy the fruit
self.destroy();
// Increase score
LK.setScore(LK.getScore() + 1);
scoreTxt.setText(LK.getScore());
@@ -28,8 +38,25 @@
self.containsPoint = function (point) {
return point.x >= self.x - self.width / 2 && point.x <= self.x + self.width / 2 && point.y >= self.y - self.height / 2 && point.y <= self.y + self.height / 2;
};
});
+// FruitPart class
+var FruitPart = Container.expand(function () {
+ var self = Container.call(this);
+ var fruitPartGraphics = self.attachAsset('fruit', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = 5;
+ self.rotationSpeed = Math.random() * 0.1 - 0.05;
+ self.update = function () {
+ self.y += self.speed;
+ self.rotation += self.rotationSpeed;
+ if (self.y > 2732) {
+ self.destroy();
+ }
+ };
+});
// Slash class
var Slash = Container.expand(function () {
var self = Container.call(this);
self.points = [];