Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: startFX is not defined' in or related to this line: 'startFX.direction = i;' Line Number: 276
Code edit (1 edits merged)
Please save this source code
User prompt
the starFX should have a direction and move to that direction.
Code edit (3 edits merged)
Please save this source code
User prompt
when a path step disapear, 5 stars should goes from it in every directions.
Code edit (13 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: iffX is not defined' in or related to this line: 'return iffX * diffX + diffY * diffY <= 100;' Line Number: 298
Code edit (1 edits merged)
Please save this source code
User prompt
the startfx playfx function should start a timer which increase each 10 milliseconds the scale and decrease the alpha of the startfx.
User prompt
each time the player successfully goes to the next path step, a star FX should be displayed around the path step.
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading '0')' in or related to this line: 'if (self.pathPositions[0]) {' Line Number: 191
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'if (self.curStep < self.pathPositions.length) {' Line Number: 181
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'if (self.curStep < self.pathPositions.length) {' Line Number: 178
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'x')' in or related to this line: 'player.init(self.pathPositions[0].x, self.pathPositions[0].y);' Line Number: 176
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: popup is not defined' in or related to this line: 'popup.close();' Line Number: 251
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: LK.Popup is not a constructor' in or related to this line: 'var popup = new LK.Popup();' Line Number: 247
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: LK.createPopup is not a function' in or related to this line: 'var popup = LK.createPopup();' Line Number: 247
User prompt
Please fix the bug: 'TypeError: LK.Popup is not a function' in or related to this line: 'var popup = LK.Popup();' Line Number: 247
===================================================================
--- original.js
+++ change.js
@@ -33,10 +33,13 @@
});
var Path = Container.expand(function (level) {
var self = Container.call(this);
self.level = level;
- self.pathSteps = [];
- self.pathPositions = [{
+ self.levels = [
+ // level 0
+ [],
+ // level 1
+ [{
x: 1024,
y: 2400
}, {
x: 1024,
@@ -55,84 +58,86 @@
y: 1800
}, {
x: 1224,
y: 1800
- } /*, {
+ }, {
x: 1424,
y: 1800
- }, {
+ }, {
x: 1424,
y: 2000
- }, {
+ }, {
x: 1424,
y: 2200
- }, {
+ }, {
x: 1624,
y: 2200
- }, {
+ }, {
x: 1824,
y: 2200
- }, {
+ }, {
x: 1824,
y: 2000
- }, {
+ }, {
x: 1824,
y: 1800
- }, {
+ }, {
x: 1824,
y: 1600
- }, {
+ }, {
x: 1824,
y: 1400
- }, {
+ }, {
x: 1824,
y: 1200
- }, {
+ }, {
x: 1624,
y: 1200
- }, {
+ }, {
x: 1424,
y: 1200
- }, {
+ }, {
x: 1224,
y: 1200
- }, {
+ }, {
x: 1024,
y: 1200
- }, {
+ }, {
x: 824,
y: 1200
- }, {
+ }, {
x: 624,
y: 1200
- }, {
+ }, {
x: 624,
y: 1000
- }, {
+ }, {
x: 624,
y: 800
- }, {
+ }, {
x: 624,
y: 600
- }, {
+ }, {
x: 624,
y: 400
- }, {
+ }, {
x: 624,
y: 200
- }, {
+ }, {
x: 824,
y: 200
- }, {
+ }, {
x: 1024,
y: 200
- }, {
+ }, {
x: 1224,
y: 200
- }, {
+ }, {
x: 1424,
y: 200
- }*/];
+ }]];
+ self.pathSteps = [];
+ self.pathPositions = self.levels[self.level];
self.addPathStep = function (position) {
var step;
if (self.curStep == 0) {
step = self.addChild(new FirstPathStep());
@@ -156,9 +161,13 @@
self.curStep = 0;
for (var i = 0; i < 10; i++) {
self.nextStep();
}
- player.init(self.pathPositions[0].x, self.pathPositions[0].y);
+ if (self.pathPositions[0]) {
+ player.init(self.pathPositions[0].x, self.pathPositions[0].y);
+ } else {
+ console.error('Path positions not defined');
+ }
};
});
var PathStep = Container.expand(function () {
var self = Container.call(this);
@@ -241,9 +250,9 @@
/*popup.close();*/
// Add code here to go to the next level
game.removeChild(path);
game.removeChild(player);
- path = new Path();
+ path = new Path(path.level + 1);
path.setupPlayer(player);
game.addChild(path);
game.addChild(player);
/*});
@@ -256,9 +265,9 @@
x: 1024,
y: 1366
}));
var player = new Player();
-var path = new Path();
+var path = new Path(0);
game.addChild(path);
game.addChild(player);
path.setupPlayer(player);
game.on('down', function (obj) {
tête de mort rouge. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
tête de mort coter droit en bleu coter gauche en rouge. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
tourbillon bleu et rouge. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
bone. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
tourbillon rouge et bleu. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.