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
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
===================================================================
--- original.js
+++ change.js
@@ -316,13 +316,13 @@
if (self.tailleRocher == grosRocher) {
self.name = "Gros Rocher";
}
}); //fin class Rocher
-var Buldo = /*#__PURE__*/_createClass2(function Buldo(sprite, x, y, dxHotSpot, dyHotSpot, dxBkHotSpot, dyBkHotSpot, camp) {
+var Buldo = /*#__PURE__*/_createClass2(function Buldo(x, y, camp) {
_classCallCheck2(this, Buldo);
this.name = "buldo";
this.isSelected = false; //Flag qui indique si le Buldo est selectionne
- this.sprite = sprite;
+ // Removed erroneous line that attempted to assign an undefined 'sprite' variable to 'this.sprite'
this.sprite.x = x;
this.sprite.y = y;
this.sprite.anchor.set(0.5);
this.sprite.scale.set(1.0);
@@ -355,9 +355,30 @@
this.sprite.rotation = 0.0;
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
+ this.vitesseAngulaireRms = 0.0; //vitesse angulaire en radians par millisecondes
+ var buldorock_sprite = game.addChild(LK.getAsset('bulldorock', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ }));
+ var buldozer_sprite = game.addChild(LK.getAsset('bulldozer', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ }));
+ if (this.camp == humanCamp) {
+ this.sprite = buldorock_sprite;
+ this.dxAvHotSpot = buldoRockHotSpotX; //Hotspot avant du sprite (point de contact avec un rocher) décalage par rapport au point d'ancrage
+ this.dyAvHotSpot = buldoRockHotSpotY;
+ this.dxBkHotSpot = buldoRockBkHotSpotX; //Offset du point chaud arriere du sprite (point de contact avec un autre Buldo) décalage par rapport au point d'ancrage
+ this.dyBkHotSpot = buldoRockBkHotSpotY;
+ } else if (this.camp == ordiCamp) {
+ this.sprite = buldozer_sprite;
+ this.dxAvHotSpot = buldoZerHotSpotX; //Hotspot avant du sprite (point de contact avec un rocher) décalage par rapport au point d'ancrage
+ this.dyAvHotSpot = buldoZerHotSpotY;
+ this.dxBkHotSpot = buldoZerBkHotSpotX; //Offset du point chaud arriere du sprite (point de contact avec un autre Buldo) décalage par rapport au point d'ancrage
+ this.dyBkHotSpot = buldoZerBkHotSpotY;
+ }
}); //fin constructor
function generateRandomRock(nombreRochers) {
//Calcul de positions aléatoire pour les rochers dans la zone de route
var zoneMiniy = RoadZone.y;
@@ -390,5 +411,38 @@
rochers.push(rock);
}
return rochers;
} //fin generateRandomRock
-var rochers = generateRandomRock(nbRochers); //création des rochers
\ No newline at end of file
+function createBuldos() {
+ //CREATION D'OBJETS A PARTIR DES SPRITES //constructor(x, y, camp)
+ var buldoRock1 = new Buldo(HumanZone.x + HumanZone.width / 2, HumanZone.y + HumanZone.height / 3, humanCamp);
+ var buldoRock2 = new Buldo(HumanZone.x + HumanZone.width / 2, HumanZone.y + 2 * HumanZone.height / 3, humanCamp);
+ var buldoZer1 = new Buldo(OrdiZone.x + OrdiZone.width / 2, OrdiZone.y + OrdiZone.height / 3, ordiCamp);
+ var buldoZer2 = new Buldo(OrdiZone.x + OrdiZone.width / 2, OrdiZone.y + 2 * OrdiZone.height / 3, ordiCamp);
+ //On stocke les objets dans un tableau
+ var buldos = [];
+ buldos.push(buldoRock1);
+ buldos.push(buldoRock2);
+ buldos.push(buldoZer1);
+ buldos.push(buldoZer2);
+ //On donne un nom aux objets
+ buldoRock1.name = 'buldoRock1';
+ buldoRock1.vitesse = vitesseBuldo;
+ buldoRock2.name = 'buldoRock2';
+ buldoRock2.vitesse = vitesseBuldo;
+ buldoZer1.name = 'buldoZer1';
+ buldoZer1.vitesse = vitesseBuldo;
+ buldoZer2.name = 'buldoZer2';
+ buldoZer2.vitesse = vitesseBuldo;
+ //On initialise leurs positions de base xBase et yBase
+ buldoRock1.xBase = buldoRock1.sprite.x;
+ buldoRock1.yBase = buldoRock1.sprite.y;
+ buldoRock2.xBase = buldoRock2.sprite.x;
+ buldoRock2.yBase = buldoRock2.sprite.y;
+ buldoZer1.xBase = buldoZer1.sprite.x;
+ buldoZer1.yBase = buldoZer1.sprite.y;
+ buldoZer2.xBase = buldoZer2.sprite.x;
+ buldoZer2.yBase = buldoZer2.sprite.y;
+ return buldos;
+} //fin de createBuldos
+var rochers = generateRandomRock(nbRochers); //création des rochers
+var buldos = createBuldos(); //Creation des Buldos
\ No newline at end of file
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.