Code edit (22 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: victoireX is not defined' in or related to this line: 'var coupeVictoire = LK.getAsset('coupeVictoire', {' Line Number: 842
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 ReferenceError: rocher_petit_sprite is not defined' in or related to this line: 'self.sprite = rocher_petit_sprite;' Line Number: 327
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: rocher_moyen_sprite is not defined' in or related to this line: 'self.sprite = rocher_moyen_sprite;' Line Number: 330
Code edit (11 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: 'this.sprite = buldorock_sprite;' Line Number: 505
User prompt
Please fix the bug: 'Uncaught ReferenceError: buldorock_sprite is not defined' in or related to this line: 'this.sprite = buldorock_sprite;' Line Number: 505
Code edit (1 edits merged)
Please save this source code
Code edit (22 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: coupeVictoire is not defined' in or related to this line: 'LK.gui.top.addChild(coupeVictoire);' Line Number: 1001
Code edit (1 edits merged)
Please save this source code
Code edit (12 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Graphics is not a constructor' in or related to this line: 'var routeZone = new Graphics();' Line Number: 292
Code edit (1 edits merged)
Please save this source code
Code edit (4 edits merged)
Please save this source code
User prompt
Manque t'il route_sprite.x *= -1;
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (9 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: rochers[i] is undefined' in or related to this line: 'if (rochers[i].isClicked) {' Line Number: 1029
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -270,9 +270,9 @@
var route_sprite = game.addChild(LK.getAsset('zoneRoute', {}));
route_sprite.width *= 5.2;
route_sprite.height *= 1.0;
route_sprite.x -= 4325;
-route_sprite.y += 100;
+route_sprite.y += -50;
// Since direct manipulation like Graphics is not allowed, and LK does not support drawing shapes dynamically,
// we remove the code that causes the error. Instead, consider using a predefined shape or image asset if needed.
//CLASS ROCHER
var Rocher = /*#__PURE__*/_createClass(function Rocher() {
@@ -822,8 +822,43 @@
LK.gui.topLeft.addChild(victoireText);
victoireText.x = camp == humanCamp ? HumanZone.width : game.width / 2;
victoireText.y = ScoreZone.height;
} //fin afficheVictoire
+function createSingleRock(size) {
+ //Creation d'un rocher de taille donnee a ajouter a la liste des rochers
+ //L'ordonnee est choisie aleatoirement dans la zone de route disponible (ordonneesRestantes)
+ if (ordonneesRestantes.length == 0) {
+ return null;
+ }
+ var index = Math.floor(Math.random() * ordonneesRestantes.length);
+ var y = ordonneesRestantes[index];
+ ordonneesRestantes.splice(index, 1); //On supprime l'ordonnee choisie de la liste des ordonnees restantes
+ var rock = new Rocher(size, RoadZone.x + RoadZone.width / 2, 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;
+ }
+ rock.totalForce = 0;
+ rock.sprite.on('down', rock.onClickRocherBuldo.bind(rock, buldos));
+ nbRochers += 1;
+ return rock;
+} //fin createSingleRock
function generateRandomRock(nombreRochers) {
//Calcul de positions aléatoire pour les rochers dans la zone de route
var zoneMiniy = RoadZone.y;
var zoneMaxiy = RoadZone.y + RoadZone.height;
@@ -940,9 +975,9 @@
var buldos = createBuldos(); //Creation des Buldos
var rochers = generateRandomRock(nbRochers); //création des rochers
// Création de l'objet de texte pour le score du camp humain
var scoreHumainText = new Text2('0', {
- size: 70,
+ size: 90,
fill: "#0000ff",
anchorX: 0.5,
anchorY: 0
});
@@ -950,9 +985,9 @@
LK.gui.top.addChild(scoreHumainText); //Point de depart (game.width/2,0)
scoreHumainText.x -= HumanZone.width / 2; //puis decalage vers la gauche
// Création de l'objet de texte pour le score du camp ordinateur
var scoreOrdiText = new Text2('0', {
- size: 70,
+ size: 90,
fill: "#ff0000",
anchorX: 0.5,
anchorY: 0
});
@@ -965,9 +1000,9 @@
fill: "#00ff00",
anchorX: 0.5,
anchorY: 0
});
-LK.gui.top.addChild(scoreFictifText);
+//LK.gui.top.addChild(scoreFictifText);
// Fonction de rappel pour le tick
function onGameTick() {
// Autres mises à jour du jeu ici en cours de test..
}
@@ -986,8 +1021,9 @@
}
});
if (buldosCampNonActif) {
buldosCampNonActif.forEach(function (buldo) {
+ buldo.rochersCibles = []; //On vide la pile des rochers cibles en cas de creation de nouveaux rochers
var rochersCopy = rochers.slice();
rochersCopy.sort(function (a, b) {
return a.timeToReach(buldo.sprite.x, buldo.sprite.y) - b.timeToReach(buldo.sprite.x, buldo.sprite.y);
});
@@ -1055,11 +1091,8 @@
if (rocher.tempoBlocked > timeBeforeSplit) {
//Si le rocher est bloque depuis plus de n ticks on arrete de le faire clignoter
rocher.sprite.alpha = 1;
rocher.tempoBlocked = 0;
- //rocher.sprite = rocher_split_sprite;
- rocher.sprite.x = rocher.sprite.x;
- rocher.sprite.y = rocher.sprite.y;
rocher.sprite.visible = true;
rochersToDestroy.push(rocher);
}
}
@@ -1067,8 +1100,29 @@
//On detruit les rochers bloques apres quelques secondes
//LK.setTimeout(function () { //A garder pour memoire
if (rochersToDestroy.length > 0) {
rochersToDestroy.forEach(function (rocher) {
+ //Creation de un ou deux rochers de taille inferieure (si possible) a la place du rocher detruit
+ //Un gros rocher se divise en un moyen et un petit, un moyen en deux petits, un petit est détruit sans se diviser
+ var x = rocher.sprite.x;
+ var y = rocher.sprite.y;
+ var taille = rocher.tailleRocher;
+ var rocher1 = null;
+ var rocher2 = null;
+ if (taille == grosRocher) {
+ rocher1 = createSingleRock(moyenRocher);
+ rocher2 = createSingleRock(petitRocher);
+ rocher1.sprite.visible = true;
+ rocher2.sprite.visible = true;
+ rochers.push(rocher1);
+ rochers.push(rocher2);
+ }
+ if (taille == moyenRocher) {
+ rocher1 = createSingleRock(petitRocher);
+ rocher1.sprite.visible = true;
+ rochers.push(rocher1);
+ }
+ //On supprime le rocher detruit de la liste des rochers
rocher.destroy();
});
}
rochersToDestroy = []; //On vide le tableau des rochers a detruire
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.