User prompt
Please fix the bug: 'TypeError: Cannot read properties of null (reading 'pushedByOrdi')' in or related to this line: 'if (this.camp == humanCamp && this.rocherDestination.pushedByHuman != this) {' Line Number: 655
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of null (reading 'pushedByHuman')' in or related to this line: 'if (this.rocherPushed.pushedByHuman == null && this.rocherPushed.pushedByOrdi == null) {' Line Number: 641
Code edit (8 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of null (reading 'pushedByOrdi')' in or related to this line: 'if (this.camp == humanCamp && this.rocherDestination.pushedByHuman != this) {' Line Number: 649
User prompt
Please fix the bug: 'TypeError: Cannot read properties of null (reading 'pushedByOrdi')' in or related to this line: 'if (this.camp == humanCamp && this.rocherDestination.pushedByHuman != this) {' Line Number: 649
Code edit (8 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: 664
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: 664
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.pushedByHuman.sprite.x; //La cible principale est le buldo allie poussant' Line Number: 685
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
===================================================================
--- original.js
+++ change.js
@@ -185,9 +185,9 @@
}
}
var nbRochers = 10; //nombre de rochers
var delta = 1;
-var vitesseBuldo = 8.0; //vitesse de déplacement des buldos a vide, vitesse/2 quand ils poussent un petit rocher, vitesse/4 pour un moyen, vitesse/8 pour un gros
+var vitesseBuldo = 2.0; //vitesse de déplacement des buldos a vide, vitesse/2 quand ils poussent un petit rocher, vitesse/4 pour un moyen, vitesse/8 pour un gros
var humanCamp = 1; //camp du joueur humain
var ordiCamp = -1; //camp du joueur ordinateur
var ancrageMedian = 0.5; //ancrage median des sprites
var buldoRockHotSpotX = 45; //hotspot X du sprite buldoRock, offset du sprite par rapport à l'ancrage
@@ -345,11 +345,11 @@
buldo.addMoveToStack(typeRotation, sens * 90, 0); //Test rotation Buldo
buldo.addMoveToStack(typeLigneVtoY, 0, y); //Test mouvement Buldo
buldo.addMoveToStack(typeRotation, -sens * 90, 0); //Test rotation Buldo
buldo.addMoveToStack(typeLigneHtoR, this, 0); //Test mouvement Buldo vers le rocher
- buldo.addMoveToStack(typeRotation, 180, 0); //Test rotation Buldo
- buldo.addMoveToStack(typeLigneHtoX, buldo.xBase + buldo.camp * buldo.dxAvHotSpot, 0); //Test mouvement Buldo vers la position de base
- buldo.addMoveToStack(typeRotation, -180, 0); //Test rotation Buldo
+ //buldo.addMoveToStack(typeRotation, 180, 0); //Test rotation Buldo
+ //buldo.addMoveToStack(typeLigneHtoX, buldo.xBase + buldo.camp * buldo.dxAvHotSpot, 0); //Test mouvement Buldo vers la position de base
+ //buldo.addMoveToStack(typeRotation, -180, 0); //Test rotation Buldo
}
}
}; //fin onClickRocherBuldo
this.destroy = function () {
@@ -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 * this.dxAvHotSpot + this.camp * this.rocherDestination.dxHotLeftSpot; //Abscisse x du point chaud AV du rocher
+ var dxHotSpotR = this.camp == humanCamp ? this.rocherDestination.dxHotLeftSpot : this.rocherDestination.dxHotRightSpot; //Point chaud 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) {
@@ -695,17 +695,17 @@
this.isMovingR = false; // on indique que le Buldo n'est plus en train de pousser un rocher
return;
}
if (this.isMovingR) {
- if (this.rocherDestination.sprite) {
+ 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 its sprite is null
}
- var HD = dist(this.sprite.x + this.dxAvHotSpot, 0, xTarget, 0); //Distance entre le point chaud AV du sprite et l'abscisse x destination
+ var HD = dist(this.sprite.x + this.camp * this.dxAvHotSpot, 0, xTarget, 0); //Distance entre le point chaud AV du sprite et l'abscisse x destination
if (HD <= 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
- this.sprite.x = xTarget; // on donne à l'abscisse du sprite la valeur x destination
+ this.sprite.x = xTarget - this.camp * this.dxAvHotSpot; // on donne à l'abscisse du sprite la valeur x destination
if (this.rocherDestination != null && !this.isPushing) {
this.isPushing = true; // on indique que le Buldo est en train de pousser un rocher
this.rocherPushed = this.rocherDestination; // on indique le rocher pousse par le Buldo
this.rocherPushed.totalPushers += this.camp; // on indique le Buldo qui pousse le rocher
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.