├── index.js
├── index.html
└── README.md
/index.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Flappy bird
2 |
3 | - Initialize an empty index.html, index.js file. Import index.js inside index.html
4 | - Create a canvas of 800x800 with a blue background color
5 | - Create a single variable called birdX and initialize it to 800 / 2
6 | - Create a gravity variable set it to 9.8
7 | - Create a velocity variable set it to 0
8 | - Create an infinite for loop that updates birdX and velocity based on the time (11th standard physics)
9 | - Update the position of the bird on canvas based on that
10 | - Catch the keyboard up event and set velocity to +20 when the keybaord up key is pressed
11 | - See your bird dance up and down
12 |
13 | ## Advanced TODOs
14 | - Calculate the time between renders, dont assume a certain framerate
15 | - Add bars throughout whose speed keeps on increasing and move towards the bird
16 | - In every interation, check if the bird collided with a bar
--------------------------------------------------------------------------------