Code edit (12 edits merged)
Please save this source code
User prompt
Flash screen red rather than white
Code edit (12 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'console.log("Next type", type);' Line Number: 751
Code edit (23 edits merged)
Please save this source code
Code edit (25 edits merged)
Please save this source code
Code edit (4 edits merged)
Please save this source code
User prompt
Insert sound when bubble detaches. This sound should be called scoreCollected
Code edit (5 edits merged)
Please save this source code
User prompt
Add a new sound when the ball is fired from the launcher
Code edit (2 edits merged)
Please save this source code
User prompt
Before calling LK.gameOver() play a game over jingle
Code edit (4 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -83,29 +83,8 @@
});
var Bubble = Container.expand(function (max_types, isFireBall, type) {
var self = Container.call(this);
self.isFireBall = isFireBall;
- if (isFireBall) {
- var bubbleGraphics = self.attachAsset('fireball', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- bubbleGraphics.width = 150;
- bubbleGraphics.height = 150;
- } else {
- var bubbleGraphics = self.attachAsset('bubble', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- var bubbleShine = self.attachAsset('bubbleshine', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- bubbleShine.x = -35;
- bubbleShine.y = -25;
- bubbleShine.alpha = .9;
- bubbleShine.blendMode = 1;
- }
var state = 0;
self.isAttached = true;
self.isFreeBubble = false;
var speedX = 0;
@@ -125,11 +104,24 @@
} else {
self.type = Math.floor(Math.random() * max_types);
}
}
- if (!isFireBall) {
- bubbleGraphics.tint = bubbleColors[self.type];
+ if (isFireBall) {
+ var bubbleGraphics = self.attachAsset('fireball', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ bubbleGraphics.width = 150;
+ bubbleGraphics.height = 150;
+ } else {
+ var bubbleGraphics = self.attachAsset('bubble' + self.type, {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
}
+ /*if (!isFireBall && self.type > 1) {
+ bubbleGraphics.tint = bubbleColors[self.type];
+ }*/
self.detach = function () {
freeBubbleLayer.addChild(self);
LK.getSound('detachCircle').play();
self.y += grid.y;
@@ -679,18 +671,17 @@
}
var lastRow = rows[0];
/*if(LK.ticks % 10 == 0){
self.printRowsToConsole()
- }*/
+ }*/
if (lastRow) {
for (var a = 0; a < zeroRow.length; a++) {
var bubble = lastRow[a];
if (bubble) {
if (bubble.y + self.y > 2200) {
LK.effects.flashScreen(0xff0000, 3000);
- LK.getSound('gameOverJingle').play().then(function () {
- LK.showGameOver();
- });
+ LK.getSound('gameOverJingle').play();
+ LK.showGameOver();
}
if (gameIsStarted) {
var targetSpeed = Math.pow(Math.pow((2200 - (bubble.y + self.y)) / 2200, 2), 2) * 4 + 0.5;
if (bubble.y + self.y > 2000) {
Circular white gradient circle on black background. Gradient from white on the center to black on the outer edge all around.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Soft straight Long red paint on black background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Fire ball. Bubble shooter game. Thin black outline.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
green notification bubble. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.