Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: game.playSound is not a function' in or related to this line: 'game.playSound(rock_appears);' Line Number: 959
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: self is undefined' in or related to this line: 'rocher.sprite = self.rocher_split_sprite;' Line Number: 1160
Code edit (16 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: rocher_split_sprite is not defined' in or related to this line: 'rocher.sprite = rocher_split_sprite;' Line Number: 1159
Code edit (1 edits merged)
Please save this source code
Code edit (9 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: animatinImageOn is not defined' in or related to this line: 'if (!animatinImageOn) {' Line Number: 1221
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: coupeVictoire is not defined' in or related to this line: 'var imageCoupeVictoire = {' Line Number: 856
Code edit (13 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: Score is not defined' in or related to this line: 'imageCoupeVictoire.yToReach = Score;' Line Number: 1236
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: nbTicksLeft is not defined' in or related to this line: 'nbTicksLeft = scrollRescaleImage(coupeVictoire, 1, game.width / 2, game.height / 2, nbTicksLeft);' Line Number: 1182
Code edit (1 edits merged)
Please save this source code
Code edit (22 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: victoireX is not defined' in or related to this line: 'var coupeVictoire = LK.getAsset('coupeVictoire', {' Line Number: 842
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: rocher_petit_sprite is not defined' in or related to this line: 'self.sprite = rocher_petit_sprite;' Line Number: 327
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: rocher_moyen_sprite is not defined' in or related to this line: 'self.sprite = rocher_moyen_sprite;' Line Number: 330
Code edit (11 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -189,11 +189,11 @@
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
-var nbManches = 2; //nombre de manches
+var nbManches = 3; //nombre de manches
var nbManchesRestantes = nbManches; //nombre de manches restantes
-var nbRochers = 2; //nombre de rochers
+var nbRochers = 5; //nombre de rochers
var nbRochersRestants = nbRochers; //nombre de rochers restants
var nbBuldoRocks = 0; //nombre de buldoRocks
var nbBuldoZers = 0; //nombre de buldoZers
var delta = 1; //Heritage des tests en PixiJS
@@ -233,8 +233,10 @@
var typeLigneHtoR = 4; //Type 4 = déplacement horizontal vers un rocher
var gameHasStarted = false; //Flag qui indique si le jeu a commence (premiers clics buldo puis rocher)
var activeCamp = 0; //Camp selectionne par le joueur
var lastActiveCamp = 0; //Camp selectionne dans la manche precedente pour garde le meme camp
+var nbManchesHumain = 0; //nombre de manches gagnees par le joueur humain
+var nbManchesOrdi = 0; //nombre de manches gagnees par le joueur ordinateur
var humanCamp = 1; //camp du joueur humain
var ordiCamp = -1; //camp du joueur ordinateur
var scoreHumain = 0;
var scoreOrdi = 0;
@@ -849,10 +851,10 @@
// Création d'une nouvelle instance de coupeVictoire à chaque appel de la fonction
var coupeVictoire = LK.getAsset('coupeVictoire', {
anchorX: 0.5,
anchorY: 0,
- scaleX: 4,
- scaleY: 4,
+ scaleX: 6,
+ scaleY: 6,
x: victoireX,
y: victoireY
});
var imageCoupeVictoire = {
@@ -874,9 +876,8 @@
if (imagesToScrollRescale[i].animate) {
if (imagesToScrollRescale[i].nbTicksLeft == 0) {
//On retire l'image du tableau si le nombre de ticks est nul
imagesToScrollRescale.splice(i, 1);
- animatingImageOn = false;
} else {
var x = imagesToScrollRescale[i].image.x;
var y = imagesToScrollRescale[i].image.y;
var scale = imagesToScrollRescale[i].image.scale.x;
@@ -1052,9 +1053,9 @@
fill: "#00ff00",
anchorX: 0.5,
anchorY: 0
});
-//LK.gui.top.addChild(scoreTestText);
+LK.gui.top.addChild(scoreTestText);
// Instead of directly calling checkMovesStack, iterate over buldos and call checkMovesStack for each --> already doing this
LK.on('tick', function () {
//Lancement du jeu : choix des rochers a pousser pour l'ordinateur
//Si le camp actif est selectionne (-1, 1), mais que la partie n'a pas encore commence (gameHasStarted = false):
@@ -1194,29 +1195,31 @@
}
//Mise à jour des scores
updateScoreHumain(scoreHumain);
updateScoreOrdi(scoreOrdi);
- //updateScoreTest(scoreTest);
+ updateScoreTest(scoreTest);
//Animation des images dont victoire
scrollRescaleImages();
//Fin de partie
if (nbRochersRestants <= 0) {
if (scoreHumain >= scoreOrdi) {
if (!animatingImageOn) {
- var imageCoupeVictoire = afficheVictoire(humanCamp, game.width / 2, game.height / 2);
- imageCoupeVictoire.xToReach = game.width / 2 - nbManchesRestantes * game.width / 8;
+ nbManchesHumain += 1;
+ var imageCoupeVictoire = afficheVictoire(humanCamp, nbManchesHumain * game.width / 3, game.height / 3);
+ imageCoupeVictoire.xToReach = game.width / 4;
imageCoupeVictoire.yToReach = ScoreZone.y;
- imageCoupeVictoire.nbTicksLeft = 60;
+ imageCoupeVictoire.nbTicksLeft = 80;
imageCoupeVictoire.animate = true;
imagesToScrollRescale.push(imageCoupeVictoire);
animatingImageOn = true;
}
} else {
if (!animatingImageOn) {
- var imageCoupeVictoire = afficheVictoire(ordiCamp);
- imageCoupeVictoire.xToReach = game.width / 2 + nbManchesRestantes * game.width / 8;
+ nbManchesOrdi += 1;
+ var imageCoupeVictoire = afficheVictoire(ordiCamp, game.width - nbManchesOrdi * game.width / 3, game.height / 3);
+ imageCoupeVictoire.xToReach = game.width / 2 + game.width / 4;
imageCoupeVictoire.yToReach = ScoreZone.y;
- imageCoupeVictoire.nbTicksLeft = 50;
+ imageCoupeVictoire.nbTicksLeft = 80;
imageCoupeVictoire.animate = true;
imagesToScrollRescale.push(imageCoupeVictoire);
animatingImageOn = true;
}
@@ -1230,18 +1233,23 @@
}
});
}
if (allBack) {
+ scoreTest = nbManchesRestantes;
nbManchesRestantes -= 1;
- if (nbManchesRestantes > 0) {
+ if (nbManchesRestantes > 0 || nbManchesRestantes + nbManchesHumain < nbManchesOrdi || nbManchesRestantes + nbManchesOrdi < nbManchesHumain) {
rochers = generateRandomRock(nbRochers);
nbRochersRestants = nbRochers;
activeCamp = 0;
gameHasStarted = false;
scoreHumain = 0;
scoreOrdi = 0;
+ animatingImageOn = false;
} else {
- LK.showGameOver();
+ var imageCoupeVictoire = nbManchesHumain >= nbManchesOrdi ? afficheVictoire(humanCamp, game.width / 4, game.height / 3) : afficheVictoire(ordiCamp, 3 * game.width / 4, game.height / 3);
+ LK.setTimeout(function () {
+ LK.showGameOver();
+ }, 3000);
}
}
}
});
\ No newline at end of file
A small rock
a rock without any shadow and four time smaller than the original.
Blue color
a rock is being crunched so there is smoke and peaces of rocks viewed from top.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Un trophée de victoire sous forme d'une coupe d'où s'échappe un feu d'artifice.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Red bulldozer viewed strictly from top. Top view as if we are a drone.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Remove yellow lines.