User prompt
When you reach 3000 clicks everything is automated ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
When you reach 2500 clicks there is a message below the click counter saying: congratulations on getting here but it's not done yet
User prompt
When you reach 400 clicks the red cube is automated ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
When you reach 250 clicks a red triangle appears at the left of the cube that boost all clicks by 1.25 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
When you reach 750 clicks the green circle is automated ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
When you reach 1000 clicks add a blue hexagon above the cube that multiples the clicks per click by 1.5 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
When the cube has been clicked 500 times add a green circle under the cube that gives 2 clicks per click ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
When you reach 100 clicks the green cube automatically clicks itself ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
User prompt
Cube Clicker
Initial prompt
Make a game about clicking a cube to get points
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var BlueHexagon = Container.expand(function () {
var self = Container.call(this);
var hexagonGraphics = self.attachAsset('blueHexagon', {
anchorX: 0.5,
anchorY: 0.5
});
// Color variations for click feedback
var originalColor = 0x0066ff;
var clickColor = 0x3399ff;
self.onClick = function () {
// Award points with 1.5x multiplier (1.5 clicks worth)
var pointsToAdd = Math.floor(1.5 * clickMultiplier);
LK.setScore(LK.getScore() + pointsToAdd);
// Increment click counter by 1.5 (rounded down)
clickCount += pointsToAdd;
// Visual feedback - color flash
hexagonGraphics.tint = clickColor;
tween(hexagonGraphics, {
tint: originalColor
}, {
duration: 200
});
// Visual feedback - scale animation
tween(self, {
scaleX: 1.1,
scaleY: 1.1
}, {
duration: 100,
easing: tween.easeOut,
onFinish: function onFinish() {
tween(self, {
scaleX: 1.0,
scaleY: 1.0
}, {
duration: 100,
easing: tween.easeIn
});
}
});
// Play click sound
LK.getSound('click').play();
// Update score display
if (scoreTxt) {
scoreTxt.setText(LK.getScore());
}
};
self.down = function (x, y, obj) {
self.onClick();
};
return self;
});
var Cube = Container.expand(function () {
var self = Container.call(this);
var cubeGraphics = self.attachAsset('cube', {
anchorX: 0.5,
anchorY: 0.5
});
// Color variations for click feedback
var originalColor = 0x4a90e2;
var clickColor = 0x7bb3f0;
self.onClick = function () {
// Award points with multiplier
var pointsToAdd = 1 * clickMultiplier;
LK.setScore(LK.getScore() + pointsToAdd);
// Increment click counter
clickCount += pointsToAdd;
// Check if we've reached 100 clicks to enable auto-click
if (clickCount >= 100 && !autoClickActive) {
autoClickActive = true;
}
// Visual feedback - color flash
cubeGraphics.tint = clickColor;
tween(cubeGraphics, {
tint: originalColor
}, {
duration: 200
});
// Visual feedback - scale animation
tween(self, {
scaleX: 1.1,
scaleY: 1.1
}, {
duration: 100,
easing: tween.easeOut,
onFinish: function onFinish() {
tween(self, {
scaleX: 1.0,
scaleY: 1.0
}, {
duration: 100,
easing: tween.easeIn
});
}
});
// Play click sound
LK.getSound('click').play();
// Update score display
if (scoreTxt) {
scoreTxt.setText(LK.getScore());
}
};
self.down = function (x, y, obj) {
self.onClick();
};
return self;
});
var GreenCircle = Container.expand(function () {
var self = Container.call(this);
var circleGraphics = self.attachAsset('greenCircle', {
anchorX: 0.5,
anchorY: 0.5
});
// Color variations for click feedback
var originalColor = 0x00ff00;
var clickColor = 0x66ff66;
self.onClick = function () {
// Award 2 points (2 clicks worth) with multiplier
var pointsToAdd = 2 * clickMultiplier;
LK.setScore(LK.getScore() + pointsToAdd);
// Increment click counter by 2 with multiplier
clickCount += pointsToAdd;
// Visual feedback - color flash
circleGraphics.tint = clickColor;
tween(circleGraphics, {
tint: originalColor
}, {
duration: 200
});
// Visual feedback - scale animation
tween(self, {
scaleX: 1.1,
scaleY: 1.1
}, {
duration: 100,
easing: tween.easeOut,
onFinish: function onFinish() {
tween(self, {
scaleX: 1.0,
scaleY: 1.0
}, {
duration: 100,
easing: tween.easeIn
});
}
});
// Play click sound
LK.getSound('click').play();
// Update score display
if (scoreTxt) {
scoreTxt.setText(LK.getScore());
}
};
self.down = function (x, y, obj) {
self.onClick();
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x2c3e50
});
/****
* Game Code
****/
// Create score display
var scoreTxt = new Text2('0', {
size: 120,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
scoreTxt.setText(LK.getScore());
LK.gui.top.addChild(scoreTxt);
// Position score text with some padding from top
scoreTxt.y = 100;
// Track click count for auto-click feature
var clickCount = 0;
var autoClickActive = false;
var greenCircleActive = false;
var greenCircle = null;
var blueHexagonActive = false;
var blueHexagon = null;
var clickMultiplier = 1;
var greenCircleAutoClickActive = false;
// Create the main cube
var cube = game.addChild(new Cube());
// Position cube at center of screen
cube.x = 2048 / 2;
cube.y = 2732 / 2;
// Game update loop
game.update = function () {
// Auto-click functionality when 100 clicks reached
if (autoClickActive && LK.ticks % 60 === 0) {
// Auto-click every second (60 ticks)
cube.onClick();
}
// Check if we've reached 750 clicks to enable green circle auto-click
if (clickCount >= 750 && greenCircleActive && !greenCircleAutoClickActive) {
greenCircleAutoClickActive = true;
}
// Green circle auto-click functionality when 750 clicks reached
if (greenCircleAutoClickActive && LK.ticks % 45 === 0) {
// Auto-click green circle every 0.75 seconds (45 ticks)
if (greenCircle) {
greenCircle.onClick();
}
}
// Check if we've reached 500 clicks to spawn green circle
if (clickCount >= 500 && !greenCircleActive) {
greenCircleActive = true;
greenCircle = game.addChild(new GreenCircle());
// Position green circle under the cube
greenCircle.x = 2048 / 2;
greenCircle.y = 2732 / 2 + 200;
}
// Check if we've reached 1000 clicks to spawn blue hexagon
if (clickCount >= 1000 && !blueHexagonActive) {
blueHexagonActive = true;
clickMultiplier = 1.5;
blueHexagon = game.addChild(new BlueHexagon());
// Position blue hexagon above the cube
blueHexagon.x = 2048 / 2;
blueHexagon.y = 2732 / 2 - 200;
}
}; ===================================================================
--- original.js
+++ change.js
@@ -191,8 +191,9 @@
var greenCircle = null;
var blueHexagonActive = false;
var blueHexagon = null;
var clickMultiplier = 1;
+var greenCircleAutoClickActive = false;
// Create the main cube
var cube = game.addChild(new Cube());
// Position cube at center of screen
cube.x = 2048 / 2;
@@ -203,8 +204,19 @@
if (autoClickActive && LK.ticks % 60 === 0) {
// Auto-click every second (60 ticks)
cube.onClick();
}
+ // Check if we've reached 750 clicks to enable green circle auto-click
+ if (clickCount >= 750 && greenCircleActive && !greenCircleAutoClickActive) {
+ greenCircleAutoClickActive = true;
+ }
+ // Green circle auto-click functionality when 750 clicks reached
+ if (greenCircleAutoClickActive && LK.ticks % 45 === 0) {
+ // Auto-click green circle every 0.75 seconds (45 ticks)
+ if (greenCircle) {
+ greenCircle.onClick();
+ }
+ }
// Check if we've reached 500 clicks to spawn green circle
if (clickCount >= 500 && !greenCircleActive) {
greenCircleActive = true;
greenCircle = game.addChild(new GreenCircle());