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
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'create')' in or related to this line: 'var popup = LK.Popup.create();' Line Number: 247
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 (1 edits merged)
Please save this source code
Code edit (5 edits merged)
Please save this source code
User prompt
create a function that display a popup with title "Congratulations !" and a button "Next level".
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot set properties of undefined (setting 'x')' in or related to this line: 'player.ball1.x = self.pathSteps[0].x;' Line Number: 170
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot set properties of undefined (setting 'x')' in or related to this line: 'player.ball1.x = self.pathSteps[0].x;' Line Number: 169
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -32,8 +32,9 @@
});
});
var Path = Container.expand(function (level) {
var self = Container.call(this);
+ LK.setScore(level);
self.level = level;
self.levels = [
// level 0
[{
@@ -226,8 +227,13 @@
}
if (!(onStep1 && onStep2)) {
LK.showGameOver();
} else {
+ var starFX = new StarFX();
+ starFX.x = path.pathSteps[smallPathStep].x;
+ starFX.y = path.pathSteps[smallPathStep].y;
+ game.addChild(starFX);
+ starFX.playFX();
path.removeChild(path.pathSteps[smallPathStep]);
path.pathSteps.splice(smallPathStep, 1);
path.nextStep();
if (path.pathSteps.length == 1) {
@@ -242,8 +248,18 @@
ball2.rotateAround(ball1);
}
};
});
+var StarFX = Container.expand(function () {
+ var self = Container.call(this);
+ self.attachAsset('starFX', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.playFX = function () {
+ // Add code here to play the star effect
+ };
+});
/****
* Initialize Game
****/
@@ -253,17 +269,16 @@
/****
* Game Code
****/
-// Initialize background stars
-// Initialize obstacle asset
// Initialize player ship asset
+// Initialize obstacle asset
+// Initialize background stars
function showCongratsPopup() {
/*var popup = new LK.Popup();
popup.setTitle('Congratulations !');
var nextLevelButton = new LK.Button('Next level');
nextLevelButton.on('down', function () {*/
- /*popup.close();*/
// Add code here to go to the next level
game.removeChild(path);
game.removeChild(player);
path = new Path(path.level + 1);
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.