Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (20 edits merged)
Please save this source code
User prompt
Implement self.calculateWarningScoreList = function () {}; which should return 13 warning values based on how many bubbles are getting close to the bottom of the screen. The goal being to show a warning to the user that some balls are getting close to the bottom.
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: null is not an object (evaluating 'bubbleIndex.col')' in or related to this line: 'var newCol = bubbleIndex.col + dir[1];' Line Number: 221
User prompt
Please fix the bug: 'TypeError: null is not an object (evaluating 'bubbleIndex.row')' in or related to this line: 'var newRow = bubbleIndex.row + dir[0];' Line Number: 218
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: null is not an object (evaluating 'bubbleIndex.row')' in or related to this line: 'if (rows[bubbleIndex.row] && rows[bubbleIndex.row].length == 12) {' Line Number: 211
Code edit (1 edits merged)
Please save this source code
Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: null is not an object (evaluating 'bubbleIndex.row')' in or related to this line: 'if (rows[bubbleIndex.row].length == 12) {' Line Number: 211
Code edit (1 edits merged)
Please save this source code
Code edit (12 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: null is not an object (evaluating 'bubbleIndex.row')' in or related to this line: 'if (rows[bubbleIndex.row].length == 12) {' Line Number: 211
Code edit (10 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: Can't find variable: intersectedBubble' in or related to this line: 'var intersectedBubblePos = self.findBubbleIndex(intersectedBubble);' Line Number: 313
Code edit (1 edits merged)
Please save this source code
Code edit (13 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: Can't find variable: isActive' in or related to this line: 'if (isActive) {' Line Number: 57
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -22,16 +22,16 @@
bubbleShine.y = -25;
bubbleShine.alpha = .9;
bubbleShine.blendMode = 1;
var state = 0;
- var targetX = 0;
- var targetY = 0;
var isAttached = true;
var speedX = 0;
var speedY = 0;
+ self.targetX = 0;
+ self.targetY = 0;
self.setPos = function (x, y) {
- self.x = targetX = x;
- self.y = targetY = y;
+ self.x = self.targetX = x;
+ self.y = self.targetY = y;
};
max_types = max_types || 3;
self.type = Math.floor(Math.random() * max_types);
bubbleGraphics.tint = bubbleColors[self.type];
@@ -43,9 +43,17 @@
speedY = -Math.random() * 30;
self.down = undefined;
};
self.update = function () {
- if (!isAttached) {
+ var isActive = true; // Assuming default active state
+ if (isActive) {
+ if (self.x != self.targetX) {
+ self.x += (self.targetX - self.x) / 2;
+ }
+ if (self.y != self.targetY) {
+ self.y += (self.targetY - self.y) / 2;
+ }
+ } else {
self.x += speedX;
self.y += speedY;
speedY += 1.5;
if (self.x < bubbleSize / 2 && speedX < 0 || self.x > game.width - bubbleSize / 2 && speedX > 0) {
@@ -366,10 +374,10 @@
closestPosition = i;
}
}
// Attach bubble to the closest position
- bubble.x = offsetPositions[closestPosition].x;
- bubble.y = offsetPositions[closestPosition].y;
+ bubble.targetX = offsetPositions[closestPosition].x;
+ bubble.targetY = offsetPositions[closestPosition].y;
var row = rows[offsetPositions[closestPosition].ro];
if (!row) {
if (rows[intersectedBubblePos.row].length == 13) {
row = [null, null, null, null, null, null, null, null, null, null, null, null];
@@ -523,9 +531,9 @@
/****
* Initialize Game
****/
var game = new LK.Game({
- backgroundColor: 0x010c42
+ backgroundColor: 0x010330
});
/****
* Game Code
@@ -548,9 +556,9 @@
[ ]
*/
var bubbleSize = 150;
var gameIsStarted = false;
-var bubbleColors = [0xb22bff, 0xff2853, 0x44d31f, 0x29a5fb, 0xff8522, 0xfffa2b];
+var bubbleColors = [0xff2853, 0x44d31f, 0x29a5fb, 0xff8522, 0xfffa2b, 0xb22bff];
var barriers = [];
var maxTypes = 5;
for (var a = 0; a < 4; a++) {
for (var b = 0; b < 3; b++) {
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.