User prompt
increase stone throw cooldown to 0.4 sec
User prompt
add stone throw cooldown of 0.1 sec
User prompt
remove stone throw cooldown
User prompt
spawn a superbottle every 25 score
User prompt
spawn a goldenbottle every 25 score
User prompt
make stone throw cooldown 0.1 sec
User prompt
throw 1 stone at a time
User prompt
add a superbottle which will give 50 points when destroyed and make its spawn chance 1 in 1000
User prompt
add powerup named (2x points) for cost of 100 points from shop.By activating this you earn 2x points for next 10 minutes
User prompt
add a shop where you can buy powerups:-
User prompt
add bottleburst effects
User prompt
you can only hit stone when you click on screen
User prompt
when a bottle is hit by stone apply bottleburst assets to it
User prompt
add shop icon on bottom left corner
User prompt
make a shop section
Initial prompt
Bottle burst
===================================================================
--- original.js
+++ change.js
@@ -11,8 +11,18 @@
self.update = function () {
// Bottle specific update logic if needed
};
});
+var GoldenBottle = Container.expand(function () {
+ var self = Container.call(this);
+ var bottleGraphics = self.attachAsset('goldenbottle', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.update = function () {
+ // GoldenBottle specific update logic if needed
+ };
+});
//<Assets used in the game will automatically appear here>
// Stone class
var Stone = Container.expand(function () {
var self = Container.call(this);
@@ -48,21 +58,20 @@
* Game Code
****/
// Initialize arrays and variables
var stones = [];
-var lastStoneThrowTime = 0;
var bottles = [];
var score = 0;
var scoreTxt = new Text2('0', {
size: 150,
fill: "#ffffff"
});
+var goldenBottleSpawned = false;
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Function to handle stone throwing
function throwStone(x, y) {
- if (stones.length === 0 && Date.now() - lastStoneThrowTime >= 100) {
- lastStoneThrowTime = Date.now();
+ if (stones.length === 0) {
var newStone = new Stone();
newStone.x = x;
newStone.y = y;
stones.push(newStone);
@@ -89,10 +98,9 @@
}
// Handle game move event
game.move = function (x, y, obj) {
// Handle stone throwing
- if (stones.length === 0 && Date.now() - lastStoneThrowTime >= 100) {
- lastStoneThrowTime = Date.now();
+ if (stones.length === 0) {
throwStone(x, y);
}
};
// Update game logic
@@ -115,10 +123,16 @@
bottles[j].destroy();
bottles.splice(j, 1);
stones[i].destroy();
stones.splice(i, 1);
+ goldenBottleSpawned = false;
// Create a new bottle
- createBottle();
+ if (score % 25 === 0 && score !== 0 && !goldenBottleSpawned) {
+ newBottle = new GoldenBottle();
+ goldenBottleSpawned = true;
+ } else {
+ createBottle();
+ }
break;
}
}
// Destroy stones that are off screen
2d stone transparent background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Shop icon in a square box. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
golden bottle transparent background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
shopmenu transparent background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
dark wooden floor. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2x points buff. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
bomb transparent background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.