Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: scoreText is not defined' in or related to this line: 'scoreText.setText(nouveauScore);' Line Number: 172
Code edit (7 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: scoreText is not defined' in or related to this line: 'scoreText.setText(nouveauScore);' Line Number: 178
User prompt
Please fix the bug: 'ReferenceError: scoreText is not defined' in or related to this line: 'scoreText.setText(nouveauScore);' Line Number: 173
User prompt
Please fix the bug: 'ReferenceError: scoreText is not defined' in or related to this line: 'scoreText.setText(nouveauScore);' Line Number: 172
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: startPoints is not defined' in or related to this line: 'var randomIndex = Math.floor(Math.random() * startPoints.length);' Line Number: 86
Code edit (1 edits merged)
Please save this source code
Initial prompt
Coco Monkey
===================================================================
--- original.js
+++ change.js
@@ -49,8 +49,54 @@
/****
* Game Code
****/
+/****
+* 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.
+ * -Above them, three palm trees are growing coconuts.
+ * -In the trees, a monkey is throwing coconuts from the top of the trees, thus three points of departure.
+ * -The player controls a guy who holding a parasol to protect everyone from the coconuts.
+ * -The coconuts are falling at a regular speed, falling in straight lines.
+ * -If a coconut touches the parasol, the player earns points.
+ * -If a coconut touches the ground, the player loses a life.
+ * -The game is over when the player has no more lives.
+* Game Areas:
+ * The screen is divided into 3 main zones in the following descending order:
+ 1. Score area: displays the player's score.
+ 2. The main game area: where the game takes place, it is divided into 3 zones corresponding to the 3 points of departure of the coconuts :
+ * The left zone: the coconuts fall from the left tree.
+ * The center zone: the coconuts fall from the center tree.
+ * The right zone: the coconuts fall from the right tree.
+ 3. Options area (or advertisement).
+* Game Progression:
+ * At the beginning of the game, the player has 0 points.
+ * The player has 3 lives.
+ * The player can move the parasol by dragging it.
+ * The monkey throws coconuts at a regular interval randomly from the top of the trees.
+ * When a coconut touches the parasol, it bounces up following a parabolic trajectory.
+ * The parabolic trajectory depends on the angle of the parasol:
+ * The more the parasol is inclined, the more the coconut will bounce back :
+ * If the parasol is in the left zone, the coconut may bounce following a parabolic trajectory :
+ * to the left, thus outside the screen.
+ * to the right, thus towards the center zone.
+ * to the extrem right, thus towards the right zone.
+ * If the parasol is in the center zone, the coconut may bounce following a parabolic trajectory :
+ * to the left, thus towards the left zone.
+ * to the extrem left, thus outside the screen.
+ * to the right, thus towards the right zone.
+ * to the extrem right, thus outside the screen.
+ * If the parasol is in the right zone, the coconut may bounce following a parabolic trajectory :
+ * to the left, thus towards the center zone.
+ * to the extrem left, thus towards the left zone.
+ * to the right, thus outside the screen.
+ * the parasol has three zones of influence:
+ * 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.
+****/
var monkey = game.addChild(new Monkey());
monkey.x = 2048 / 2;
monkey.y = 200;
var parasol = game.addChild(new Parasol());