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
@@ -318,8 +318,9 @@
}
}); //fin class Rocher
var Buldo = /*#__PURE__*/_createClass2(function Buldo(x, y, camp) {
_classCallCheck2(this, Buldo);
+ var self = this; // Ensure 'self' is defined to refer to the Buldo instance
this.name = "buldo";
this.camp = camp; //Camp du buldo (1=Human buldoRock ou 2=Ordi buldoZer)
this.isSelected = false; //Flag qui indique si le Buldo est selectionne
var buldorock_sprite = game.addChild(LK.getAsset('bulldorock', {
@@ -372,8 +373,30 @@
this.angleDegresTotal = 0.0; //Angle total a tourner en degres
this.angleRadiansLeft = 0.0; //Angle restant a tourner en radians
this.vitesseAngulaireDS = 2.0; //vitesse de rotation du sprite en degres par secondes
this.vitesseAngulaireRms = 0.0; //vitesse angulaire en radians par millisecondes
+ self.onClickBuldo = function (buldos) {
+ //On commence par deselectionne tous les sprites Buldo
+ for (var i = 0; i < buldos.length; i++) {
+ if (buldos[i].name != this.name) {
+ buldos[i].isSelected = false;
+ buldos[i].sprite.tint = 0xFFFFFF; //on enleve le filtre coloré
+ }
+ }
+ //Gestion du clic sur le sprite Buldo
+ if (this.isSelected) {
+ //Si le sprite est deja selectionne, on le deselectionne
+ this.isSelected = false;
+ this.sprite.tint = 0xFFFFFF; //on enleve le filtre coloré
+ } else {
+ //Sinon on le selectionne s'il n'est pas en mouvement ou en rotation
+ var isNotMoving = !this.isRotating && !this.isMovingH && !this.isMovingV && !this.isMovingXY;
+ if (isNotMoving) {
+ this.isSelected = true;
+ this.sprite.tint = 0xD00D0D; //on ajoute un filtre coloré
+ }
+ }
+ }; //fin onClickBuldo
}); //fin constructor
function generateRandomRock(nombreRochers) {
//Calcul de positions aléatoire pour les rochers dans la zone de route
var zoneMiniy = RoadZone.y;
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.