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
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: this.setLigneVtoY is not a function' in or related to this line: 'this.setLigneVtoY(y); //On effectue le deplacement vertical' Line Number: 469
Code edit (10 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -337,10 +337,11 @@
//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, x, y); //Test mouvement Buldo
buldo.addMoveToStack(typeRotation, 90, 0); //Test rotation Buldo
- buldo.addMoveToStack(typeLigneVtoY, 0, y); //Test rotation Buldo
}
}
}; //fin onClickRocherBuldo
}); //fin class Rocher
@@ -451,9 +452,9 @@
this.setLigneHtoX(x); //On effectue le deplacement horizontal
break;
case typeLigneVtoY:
//Si le mouvement est un deplacement vertical, on effectue le deplacement
- this.deplaceVtoY(delta);
+ this.setLigneVtoY(delta);
break;
default:
break;
}
@@ -515,11 +516,40 @@
return;
}
}
}; // fin deplaceHtoX
+ this.setLigneVtoY = function (y) {
+ var AD = dist(0, this.sprite.y, 0, y);
+ var sensAngleBuldo = sensRotation(this.sprite.rotation * 180 / Math.PI % 360); //Sens de rotation du Buldo (1=horaire, -1=antihoraire) (0=horizontal
+ var HD = dist(0, this.sprite.y + sensAngleBuldo * this.dxAvHotSpot, 0, y);
+ if (AD < HD) {
+ return;
+ }
+ this.isMovingV = true; //on indique que le Buldo est en mouvement
+ this.yDestination = y; //le point d'ancrage doit s'arreter sur y pour faire une rotation
+ //Calcul du sens du deplacement verticale : 1=bas, -1=haut
+ this.vitesseEnCours = sensAngleBuldo * this.camp * this.vitessePS; //on indique la vitesse de deplacement en cours en pixels par secondes
+ }; //fin setLigneVtoY
+ this.deplaceVtoY = function (delta) {
+ // Vérifie si le Buldo est en mouvement
+ if (this.isMovingV) {
+ var AD = dist(0, this.sprite.y, 0, this.yDestination);
+ if (AD <= Math.abs(this.vitesseEnCours * delta)) {
+ // Si la distance entre l'ordonnee du sprite et l'ordonnee y destination est inférieure à la vitesse en cours, on arrête le déplacement
+ this.sprite.y = this.yDestination; // on donne à l'ordonnée du sprite la valeur y destination
+ this.isMovingV = false; // on indique que le Buldo n'est plus en mouvement
+ return;
+ } else {
+ // Sinon on déplace le sprite verticalement
+ // Déplacement du sprite
+ this.sprite.y += this.vitesseEnCours * delta;
+ return;
+ }
+ }
+ }; // fin deplaceVtoY
}); //fin constructor
function sensRotation(angleDegres) {
- //03/03/2024
+ //03/03/2024//entre 0 et 180: 1, entre 180 et 360: -1, 0:0
var sens = Math.sin(angleDegres * Math.PI / 180);
var signeSens = sens > 0 ? 1 : sens < 0 ? -1 : 0;
return signeSens;
} //fin sensRotation
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.