Code edit (1 edits merged)
Please save this source code
Code edit (19 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: nbTicksSinceEndOfWave is not defined' in or related to this line: 'nbTicksSinceEndOfWave -= 1; //On attend un peu avant de passer à la vague suivante' Line Number: 738
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
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 undefined (reading 'length')' in or related to this line: 'monkeyAsset = self.attachAsset(newAssetId, {' Line Number: 95
Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'monkeyAsset = self.attachAsset(newAssetId, {' Line Number: 95
Code edit (6 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: ticksBeforeNextPosition is not defined' in or related to this line: 'scoreTest = "actualPIx: " + self.actualPositionIndex + " goalPIx: " + self.goalPositionIndex + " assetsToUse: " + self.assetsToUse + " seqIxToUse: " + self.sequenceIndexToUse + "\nticksBeforeNextPosition: " + ticksBeforeNextPosition;' Line Number: 114
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'monkeyAsset = self.attachAsset(newAssetId, {' Line Number: 96
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'monkeyAsset = self.attachAsset(newAssetId, {' Line Number: 96
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'monkeyAsset = self.attachAsset(newAssetId, {' Line Number: 96
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'monkeyAsset = self.attachAsset(newAssetId, {' Line Number: 96
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'monkeyAsset = self.attachAsset(newAssetId, {' Line Number: 94
Code edit (13 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of null (reading 'trajectory')' in or related to this line: 'coconutChoosen.trajectory.isStarted = true;' Line Number: 138
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 undefined (reading 'anchorX')' in or related to this line: 'monkeyAsset = self.attachAsset(newAssetId, {' Line Number: 69
Code edit (4 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -178,8 +178,11 @@
/****
* Game Code
****/
/****
+* Game zones and backgrounds
+****/
+/****
* GAME DESCRIPTION:
* Game Principle:
* NAME: COCO MONKEY V1.0 by Dalhem 2024
* -There is beach where people are enjoying the sun by the shadow of palm trees.
@@ -223,11 +226,8 @@
* The left zone: the coconut will bounce to the extrem left.
* The center zone: the coconut will randomly bounce to the left or to the right.
* The right zone: the coconut will bounce to the extrem right.
****/
-/****
-* Game zones and backgrounds
-****/
var ScoreZone = {
x: 0,
y: 0,
width: game.width,
@@ -258,9 +258,9 @@
parasol.x = 2048 / 2;
parasol.y = OptionsZone.y - 400;
var coconutsInTree = []; //Tableau des coconuts dans les arbres
var coconuts = []; //Tableau des coconuts en mouvement
-var nombreCoconuts = 10; //Nombre de coconuts en mouvement en même temps
+var nombreCoconuts = 5; //Nombre de coconuts en mouvement en même temps
var coconutChoosen = null; //Coconut choisie pour tomber
var sommetParaboleHaute = ScoreZone.height + 200;
var sommetParaboleBasse = ScoreZone.height + 400;
var nbTicksToBounceHight = 230; //Nombre de ticks pour effectuer une parabole haute
@@ -363,17 +363,16 @@
//Les coconuts sont créés au nombre de nombreCoconuts
//puis elles réparties aléatoirement mais équitablement dans les arbres autour des trois points de départ (XL, XC, XR) + ou - 50 pixels
//Elles sont stockées dans le tableau coconutsInTree
function setCocoInTree(wave) {
- for (var i = 0; i < nombreCoconuts + 4; i++) {
+ for (var i = 0; i < nombreCoconuts + wave; i++) {
var newCoconut = new Coconut();
// Choisir aléatoirement un point de départ
var randomIndex = Math.floor(Math.random() * startPoints.length);
var randomDeltaX = Math.floor(Math.random() * 100) - 50;
var randomDeltaY = Math.floor(Math.random() * 100) - 50;
var typeTrajectory = -1; //Trajectoire statique
var X1 = startPoints[randomIndex] + randomDeltaX;
- //var X1 = startPoints[1];
var X2 = X1;
var Y0 = monkeyLevel + randomDeltaY;
var Yh = Y0;
var totalTicks = 0;
@@ -381,8 +380,11 @@
coconutsInTree.push(newCoconut);
LK.getSound('monkeySquirk').play();
LK.getSound('boomBoom').play();
LK.getSound('boomBoom').play();
+ if (nbTicksBetweenTwoWaves >= 12) {
+ nbTicksBetweenTwoWaves -= 50; //On accelere le mouvement
+ }
}
//Affiche les coconuts dans les arbres
for (var i = 0; i < coconutsInTree.length; i++) {
game.addChild(coconutsInTree[i]);