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
@@ -263,9 +263,10 @@
});
var label = new Text2('Level Cleared!', {
size: 100,
fill: 0xdddddd,
- align: 'center'
+ align: 'center',
+ font: 'Georgia'
});
label.anchor.set(0.5, 0.5);
label.x = 0;
label.y = -100;
@@ -276,8 +277,42 @@
self.addChild(firework);
stars.push(firework);
}
});
+var Particle = Container.expand(function () {
+ var self = Container.call(this);
+ var particleGraphics = self.attachAsset('particle', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ //tint: Math.random() * 0xffffff
+ });
+ self.addChild(particleGraphicsGraphics);
+ var amplitude = 5 + Math.random() * 10;
+ self.update = function () {
+ if (self.y > 0) {
+ self.y--;
+ } else {
+ self.x = Math.random() * 2048;
+ self.y = 2732;
+ }
+ };
+});
+var ParticleContainer = Container.expand(function () {
+ var self = Container.call(this);
+ self.particles = [];
+ self.particlesMax = 30;
+ self.update = function () {
+ if (self.particles.length < self.particlesMax) {
+ if (Math.random() < 0.02) {
+ var p = new Particle();
+ p.x = Math.random() * 2048;
+ p.y = 2732;
+ self.particles.push(p);
+ self.addChild(p);
+ }
+ }
+ };
+});
var Star = Container.expand(function (startX, startY, endX, endY, delay, boxTint) {
var self = Container.call(this);
//GoldCoin.delayIncrement = 0;
//self.game = this;
@@ -488,16 +523,18 @@
var gameLogo = LK.getAsset('gameLogo', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
- y: 300
+ y: 300,
+ tint: 0x22ddff
});
game.addChild(gameLogo);
// Create and position the score label
var scoreLabel = new Text2('Score\n0', {
size: 60,
fill: 0xFFFFFF,
- align: 'center'
+ align: 'center',
+ font: 'Georgia'
});
scoreLabel.anchor.set(1, 0); // Anchor to the right
scoreLabel.x = 2048 - 50; // Position near the right edge
scoreLabel.y = 140; //50; // Position at the top
@@ -506,9 +543,10 @@
// Create and position the high score label
var highScoreLabel = new Text2('Best\n0', {
size: 50,
fill: 0xdddddd,
- align: 'center'
+ align: 'center',
+ font: 'Georgia'
});
highScoreLabel.anchor.set(1, 0); // Anchor to the right
highScoreLabel.x = 2048 - 75; // Position near the right edge
highScoreLabel.y = 300; //220; // Position below the score label
@@ -518,10 +556,9 @@
size: 60,
//120,
fill: 0xFFFFFF,
align: 'center',
- font: 'Garamond',
- weight: 800
+ font: 'Georgia'
});
//levelLabel.anchor.set(0.5, 0.5);
levelLabel.anchor.set(1, 0);
levelLabel.x = 2048 - 30; // Position near the right edge
@@ -539,8 +576,10 @@
return tileSize;
console.log(tileSize);
}
var tileSize = calculateTileSize();
+var particleContainer = new ParticleContainer();
+game.addChild(particleContainer);
var board = new Board();
board.x = 1024;
board.y = boardCenterY; //2732 / 2 + 200;
game.addChild(board);
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.