User prompt
add dollar sing for all puraches price
User prompt
can you make upgrade buttons bigger, same for the text inside of them and rearaagne them
User prompt
can you add an icon to the upgrades for each ball to know which oe it is
Code edit (1 edits merged)
Please save this source code
User prompt
on new level balls and upgrades shoudl not be reseted
Code edit (1 edits merged)
Please save this source code
User prompt
Can we increase the size of the buttons for the upgrades
User prompt
more
User prompt
size of buttons is not increasing.
User prompt
Increase the size of the upgrades button, the size of the asset of the button itself, and of course the spacign between them to fit correcly.
User prompt
all progress of game should be stored in local storage βͺπ‘ Consider importing and using the following plugins: @upit/storage.v1
User prompt
Progress is not being savesd in local sgtoras. Allshoudl be stored, level, upgrades, balls, evertyhig βͺπ‘ Consider importing and using the following plugins: @upit/storage.v1
User prompt
save points, level, balls purchased, and upgrades purchased in local storage so you continue next level from where you last playerd βͺπ‘ Consider importing and using the following plugins: @upit/storage.v1
User prompt
local storage is not working
User prompt
Please fix the bug: 'storage.load is not a function' in or related to this line: 'storage.load();' Line Number: 132 βͺπ‘ Consider importing and using the following plugins: @upit/storage.v1
User prompt
do not reste points, level, upgrades costs on game start
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'splashBallCost')' in or related to this line: 'var splashCostText = new Text2('$' + upgrades.splashBallCost.toString(), {' Line Number: 229
User prompt
make background marine blue
User prompt
add local storage to the game βͺπ‘ Consider importing and using the following plugins: @upit/storage.v1
User prompt
remove hardcoding of points
User prompt
reset points, player should start with 0 points unless they have points in storage βͺπ‘ Consider importing and using the following plugins: @upit/storage.v1
User prompt
create a home screen with the game title and a start game button
User prompt
can we make bricks bigger and adjust the grid accordingly. double their size
User prompt
now some pricks are out of the screen. adjust columns and rows to adapt to thenew size of each brick
User prompt
make numbers in brick bigge
===================================================================
--- original.js
+++ change.js
@@ -192,14 +192,14 @@
levelTxt.anchor.set(1, 0);
levelTxt.x = scoreTxt.width + 20;
hud.addChild(levelTxt);
var buyNormalButton = LK.getAsset('BuyBall50', {
- size: 120,
+ size: 80,
fill: 0xFFFFFF,
anchorX: 0.5,
anchorY: 0,
y: 0,
- x: -500
+ x: -400
});
var normalCostText = new Text2('$' + BALL_COST.toString(), {
size: 50,
fill: 0xFFFFFF
@@ -216,20 +216,19 @@
buyNormalButton.down = function () {
if (score >= BALL_COST) {
score -= BALL_COST;
scoreTxt.setText('$' + score.toString());
- storage.score = score;
createBall('normal');
}
};
hud.addChild(buyNormalButton);
var buySplashButton = LK.getAsset('BuyBall50', {
- size: 120,
+ size: 80,
fill: 0xFFFFFF,
anchorX: 0.5,
anchorY: 0,
y: 0,
- x: -380
+ x: -280
});
var splashCostText = new Text2('$' + upgrades.splashBallCost.toString(), {
size: 50,
fill: 0xFFFFFF
@@ -246,9 +245,8 @@
buySplashButton.down = function () {
if (score >= upgrades.splashBallCost) {
score -= upgrades.splashBallCost;
scoreTxt.setText('$' + score.toString());
- storage.score = score;
createBall('splash');
}
};
hud.addChild(buySplashButton);
@@ -258,9 +256,9 @@
game.addChild(bottomHud);
// Upgrade Button Factory with Icons
function createUpgradeButton(labelPrefix, x, costKey, upgradeKey, baseCost, iconType) {
var button = LK.getAsset('BuyBall50', {
- size: 120,
+ size: 80,
fill: 0xFFFFFF,
anchorX: 0.5,
anchorY: 0,
x: x,
@@ -295,17 +293,15 @@
upgrades[upgradeKey]++;
costText.setText('$' + (baseCost * upgrades[upgradeKey]).toString());
labelText.setText("".concat(labelPrefix, " x").concat(upgrades[upgradeKey]));
scoreTxt.setText('$' + score.toString());
- storage.score = score;
balls.forEach(function (b) {
if (b.type === 'normal' && upgradeKey.includes('normal')) {
b[upgradeKey.includes('Speed') ? 'speed' : 'power'] = upgrades[upgradeKey];
} else if (b.type === 'splash' && upgradeKey.includes('splash')) {
b[upgradeKey.includes('Speed') ? 'speed' : 'power'] = upgrades[upgradeKey];
}
});
- storage.upgrades = upgrades;
}
};
bottomHud.addChild(button);
}
@@ -412,16 +408,8 @@
break;
}
}
balls.push(ball);
- storage.balls = balls.map(function (b) {
- return {
- type: b.type,
- x: b.x,
- y: b.y,
- direction: b.direction
- };
- });
game.addChild(ball);
}
game.update = function () {
for (var i = balls.length - 1; i >= 0; i--) {
@@ -439,26 +427,16 @@
level += 1;
levelTxt.setText('Level: ' + level);
createBricks();
storage.level = level;
+ storage.score = score;
+ storage.upgrades = upgrades;
}
}
if (balls.length === 0 && score >= BALL_COST) {
score -= BALL_COST;
scoreTxt.setText('$' + score.toString());
- storage.score = score;
- if (storage.balls) {
- storage.balls.forEach(function (b) {
- var ball = new Ball(b.type);
- ball.x = b.x;
- ball.y = b.y;
- ball.direction = b.direction;
- balls.push(ball);
- game.addChild(ball);
- });
- } else {
- createBall();
- }
+ createBall();
}
};
game.down = function (x, y, obj) {
if (!bricks || !Array.isArray(bricks)) {