Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'levelNameLabel is not defined' in or related to this line: 'if (Math.random() < 0.12) {' Line Number: 403
User prompt
Please fix the bug: 'levelNameLabel is not defined' in or related to this line: 'levelNameLabel.setText(a.name, ' ', a.uid);' Line Number: 984
Code edit (9 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading '0')' in or related to this line: 'var n = source[0].length;' Line Number: 1219
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'length')' in or related to this line: 'var m = source.length;' Line Number: 1218
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading '0')' in or related to this line: 'var gridSize = currentLevel.d.length;' Line Number: 1087
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading '0')' in or related to this line: 'for (var j = 0; j < a.d[0].length; j++) {' Line Number: 965
User prompt
Please fix the bug: 'levels[currentLevelID].map is not a function' in or related to this line: 'for (var i = 0; i < a.d.length; i++) {' Line Number: 964
User prompt
Please fix the bug: 'levels[currentLevelID].map is not a function' in or related to this line: 'var currentLevel = levels[currentLevelID].map(function (arr) {' Line Number: 935
Code edit (1 edits merged)
Please save this source code
Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot set properties of undefined (setting 'tint')' in or related to this line: 'self.boxGraphics.tint = 0x222222;' Line Number: 152
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot set properties of undefined (setting 'tint')' in or related to this line: 'self.boxGraphics.tint = 0xffffff;' Line Number: 146
Code edit (1 edits merged)
Please save this source code
Code edit (21 edits merged)
Please save this source code
User prompt
Please fix the bug: 'instructions is not defined' in or related to this line: 'game.addChild(instructions);' Line Number: 761
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: particleGraphics.setScale is not a function' in or related to this line: 'particleGraphics.setScale(sc, sc);' Line Number: 314
Code edit (1 edits merged)
Please save this source code
Code edit (13 edits merged)
Please save this source code
User prompt
please make the particles move upwards in a wavy pattern instead of straight like now. Use individual amplitude for particles so they don't all move exactly the same.
User prompt
Please fix the bug: 'ReferenceError: particleGraphicsGraphics is not defined' in or related to this line: 'self.addChild(particleGraphicsGraphics);' Line Number: 313
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'if (self.particles.length < self.particlesMax) {' Line Number: 329
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -229,13 +229,15 @@
};
});
var Firework = Container.expand(function () {
var self = Container.call(this);
- var starGraphics = self.attachAsset('star', {
+ //var starGraphics = self.attachAsset('star', {
+ var starGraphics = self.attachAsset('particle', {
anchorX: 0.5,
anchorY: 0.5,
tint: Math.random() * 0xffffff
});
+ starGraphics.scale.set(2, 2);
self.addChild(starGraphics);
self.x = 0;
self.y = 0;
self.dx = 15 - Math.random() * 30;
@@ -253,8 +255,26 @@
self.isDead = true;
}
};
});
+var HelpButton = Container.expand(function () {
+ var self = Container.call(this);
+ var arrowGraphics = self.attachAsset('helpButton', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.down = function () {
+ showInstructions();
+ };
+});
+var InstructionsScreen = Container.expand(function () {
+ var self = Container.call(this);
+ var arrowGraphics = self.attachAsset('levelCompleteBg', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ alpha: 0.75
+ });
+});
var LevelComplete = Container.expand(function () {
var self = Container.call(this);
var bgGraphics = self.attachAsset('levelCompleteBg', {
anchorX: 0.5,
@@ -281,9 +301,10 @@
var Particle = Container.expand(function () {
var self = Container.call(this);
var particleGraphics = self.attachAsset('particle', {
anchorX: 0.5,
- anchorY: 0.5
+ anchorY: 0.5,
+ alpha: 0.5 + Math.random() * 0.5
//tint: Math.random() * 0xffffff
});
var sc = 1 + Math.random() * 1;
particleGraphics.scale.set(sc, sc);
@@ -292,9 +313,10 @@
var speedY = 2 + Math.random() * 5;
self.update = function () {
if (self.y > 0) {
self.y -= speedY;
- self.x += Math.sin(self.y / amplitude) * 5; // Wavy movement
+ self.x += Math.sin(self.y / amplitude) * 10; // Wavy movement
+ self.x -= self.parent.wind;
} else {
self.x = Math.random() * 2048;
self.y = 2732;
amplitude = 50 + Math.random() * 100;
@@ -303,12 +325,14 @@
});
var ParticleContainer = Container.expand(function () {
var self = Container.call(this);
self.particles = [];
- self.particlesMax = 30;
+ self.particlesMax = 50;
+ self.wind = 0;
self.update = function () {
+ self.wind += Math.sin(LK.ticks) * 1;
if (self.particles.length < self.particlesMax) {
- if (Math.random() < 0.02) {
+ if (Math.random() < 0.12) {
var p = new Particle();
p.x = Math.random() * 2048;
p.y = 2732;
self.particles.push(p);
@@ -532,8 +556,12 @@
y: 300,
tint: 0x22ddff
});
game.addChild(gameLogo);
+var helpButton = new HelpButton();
+helpButton.x = 2048 - 150;
+helpButton.y = 2732 - 150;
+game.addChild(helpButton);
// Create and position the score label
var scoreLabel = new Text2('Score\n0', {
size: 60,
fill: 0xFFFFFF,
@@ -694,8 +722,29 @@
}
}
}
paintLevel(currentLevel);
+if (!storage.instructionsShown) {
+ storage.instructionsShown = true;
+ showInstructions();
+}
+;
+var instructionsScreen = new InstructionsScreen();
+instructionsScreen.x = 3000;
+instructionsScreen.alpha = 0;
+var instructions = new InstructionsScreen();
+game.addChild(instructions);
+function showInstructions() {
+ if (instructionsScreen.alpha == 0) {
+ instructionsScreen.x = 1024;
+ instructionsScreen.y = boardCenterY;
+ instructionsScreen.alpha = 1;
+ } else {
+ instructionsScreen.alpha = 0;
+ instructionsScreen.x = 3000;
+ }
+}
+;
// Click handler
game.down = function (x, y, obj) {
//board.scale.x *= 1.2;
//board.scale.y *= 1.2;
A large calm background drawing for a puzzle game, in dark calm blueish colors and non-confusing content. High definition. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A quadratic polished dark blue marble slate. Front perspective with right angles. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A white question mark in a circle, like for a help button in a game.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A white X in a circle, like for a close window button in a game. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A white questionmark on a black background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A green check mark on a dark background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.