User prompt
Please fix the bug: 'Uncaught TypeError: LK.getLeaderboard is not a function' in or related to this line: 'LK.getLeaderboard(function (scores) {' Line Number: 99
User prompt
Add a leaderbord that shows you other players high score when you lose
User prompt
Add a text box that the player can enter there username into and store it
User prompt
Make it before the game starts it adds a enter username screen ware you enter your name
User prompt
Hide the start button and start game
User prompt
Disable the start button
User prompt
Remove play button
User prompt
Make it before you play you have to enter a username that gets stored on the leaderbord ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Add a leader border
User prompt
Make the ball speed increase every time your score goes up by 5
User prompt
Fix bomb being stuck at top of screen
User prompt
Sharpen up my game
User prompt
Make all text bold
User prompt
Make score bold
User prompt
Move the hearts to the right a bit
User prompt
Move the hearts 1cm to the left
User prompt
Change hearts to opposite side
User prompt
Change background to neon orange
User prompt
Make the play button reach the top of screen and unblur it
User prompt
Make background neon green
User prompt
Make the play button take up the full screen
User prompt
Please fix the bug: 'Uncaught ReferenceError: hearts is not defined' in or related to this line: 'hearts[hearts.length - 1].destroy();' Line Number: 51
User prompt
Please fix the bug: 'Uncaught ReferenceError: scoreTxt is not defined' in or related to this line: 'scoreTxt.setText(LK.getScore());' Line Number: 30
User prompt
Add a home screen before the game starts that you can click play button on
User prompt
Change background to gray
/**** * Classes ****/ var Ball = Container.expand(function () { var self = Container.call(this); var ballGraphics = self.attachAsset('ball', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5 + Math.floor(LK.getScore() / 5); self.speed = 5 + Math.floor(LK.getScore() / 5); self.update = function () { self.y += self.speed; if (self.y > 2732) { self.destroy(); } }; self.down = function (x, y, obj) { LK.setScore(LK.getScore() + 1); scoreTxt.setText(LK.getScore()); LK.getSound('Pop').play(); self.destroy(); }; }); var Bomb = Container.expand(function () { var self = Container.call(this); var bombGraphics = self.attachAsset('bomb', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { self.y += self.speed; if (self.y > 2732 || self.y < 0) { self.destroy(); } }; self.down = function (x, y, obj) { LK.getSound('Bomb').play(); LK.effects.flashScreen(0xff0000, 1000); hearts[hearts.length - 1].destroy(); hearts.pop(); if (hearts.length === 0) { LK.showGameOver(); } }; }); var Heart = Container.expand(function () { var self = Container.call(this); var heartGraphics = self.attachAsset('heart', { anchorX: 0.5, anchorY: 0.5, fontWeight: 'bold' }); }); //<Write imports for supported plugins here> //<Write entity 'classes' with empty functions for important behavior here> var HomeScreen = Container.expand(function () { var self = Container.call(this); var playButton = self.attachAsset('playButton', { anchorX: 0.5, anchorY: 0, width: 2048, height: 2732, fontWeight: 'bold' }); playButton.x = 2048 / 2; playButton.y = 0; playButton.filters = []; self.down = function (x, y, obj) { self.destroy(); startGame(); }; }); var RainbowBall = Container.expand(function () { var self = Container.call(this); var rainbowBallGraphics = self.attachAsset('rainbowBall', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.update = function () { self.y += self.speed; if (self.y > 2732) { self.destroy(); } }; self.down = function (x, y, obj) { LK.setScore(LK.getScore() + 5 + Math.floor(LK.getScore() / 20)); scoreTxt.setText(LK.getScore()); LK.getSound('Pop').play(); self.destroy(); }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0xFFA500 //Init game with neon orange background }); /**** * Game Code ****/ var scoreTxt; var hearts = []; var homeScreen = new HomeScreen(); game.addChild(homeScreen); //<Assets used in the game will automatically appear here> //<Write game logic code here, including initializing arrays and variables> function startGame() { scoreTxt = new Text2('0', { size: 150, fill: 0x000000, fontWeight: 'bold' }); hearts = []; for (var i = 0; i < 3; i++) { var heart = new Heart(); heart.x = 2048 - (50 + i * 120) - 150; // 150px = 0.75cm on a 12.9" iPad Pro heart.y = 50; hearts.push(heart); game.addChild(heart); } scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); var balls = []; var bombs = []; function spawnBall() { var newBall = new Ball(); newBall.x = 200 + Math.random() * (2048 - 400); // 200px = 2cm on a 12.9" iPad Pro newBall.y = 0; // Check if the new ball overlaps with any existing balls for (var i = 0; i < balls.length; i++) { if (newBall.intersects(balls[i])) { return; // If it overlaps, don't add the new ball } } balls.push(newBall); game.addChild(newBall); } function spawnBomb() { var newBomb = new Bomb(); newBomb.x = Math.random() * 2048; newBomb.y = 0; bombs.push(newBomb); game.addChild(newBomb); } function spawnRainbowBall() { var newRainbowBall = new RainbowBall(); newRainbowBall.x = Math.random() * 2048; newRainbowBall.y = 0; game.addChild(newRainbowBall); } LK.setInterval(spawnBall, 1000); var bombInterval = LK.setInterval(spawnBomb, 10000 - LK.getScore() * 100); var rainbowBallInterval = LK.setInterval(spawnRainbowBall, 30000 - LK.getScore() * 200); game.update = function () { if (LK.getScore() >= 30) { LK.clearInterval(bombInterval); bombInterval = LK.setInterval(spawnBomb, 5000 - LK.getScore() * 50); } for (var i = balls.length - 1; i >= 0; i--) { balls[i].update(); if (balls[i].y > 2732) { balls[i].destroy(); balls.splice(i, 1); } } for (var j = bombs.length - 1; j >= 0; j--) { bombs[j].update(); if (bombs[j].y > 2732) { bombs[j].destroy(); bombs.splice(j, 1); } } }; game.update = function () { for (var i = balls.length - 1; i >= 0; i--) { balls[i].update(); if (balls[i].y > 2732) { balls[i].destroy(); balls.splice(i, 1); } } for (var j = bombs.length - 1; j >= 0; j--) { bombs[j].update(); if (bombs[j].y > 2732) { bombs[j].destroy(); bombs.splice(j, 1); } } for (var k = game.children.length - 1; k >= 0; k--) { if (game.children[k] instanceof RainbowBall) { game.children[k].update(); if (game.children[k].y > 2732) { game.children[k].destroy(); } } } }; game.down = function (x, y, obj) { // Handle global down events if needed }; game.up = function (x, y, obj) { // Handle global up events if needed }; }
===================================================================
--- original.js
+++ change.js
@@ -29,9 +29,9 @@
anchorY: 0.5
});
self.update = function () {
self.y += self.speed;
- if (self.y > 2732) {
+ if (self.y > 2732 || self.y < 0) {
self.destroy();
}
};
self.down = function (x, y, obj) {
Red minecraft heart. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Black background with word start in middle. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Rainbow ball. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Cool scenic view. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadowcs.
Ball for pop game plain green. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Bomb for pop game. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Upgrade sign. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.