User prompt
Add 3 birds flying on every new level. When the monkey touches a bird, it's game over
User prompt
For every new level, remove all branches and create new random ones
User prompt
Actually, let's finish the level when the monkey reaches the top branch, instead of the top of the screen
User prompt
Show level indicator on top. Starts at level 1. When the monkey reaches the very top of the screen, a new level is generated, the level indicator increases and the monkey position is reset
User prompt
Limit monkey's X position to the screen boundaries
User prompt
When jumping from a branch, ignore collision with it until falling down again
User prompt
Limit jump angle so that it can only jump towards the top
User prompt
Limit jump height by half again
User prompt
Reduce jump height by half
User prompt
Make jump 10 times higher
User prompt
Stop monkey movement when it touches the ground or a branch
User prompt
There's a problem: monkey is not moving when I click anywhere
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'x')' in this line: 'var dx = target.x - self.x;' Line Number: 20
User prompt
Limit monkey position to not fall through the ground
User prompt
Fix Bug: 'TypeError: branches[i].containsPoint is not a function' in this line: 'if (branches[i].containsPoint(pos)) {' Line Number: 78
User prompt
When clicking a branch, monkey jumps in the branch's direction. It has an initial acceleration towards it. Velocity and gravity are properly simulated.
User prompt
Create 20 branches upfront and avoid creating branches on tick
Initial prompt
Monkey's Leap
===================================================================
--- original.js
+++ change.js
@@ -51,8 +51,14 @@
newBranch.y = i * (2732 / 20);
branches.push(newBranch);
self.addChild(newBranch);
}
+ for (var i = 0; i < 3; i++) {
+ var newBird = new Bird();
+ newBird.x = Math.random() * 2048;
+ birds.push(newBird);
+ self.addChild(newBird);
+ }
var birds = [];
var level = 1;
var levelTxt = new Text2('Level: ' + level, {
size: 150,
A tree branch with green leaves Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A preying white bird flying ahead Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A cute monkey with arms up Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Wood texture Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Bananas Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Cartoony looking spider, with two big round eyes Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
One green vine Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.