Flappy Bird banner

Flappy Bird

14 devlogs
49h 14m 18s

My first time using HTML5 Canvas so i made a remake of Flappy bird. Its completely pc and mobile friendly and it has all sounds and transitions etc. Was forgetting JS a bit so made this to refresh my brain and learn something new,

Loading README...

Whatsup

Shipped this project!

Hours: 49.24
Cookies: 🍪 1460
Multiplier: 29.65 cookies/hr

Soooo i made a remake of Flappy bird in HTML5 canvas. I used classes in JS for the first time ever so both of those things took a bit to learn. I watched freecodecamps videos about Canvas so i learnt about how it worked while i was making the game. Alot of errors and tries but i made it to the end. I had alot of fun and i put alot of effort into this so i hope you like it :D.

Whatsup

(Video filmed on ios) I added some animations to the gameover screen. Also transition fade on every state aswell as a «flash» when the bird dies. The score button now allows you to reset your best score and the share button opens up the webshare for your device. The game is done now :D

0
Whatsup

Added audio that works on Safari. I tried the HTML5 Audio API (new Audio()) but it caused delays and lag because safari blocks playback until the user interacts with the page. So i researched a bit and found out about the Web Audio API. With this i can preload sounds into buffers for instant playback, but audio must be unlocked with a user interaction the first time, after that sound plays very well across the browsers i tried. The audio files arent big so shouldnt take much memory.

Attachment
0
Whatsup

Finished creating the UI and its functions. For now the score and share buttons doesnt have any function. I made the code more separated so the UI events are in a different file from the Ui render and i fixed some glitches with the bird, pipe and UI. The menu/start screen and the get ready screen aswell as the pause and unpause works. Next up are sounds and then maybe animate the Ui to pop up different times than each other but idk yet.

0
Whatsup

I created the game menu UI. For now only the start button works. i changed bird physics (again lol) for better flapping. I also added sparks to the scoreboard medal like it has on the original game. The game states were hell to manage so i did rework and created a central game state manager that has all the game info so i can access them in any file by just importing one thing and check if game is paused, what screen its on etc.

0
Whatsup

I changed the bird physics so they match the OG flappy bird game a little more by sort of “hanging” angled upwards when flapping then rotating fast downwards again. It may not look like much changed but i did ALOT of rewowrk in the code because my game file was very cluttered so i had to separate UI logic into its own file and collisions etc into the pipe file.

0
Whatsup

Added a “NEW BEST” with a badge and a score saved in localstorage. also added medals where you get a bronze medal at score 10, silver on score 20, gold on 50 and platinum on 100. And made the digit 1 smaller on the score so it looks better and not wide. The game is slowly finishing.✌👌

0
Whatsup

since i found out how to improve the quality of assets on the canvas i decided to try out one singular spritesheet instead of so many images loading on the screen etc. The spritesheet is now almost just as good as the singular images. I sat there writing coordinates for like 30 assets on the spritesheet lol. Also changed a bit of code so it uses the new coordinates. Some things broke but i fixed them :). btw it looks better ingame than this image

Attachment
0
Whatsup

The assets i used earlier were blurry due to scaling so i had to fix their size and pixels using piskelapp.com. I recreated the number images aswell as the scoreboard then had to test it on the game again and again with different sizes. At last i added a bird flap animation and changed the canvas code so the game looks crispier.

0
Whatsup

added the score logic. the number 1 on the score numbers look a bit out of place ooof

0
Whatsup

removed and changed some code, better pipe and bird collision interaction, game over image at the end, changed the canvas height and width. Also took hella long with try and error because some assets were low quality so i tried to make it look better in the game but didnt work so im saving that for last :(((

0
Whatsup

worked on the pipe collisions. not perfect yet but it will be :D

0
Whatsup

fixed and improved some code and added bird class with gravity and controls. The bird rotates when flapping and falling. no collision logic yet

0
Whatsup

Created the pipes with random Y positions. this took longer than expected because i was learning about Classes

0
Whatsup

Created a canvas and made it responsive. Added the background image, ground image and bird image, the bg and ground moves in a gameloop so it looks like its going forward.

0