Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'forEach')' in or related to this line: 'buldos.forEach(function (buldoCheck) {' Line Number: 341
Code edit (17 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of null (reading 'sprite')' in or related to this line: 'buldo.sprite.tint = 0xFFFFFF; //on enleve le filtre coloré' Line Number: 342
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: checkMovesStack is not defined' in or related to this line: 'LK.on('tick', checkMovesStack(delta)); //Verification des mouvements en cours' Line Number: 578
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'bind')' in or related to this line: 'buldos[i].sprite.on('down', this.onClickBuldo.bind(buldos[i], buldos));' Line Number: 474
User prompt
Please fix the bug: 'Uncaught ReferenceError: onClickBuldo is not defined' in or related to this line: 'buldos[i].sprite.on('down', onClickBuldo(buldos));' Line Number: 474
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 TypeError: Cannot set properties of undefined (setting 'onClickBuldo')' in or related to this line: 'self.onClickBuldo = function (buldos) {' Line Number: 388
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: OrdiZone is not defined' in or related to this line: 'var buldoZer1 = new Buldo(OrdiZone.x + OrdiZone.width / 2, OrdiZone.y + OrdiZone.height / 3, ordiCamp);' Line Number: 425
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: dxHotSpot is not defined' in or related to this line: 'this.dxAvHotSpot = dxHotSpot; //Offset du point chaud du sprite (point de contact avec le rocher) décalage par rapport au point d'ancrage' Line Number: 353
Code edit (7 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: 'this.sprite.x = x;' Line Number: 336
User prompt
Please fix the bug: 'Uncaught ReferenceError: sprite is not defined' in or related to this line: 'this.sprite = sprite;' Line Number: 335
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: self.attachAsset is not a function' in or related to this line: 'var rocher_gros_sprite = self.attachAsset('large_rock', {' Line Number: 230
User prompt
Please fix the bug: 'Uncaught TypeError: self.attachAsset is not a function' in or related to this line: 'var rocher_moyen_sprite = self.attachAsset('medium_rock', {' Line Number: 226
User prompt
Please fix the bug: 'Uncaught TypeError: self.attachAsset is not a function' in or related to this line: 'var rocher_petit_sprite = self.attachAsset('small_rock', {' Line Number: 222
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: _this is not defined' in or related to this line: 'var rocher_petit_sprite = _this.attachAsset('small_rock', {' Line Number: 222
===================================================================
--- original.js
+++ change.js
@@ -325,23 +325,22 @@
var y = this.sprite.y;
this.sprite.tint = 0xF0D0E0; //on ajoute un filtre coloré
//Parcours de la liste des buldos pour trouver le buldo selectionne
var buldo = null;
- for (var i = 0; i < buldos.length; i++) {
- if (buldos[i]) {
- buldos[i].sprite.tint = 0xFFFFFF; //on enleve le filtre coloré
+ buldos.forEach(function (buldoCheck) {
+ if (buldoCheck != null) {
+ buldoCheck.sprite.tint = 0xFFFFFF; //on enleve le filtre coloré
+ if (buldoCheck.isSelected) {
+ buldo = buldoCheck;
+ }
}
- if (buldos[i].isSelected) {
- buldo = buldos[i];
- break;
- }
- }
+ });
//Si le buldo selectionne est trouve, on le deplace vers le sprite rocher
if (buldo != null && !buldo.isMoving) {
x = buldo.camp == humanCamp ? x + this.dxHotLeftSpot : x + this.dxHotRightSpot;
y = buldo.camp == humanCamp ? y + this.dyHotLeftSpot : y + this.dyHotRightSpot;
buldo.rocherDestination = this; //Le buldo a pour destination le sprite rocher cliqué
- buldo.addMoveToStack(typeLigneHtoX, 1000, y); //Test mouvement Buldo
+ buldo.addMoveToStack(typeLigneHtoX, x, y); //Test mouvement Buldo
}
}; //fin onClickRocherBuldo
}); //fin class Rocher
var Buldo = /*#__PURE__*/_createClass2(function Buldo(x, y, camp) {
@@ -557,9 +556,9 @@
rochers.push(rock);
}
//On ajoute les evenements de clic sur les sprites rocher
for (var i = 0; i < rochers.length; i++) {
- rochers[i].sprite.on('down', rochers[i].onClickRocherBuldo.bind(rochers[i], rochers));
+ rochers[i].sprite.on('down', rochers[i].onClickRocherBuldo.bind(rochers[i], buldos));
}
;
return rochers;
} //fin generateRandomRock
@@ -611,8 +610,10 @@
// Autres mises à jour du jeu ici en cours de test..
}
// Instead of directly calling checkMovesStack, iterate over buldos and call checkMovesStack for each
LK.on('tick', function () {
- buldos.forEach(function (buldo) {
- buldo.checkMovesStack(delta);
- });
+ if (buldos) {
+ buldos.forEach(function (buldo) {
+ buldo.checkMovesStack(delta);
+ });
+ }
});
\ 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.