User prompt
Add a text field inside PopUpNumber with a text "Income"
User prompt
add a text inside popupnumber
User prompt
make pop up move ease in
User prompt
make pop up number as a text same as score
User prompt
Fix Bug: 'TypeError: numberGraphics.setText is not a function' in this line: 'numberGraphics.setText(text);' Line Number: 16
User prompt
Fix Bug: 'TypeError: popUpNumber.setText is not a function' in this line: 'popUpNumber.setText('🍬' + clickPower);' Line Number: 58
User prompt
make a pop up number format same as score. It have to appear, then fly away, then disappear -like particles fountain
User prompt
Make a pop-up number after each click, but fly a bit a different direction each time
User prompt
Please make candy being an UI button and handle onlcik by bouncing image a bit
User prompt
Please remove auto incremental on time
User prompt
Please add🍬emoji on a score text
Initial prompt
🍬Candy🍬 Clicker
===================================================================
--- original.js
+++ change.js
@@ -1,10 +1,17 @@
var PopUpNumber = Container.expand(function () {
var self = Container.call(this);
var numberGraphics = self.createAsset('number', 'Number Graphics', .5, .5);
self.fly = function (direction) {
- self.x += Math.cos(direction) * 10;
- self.y += Math.sin(direction) * 10;
+ var flyInterval = LK.setInterval(function () {
+ self.x += Math.cos(direction) * 10;
+ self.y += Math.sin(direction) * 10;
+ self.alpha -= 0.01;
+ if (self.alpha <= 0) {
+ LK.clearInterval(flyInterval);
+ self.destroy();
+ }
+ }, 16);
};
});
var Candy = Container.expand(function () {
var self = Container.call(this);
@@ -47,8 +54,9 @@
popUpNumber.x = candy.x;
popUpNumber.y = candy.y;
var direction = Math.random() * Math.PI * 2;
popUpNumber.fly(direction);
+ popUpNumber.setText('🍬' + clickPower);
});
upgrade.on('down', function (obj) {
if (score >= 10) {
score -= 10;