User prompt
add a main menu screen with the game title and a game start button. game should not start until game start is touched. main menu should cover the whole screen and the game should not be displayed.
Code edit (1 edits merged)
Please save this source code
User prompt
add local storage module ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
add a button to delete local storage ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
local storage button delete sholuld be next to the points ↪💡 Consider importing and using the following plugins: @upit/storage.v1
Code edit (1 edits merged)
Please save this source code
User prompt
Import of asset
User prompt
lets add somoe particle effect when a block is destroyed
User prompt
use a new asset for particle effect, not splash ball
Code edit (2 edits merged)
Please save this source code
User prompt
move points to 200 pixels to the right
User prompt
move level below points
User prompt
move level 100 pixels to the left
User prompt
sorry I meant to the right
User prompt
move points and level 200 pixles ot the right
User prompt
move points 50 pixels to the right
User prompt
normal ball should start unlocked
Code edit (1 edits merged)
Please save this source code
User prompt
upgrade buttons and text should be the same size as ball purchase buttons, and have the same space between each ther
User prompt
rename buyball50 to button
User prompt
increase the size parameter of the buttons for the upgrades to be the same as the buy balls ones
User prompt
create a new button for powerup buttons
User prompt
Powerup are using an asset for their background button. create a new asset to be used by all of them. should be powerupbutton
User prompt
powerups should use powerup asset
User prompt
upgrade buttons should have a little moroe space between them
===================================================================
--- original.js
+++ change.js
@@ -102,39 +102,8 @@
self.updateTint();
}
};
});
-var MainMenu = Container.expand(function () {
- var self = Container.call(this);
- // Create and attach a title text
- var titleText = new Text2('Idle Breakout', {
- size: 100,
- fill: 0xFFFFFF
- });
- titleText.anchor.set(0.5, 0.5);
- titleText.x = GAME_WIDTH / 2;
- titleText.y = GAME_HEIGHT / 2 - 200;
- self.addChild(titleText);
- // Create and attach a start button
- var startButton = LK.getAsset('BuyBall50', {
- anchorX: 0.5,
- anchorY: 0.5,
- x: GAME_WIDTH / 2,
- y: GAME_HEIGHT / 2
- });
- var buttonText = new Text2('Start Game', {
- size: 50,
- fill: 0xFFFFFF
- });
- buttonText.anchor.set(0.5, 0.5);
- startButton.addChild(buttonText);
- // Add event listener to start button
- startButton.down = function () {
- self.destroy();
- startGame();
- };
- self.addChild(startButton);
-});
/****
* Initialize Game
****/
@@ -144,16 +113,8 @@
/****
* Game Code
****/
-// Function to start the game
-function startGame() {
- createBricks();
- createBall();
-}
-// Create and display the main menu
-var mainMenu = new MainMenu();
-game.addChild(mainMenu);
// Constants
var GAME_WIDTH = 2048;
var GAME_HEIGHT = 2632;
var BALL_RADIUS = 50;
@@ -204,9 +165,9 @@
};
var balls = [];
var bricks = [];
var brickGrid = {};
-var score = 10000;
+var score = 0;
var level = 1;
var brickGridBounds = null;
// HUD Setup
var hud = new Container();