Code edit (6 edits merged)
Please save this source code
User prompt
Add a label that shows how many fire ball powers ups you have left to FireBallPowerupOverlay
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (19 edits merged)
Please save this source code
User prompt
Where it says //Fire partiles go here spawn fire particles every tick%5
User prompt
Add a fire particle class to the game
Code edit (1 edits merged)
Please save this source code
Code edit (18 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: Can't find variable: multiplier' in or related to this line: 'var scoreIndicator = game.addChild(new ScoreIndicatorLabel(baseValue * multiplier, bubble.type));' Line Number: 684
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
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: 'Script error.' in or related to this line: 'var streakUX = game.addChild(new StreakUX());' Line Number: 718
User prompt
rename StreakUX to BonusUX
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'var streakUX = self.addChild(new StreakUX());' Line Number: 716
Code edit (15 edits merged)
Please save this source code
User prompt
In streak ux insert a streak label at //Insert label here
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
Code edit (20 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -73,13 +73,16 @@
// bonuseBarEnd.x = -bonusLabel.width;
});
var Bubble = Container.expand(function (max_types, isFireBall) {
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;
/*bubbleGraphics.update = function(){
bubbleGraphics.rotation -= .01
}*/
/*var bubbleGraphics2 = self.attachAsset('fireparticle', {
@@ -106,9 +109,9 @@
bubbleShine.blendMode = 1;
}
var state = 0;
self.isAttached = true;
- self.isFlying = false;
+ self.isFreeBubble = false;
var speedX = 0;
var speedY = 0;
self.targetX = 0;
self.targetY = 0;
@@ -134,17 +137,18 @@
self.down = undefined;
};
var spawnMod = 0;
self.update = function () {
- if (isFireBall) {
- if (++spawnMod % 5 == 0 && self.parent) {
- // Spawn fire particles every 5 ticks
- var fireParticle = self.parent.addChild(new FireParticle());
- fireParticle.x = self.x;
- fireParticle.y = self.y;
+ if (self.isFreeBubble) {
+ if (isFireBall) {
+ if (++spawnMod % 2 == 0 && self.parent) {
+ // Spawn fire particles every 5 ticks
+ var angle = Math.random() * Math.PI * 2;
+ var fireParticle = self.parent.addChild(new FireParticle(angle));
+ fireParticle.x = self.x + Math.cos(angle) * self.width / 4;
+ fireParticle.y = self.y + Math.sin(angle) * self.width / 4;
+ }
}
- }
- if (self.isFlying) {
return;
}
if (self.isAttached) {
if (self.x != self.targetX) {
@@ -205,21 +209,36 @@
self.destroy();
}
};
});
-var FireParticle = Container.expand(function () {
+var FireBallPowerupOverlay = Container.expand(function () {
var self = Container.call(this);
+ var bubbleGraphics = self.attachAsset('fireball', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.y = game.height - 170;
+ self.x = 200;
+ var countBG = self.attachAsset('countbg', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ countBG.x = 80;
+ countBG.y = 60;
+});
+var FireParticle = Container.expand(function (angle) {
+ var self = Container.call(this);
var particleGraphics = self.attachAsset('fireparticle', {
anchorX: 0.5,
anchorY: 0.5
});
particleGraphics.blendMode = 1;
- var speedX = Math.random() * 4 - 2;
- var speedY = Math.random() * 4 - 2;
+ var speedX = Math.cos(angle) * 1;
+ var speedY = Math.sin(angle) * 1;
var rotationSpeed = Math.random() * 0.1 - 0.05;
self.update = function () {
- self.x += speedX;
- self.y += speedY;
+ self.x += speedX * self.alpha;
+ self.y += speedY * self.alpha;
particleGraphics.rotation += rotationSpeed;
self.alpha -= 0.01;
if (self.alpha <= 0) {
self.destroy();
@@ -471,9 +490,9 @@
}
var intersectedBubble = self.bubbleIntersectsGrid(nextX + self.x, nextY + self.y);
if (intersectedBubble) {
gameIsStarted = true;
- if (isFireBall) {
+ if (bubble.isFireBall) {
self.removeBubbles([intersectedBubble]);
var disconnected = self.getDetachedBubbles();
self.removeBubbles(disconnected);
} else {
@@ -542,9 +561,9 @@
bubble.x = prevX;
bubble.y = prevY;
bubble.targetX = currentMatch.x;
bubble.targetY = currentMatch.y;
- bubble.isFlying = false;
+ bubble.isFreeBubble = false;
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];
@@ -672,16 +691,16 @@
});
var Launcher = Container.expand(function () {
var self = Container.call(this);
var bubble = self.addChild(new Bubble(getMaxTypes(), true));
- bubble.isFlying = true;
+ bubble.isFreeBubble = true;
var previewBubble;
function createPreviewBubble() {
previewBubble = self.addChildAt(new Bubble(maxSelectableBubble), 0);
previewBubble.scale.set(.5, .5);
previewBubble.x = -90;
previewBubble.y = 30;
- previewBubble.isFlying = true;
+ previewBubble.isFreeBubble = true;
}
createPreviewBubble();
self.fire = function () {
bulletsFired++;
@@ -810,17 +829,16 @@
/*
Todo:
[X] Make sure we GC nodes that drop of screen
[ ] Make preview line fade out at the end
-*/
+*/
var bulletsFired = 0; //3*30+1
var bubbleSize = 150;
var gameIsStarted = false;
var bubbleColors = [0xff2853, 0x44d31f, 0x5252ff, 0xcb2bff, 0x28f2f0, 0xffc411];
var barriers = [];
var maxSelectableBubble = 3;
var warningLines = [];
-var isFireBall = true;
for (var a = 0; a < 13; a++) {
var wl = game.addChild(new WarningLine());
wl.x = 2048 / 13 * (a + .5);
wl.y = 2200;
@@ -861,8 +879,9 @@
scoreMultipliers.push(sm);
game.addChild(sm);
}
var bonusUX = game.addChild(new BonusUX());
+var fireBallPowerupOverlay = game.addChild(new FireBallPowerupOverlay());
var particlesLayer = game.addChild(new Container());
var grid = game.addChild(new Grid());
grid.y = 1000;
var freeBubbleLayer = game.addChild(new Container());
@@ -985,5 +1004,117 @@
;
;
;
;
+;
+// Function to increase game score and update score label
+var gridSpeed = .5;
+//Game size 2048x2732
+/*
+Todo:
+[X] Make sure we GC nodes that drop of screen
+[ ] Make preview line fade out at the end
+*/
+var bulletsFired = 0; //3*30+1
+var bubbleSize = 150;
+var gameIsStarted = false;
+var bubbleColors = [0xff2853, 0x44d31f, 0x5252ff, 0xcb2bff, 0x28f2f0, 0xffc411];
+var barriers = [];
+var maxSelectableBubble = 3;
+var warningLines = [];
+for (var a = 0; a < 13; a++) {
+ var wl = game.addChild(new WarningLine());
+ wl.x = 2048 / 13 * (a + .5);
+ wl.y = 2200;
+ wl.alpha = 0;
+ warningLines.push(wl);
+ wl.scale.set(16, 40);
+}
+var warningOverlay = game.attachAsset('dangeroverlay', {});
+warningOverlay.y = 2280;
+for (var a = 0; a < 4; a++) {
+ for (var b = 0; b < 3; b++) {
+ var barrier = game.addChild(new Barrier());
+ barrier.y = 2732 - 450 + b * 70;
+ barrier.x = 2048 / 5 * a + 2048 / 5;
+ barriers.push(barrier);
+ }
+ var barrierBlock = game.attachAsset('barrierblock', {});
+ barrierBlock.x = 2048 / 5 * a + 2048 / 5;
+ barrierBlock.y = 2732 - 450;
+ barrierBlock.anchor.x = .5;
+}
+// Create a score label
+var scoreLabel = new Text2('0', {
+ size: 120,
+ fill: "#ffffff",
+ stroke: "#000000",
+ strokeThickness: 15,
+ font: "Impact"
+});
+scoreLabel.anchor.set(0.5, 0);
+LK.gui.top.addChild(scoreLabel);
+var scoreMultipliers = [];
+var baseScores = [100, 250, 500, 250, 100];
+for (var a = 0; a < 5; a++) {
+ var sm = new ScoreMultipliers(baseScores[a]);
+ sm.x = 2048 / 5 * a + 2048 / 10;
+ sm.y = 2300;
+ scoreMultipliers.push(sm);
+ game.addChild(sm);
+}
+var bonusUX = game.addChild(new BonusUX());
+var fireBallPowerupOverlay = game.addChild(new FireBallPowerupOverlay());
+var particlesLayer = game.addChild(new Container());
+var grid = game.addChild(new Grid());
+grid.y = 1000;
+var freeBubbleLayer = game.addChild(new Container());
+var hintBubblePlayer = game.addChild(new Container());
+var launcher = game.addChild(new Launcher());
+launcher.x = game.width / 2;
+launcher.y = game.height - 180;
+var hintBubbleCache = [];
+var hintBubbles = [];
+var isValid = false;
+var path = [];
+var bubbleAlpha = 1;
+var hintTargetX = 0;
+var hintTargetY = 0;
+game.move = function (x, y, obj) {
+ hintTargetX = x;
+ hintTargetY = y;
+ refreshHintLine();
+ // }
+};
+var hintOffset = 0;
+var distanceBetweenHintbubbles = 100;
+game.update = function () {
+ hintOffset += 5;
+ if (isValid) {
+ bubbleAlpha = Math.min(bubbleAlpha + .05, 1);
+ } else {
+ bubbleAlpha = Math.max(bubbleAlpha - .05, 0);
+ }
+ refreshHintLine();
+ var alphaList = grid.calculateWarningScoreList();
+ for (var a = 0; a < warningLines.length; a++) {
+ var value = alphaList[a] / 3;
+ warningLines[a].alpha += (Math.min(value, .4) - warningLines[a].alpha) / 100;
+ warningLines[a].scale.y += (value * 60 - warningLines[a].scale.y) / 100;
+ }
+};
+game.up = function () {
+ if (isValid) {
+ launcher.fire();
+ }
+};
+;
+;
+;
+;
+;
+;
+;
+;
+;
+;
;
\ No newline at end of file
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.