User prompt
Flip the bird sprite horizontally when its direction is -1
User prompt
On setupLevel, set the top-branch Y position to be it's height/2
User prompt
top branch Y position should be a little bit higher. It's top edge must coincide with the screen top edge
User prompt
top branch should be a little bit lower. It's top edge must coincide with the screen top edge
User prompt
Make the top height twice the height
User prompt
The top branch should have a special sprite, and should be a rectangle that takes the whole width of the screen
User prompt
Adjust the Z position of the pop-up to be above everything lese
User prompt
DIsplay an intro pop-up that explains the game
User prompt
Reduce branches from 20 to 15
User prompt
Don't set jumping to false when vy > 0. Set it to false when a branch is touched, or when Y reaches the ground
User prompt
Prevent birds from going through top and bottom screen boundaries, with some padding
User prompt
Don't allow double-jumps
User prompt
Starting the game with one less bird than current
User prompt
On setupLevel, destroy birds before creating new ones. Also, have 3 initial birds but one additional more for each subsequent level
User prompt
Make birds 30% slower and make sure their initial Y positions are well-spaced out on screen
User prompt
Only call setupLevel once the branches and birds array are set
User prompt
When a bird is set with direction 1, it's X position must start on 0. When it's direction is -1, it's X must be the screen right side
User prompt
When a bird is created, there's a 50% chance it flies left-to-right, and 50% chance right-to-left. Birds should not be destroyed, when reaching the screen boundaries, a bird's position is reset to original
User prompt
Add 3 birds per level flying around. When monkey touches a bird, it's game over
User prompt
Keep track of the top-most branch (the one with lower Y position). When the monkey touches this branch, level is finished
User prompt
Level should also finish when the top-most branch is touched
User prompt
setupLevel should destroy the branches itself
User prompt
Refactor to have a centralised function where a level is set up
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'push')' in this line: 'birds.push(newBird);' Line Number: 59
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'push')' in this line: 'birds.push(newBird);' Line Number: 58
===================================================================
--- original.js
+++ change.js
@@ -20,8 +20,13 @@
self.originalX = self.direction === 1 ? 0 : 2048;
self.move = function () {};
self.update = function () {
self.x += self.direction * 7;
+ if (self.direction === -1) {
+ birdGraphics.scale.x = -1;
+ } else {
+ birdGraphics.scale.x = 1;
+ }
if (self.x < 0 || self.x > 2048) {
self.x = self.originalX;
}
self.y = Math.max(50, Math.min(2732 - 50 - self.height, self.y + Math.random() * 10 - 5));
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.