This is only a experiment, made for sake of learning and experimenting in p5*.
If you would also like to build interactive canvas apps visit p5js.org.
Open the game here: Example.
Use UP ARROW to jump.
Made with OOJS (Object-Oriented JavaScript).
Birds - Object for a single bird, it is being made during the setup().
Fields:
x- Spawn X position,y- Spawn Y position, default middle of the canvas,size- Radius of the ball (bird),gravity- With which force the bird will pulled down,velocity- A type of sum for gravity
Line - Object for a single bird, it is being made during the setup().
Fields: (you should play with)
gap- Gap size between the two lines, it is a range between to numbers,w- Width of the line,speed- Speed of which the line moves
Sounds are from Super Mario Bros. <3