Code edit (23 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: 'targetX = this.rocherDestination.pushedByHuman.sprite.x; //La cible principale est le buldo allie poussant' Line Number: 685
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: 'TypeError: Cannot read properties of null (reading 'sprite')' in or related to this line: 'targetX = this.rocherDestination.pushedByOrdi.sprite.x; //La cible principale est le Buldo ordi poussant' Line Number: 667
Code edit (4 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: 'targetX = this.rocherDestination.pushedByOrdi.sprite.x; //La cible principale est le Buldo ordi poussant' Line Number: 667
Code edit (1 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: 'targetX = this.rocherDestination.pushedByOrdi.sprite.x; //La cible principale est le Buldo ordi poussant' Line Number: 673
Code edit (7 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: 'targetX = this.rocherDestination.pushedByOrdi.sprite.x; //La cible principale est le Buldo ordi poussant' Line Number: 673
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'dxHotLeftSpot')' in or related to this line: 'dxHotSpotR = this.rocherrocherDestinationPushed.dxHotLeftSpot; //Le point chaud est le point chaud du rocher' Line Number: 654
Code edit (1 edits merged)
Please save this source code
Code edit (11 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: 'var xTarget = this.rocherDestination.sprite.x - this.camp * this.dxAvHotSpot + this.camp * this.rocherDestination.dxHotLeftSpot; //Abscisse x du point chaud AV du rocher' Line Number: 627
Code edit (10 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: rocher is not defined' in or related to this line: 'this.setLigneHtoR(rocher);' Line Number: 526
Code edit (1 edits merged)
Please save this source code
Code edit (21 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: OrdiZone is not defined' in or related to this line: 'var outRight = this.sprite.x + this.dxHotLeftSpot >= OrdiZone.x; //L'abscisse du point chaud de gauche est superieur a l'abscisse de la zone ordi' Line Number: 377
User prompt
Please fix the bug: 'ReferenceError: scoreOrdiText is not defined' in or related to this line: 'scoreOrdiText.text = mettreAJourScore(scoreOrdiText, scoreOrdi);' Line Number: 781
User prompt
Please fix the bug: 'ReferenceError: scoreHumainText is not defined' in or related to this line: 'scoreHumainText.text = mettreAJourScore(scoreHumainText, scoreHumain);' Line Number: 776
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: buldorock_sprite is not defined' in or related to this line: 'buldos[i].sprite = buldorock_sprite;' Line Number: 681
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -611,9 +611,9 @@
}; //fin setLigneHtoR
this.checkPusher = function () {
//Choix de la cible : point chaud du rocher ou point chaud arriere du Buldo allie poussant
var targetX = this.rocherDestination.sprite.x; //Cible principale par defaut
- var dxHotSpotR = this.camp == humanCamp ? this.rocherDestination.dxHotLeftSpot : this.rocherDestination.dxHotRightSpot; //Point chaud du rocher par defaut
+ var dxHotSpotR = -this.camp * this.dxAvHotSpot + this.camp * this.rocherDestination.dxHotLeftSpot; //Abscisse x du point chaud AV du rocher
switch (this.rocherDestination.totalPushers) {
case 0:
//Deux cas possibles : zero pousseur ou un pousseur de chaque cote
if (this.rocherDestination.pushedByHuman != null && this.rocherDestination.pushedByOrdi != null) {
@@ -630,9 +630,9 @@
dxHotSpotR = this.rocherDestination.pushedByHuman.dxBkHotSpot; //Le point chaud est l'arriere du Buldo humain poussant
} else if (this.camp == humanCamp && this.rocherDestination.pushedByHuman == this) {
//Si le Buldo poussant le rocher est this
targetX = this.rocherDestination.sprite.x; //La cible principale est le rocher
- dxHotSpotR = this.rocherDestination.dxHotLeftSpot; //Le point chaud est le point chaud du rocher
+ dxHotSpotR = -this.camp * this.dxAvHotSpot + this.camp * this.rocherDestination.dxHotLeftSpot; //Le point chaud est le point chaud du rocher
} else if (this.camp == ordiCamp && this.rocherDestination.pushedByOrdi == null) {
//Si il n'y a pas encore de Buldo ordi poussant le rocher
targetX = this.rocherDestination.sprite.x; //La cible principale est le rocher
dxHotSpotR = this.rocherDestination.dxHotRightSpot; //Le point chaud est le point chaud du rocher
@@ -701,12 +701,13 @@
this.isMovingR = false; // on indique que le Buldo n'est plus en train de pousser un rocher
return;
}
if (this.isMovingR) {
- if (this.rocherDestination && this.rocherDestination.pushedByOrdi && this.rocherDestination.pushedByOrdi.sprite) {
- var xTarget = this.rocherDestination.pushedByOrdi.sprite.x; //La cible principale est le Buldo ordi poussant
+ // Ensure rocherDestination is not null before accessing its properties
+ if (this.rocherDestination && this.rocherDestination.sprite) {
+ var xTarget = this.checkPusher(); //Abscisse x du point chaud AV du rocher ou du point chaud arriere du Buldo allie poussant
} else {
- return; // Exit the function if rocherDestination or pushedByOrdi or its sprite is null
+ return; // Exit the function if rocherDestination or its sprite is null
}
var AD = dist(this.sprite.x, 0, xTarget, 0); //Distance entre l'abscisse du sprite et l'abscisse x destination
if (AD <= Math.abs(this.vitesseEnCours * delta)) {
// Si la distance entre l'abscisse du sprite et l'abscisse x destination est inférieure à la vitesse en cours, on arrête le déplacement
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.