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
User prompt
Please fix the bug: 'Uncaught TypeError: buldoRock1.sprite.setAnchor is not a function' in or related to this line: 'buldoRock1.sprite.setAnchor(0.5, 0.5);' Line Number: 603
Code edit (1 edits merged)
Please save this source code
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
===================================================================
--- original.js
+++ change.js
@@ -336,12 +336,16 @@
});
//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é
+ y = this.sprite.y;
+ buldo.rocherDestination = this; //Le buldo a pour destination le sprite rocher cliqué
+ var sens = buldo.sprite.y < y ? 1 : -1; //Test Calcul du sens de deplacement horizontale : 1=droite, -1=gauche
+ sens = buldo.camp == humanCamp ? sens : -sens; //Test Si le Buldo est humain, il doit arriver horizontalement par la gauche (abscisse croissante), sinon par la droite (abscisse decroissante)
+ 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(typeLigneHtoX, x, y); //Test mouvement Buldo
- buldo.addMoveToStack(typeRotation, 90, 0); //Test rotation Buldo
}
}
}; //fin onClickRocherBuldo
}); //fin class Rocher
@@ -452,9 +456,9 @@
this.setLigneHtoX(x); //On effectue le deplacement horizontal
break;
case typeLigneVtoY:
//Si le mouvement est un deplacement vertical, on effectue le deplacement
- this.setLigneVtoY(delta);
+ this.setLigneVtoY(y);
break;
default:
break;
}
@@ -517,18 +521,12 @@
}
}
}; // 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
+ this.isMovingV = true; //on indique que le Buldo est en mouvement
+ this.yDestination = y; //le point d'ancrage doit s'arreter sur y
//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
+ this.vitesseEnCours = this.sprite.y < y ? this.vitessePS : -this.vitessePS; //on donne le sens du deplacement vertical
}; //fin setLigneVtoY
this.deplaceVtoY = function (delta) {
// Vérifie si le Buldo est en mouvement
if (this.isMovingV) {
@@ -539,10 +537,14 @@
this.isMovingV = false; // on indique que le Buldo n'est plus en mouvement
return;
} else {
// Sinon on déplace le sprite verticalement
+ var sensAngleBuldo = sensRotation(this.sprite.rotation * 180 / Math.PI % 360); //Sens de rotation du Buldo (1=horaire, -1=antihoraire) (0=meme ordonnee)
+ var HD = dist(0, this.sprite.y + sensAngleBuldo * this.dxAvHotSpot, 0, y);
// Déplacement du sprite
+ //if (AD < HD) {
this.sprite.y += this.vitesseEnCours * delta;
+ //} //Si la distance AD est inferieure a la distance HD, le point D est derriere le point A, le Buldo ne se deplace pas
return;
}
}
}; // fin deplaceVtoY
@@ -589,8 +591,27 @@
ordonneesPossibles.splice(index, 1);
// Créer le rocher
var rock = new Rocher(size, x, y);
rock.sprite.visible = true;
+ rock.sprite.anchor.set(0.5, 0.5);
+ if (size == petitRocher) {
+ rock.dxHotLeftSpot = petitRocherDxHotLeft;
+ rock.dyHotLeftSpot = petitRocherDyHotLeft;
+ rock.dxHotRightSpot = petitRocherDxHotRight;
+ rock.dyHotRightSpot = petitRocherDyHotRight;
+ }
+ if (size == moyenRocher) {
+ rock.dxHotLeftSpot = moyenRocherDxHotLeft;
+ rock.dyHotLeftSpot = moyenRocherDyHotLeft;
+ rock.dxHotRightSpot = moyenRocherDxHotRight;
+ rock.dyHotRightSpot = moyenRocherDyHotRight;
+ }
+ if (size == grosRocher) {
+ rock.dxHotLeftSpot = grosRocherDxHotLeft;
+ rock.dyHotLeftSpot = grosRocherDyHotLeft;
+ rock.dxHotRightSpot = grosRocherDxHotRight;
+ rock.dyHotRightSpot = grosRocherDyHotRight;
+ }
rochers.push(rock);
}
//On ajoute les evenements de clic sur les sprites rocher
for (var i = 0; i < rochers.length; i++) {
@@ -640,8 +661,22 @@
buldoZer2.sprite.visible = true;
//On ajoute les evenements de clic sur les sprites Buldo
for (var i = 0; i < buldos.length; i++) {
buldos[i].sprite.on('down', buldos[i].onClickBuldo.bind(buldos[i], buldos));
+ //On donne leurs hotspots
+ if (buldos[i].camp == humanCamp) {
+ buldos[i].sprite = buldorock_sprite;
+ buldos[i].dxAvHotSpot = buldoRockHotSpotX; //Hotspot avant du sprite (point de contact avec un rocher) décalage par rapport au point d'ancrage
+ buldos[i].dyAvHotSpot = buldoRockHotSpotY;
+ buldos[i].dxBkHotSpot = buldoRockBkHotSpotX; //Offset du point chaud arriere du sprite (point de contact avec un autre Buldo) décalage par rapport au point d'ancrage
+ buldos[i].dyBkHotSpot = buldoRockBkHotSpotY;
+ } else if (buldos[i].camp == ordiCamp) {
+ buldos[i].sprite = buldozer_sprite;
+ buldos[i].dxAvHotSpot = buldoZerHotSpotX; //Hotspot avant du sprite (point de contact avec un rocher) décalage par rapport au point d'ancrage
+ buldos[i].dyAvHotSpot = buldoZerHotSpotY;
+ buldos[i].dxBkHotSpot = buldoZerBkHotSpotX; //Offset du point chaud arriere du sprite (point de contact avec un autre Buldo) décalage par rapport au point d'ancrage
+ buldos[i].dyBkHotSpot = buldoZerBkHotSpotY;
+ }
}
; // Fonction de callback pour le clic gauche sur les sprites.
return buldos;
} //fin de createBuldos
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.