Create Flappy Bird clone in Javascript HTML CSS

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ธ.ค. 2024

ความคิดเห็น • 115

  • @azureharris8647
    @azureharris8647 ปีที่แล้ว +15

    I love your channel. You are the only youtuber that really goes into debt and explains everything. Perfectly

    • @ben4Real34
      @ben4Real34 หลายเดือนก่อน +1

      SAME!! 😀

  • @KennyYipCoding
    @KennyYipCoding  ปีที่แล้ว +8

    Check out the playlist of web project tutorials here!
    th-cam.com/play/PLnKe36F30Y4bLhA-st9sC4ZthyV7nsL2Q.html
    Got a tutorial suggestion? Let me know down below!

  • @QuackQuack6
    @QuackQuack6 ปีที่แล้ว +42

    quick tip, In vs code in html just type ! then hit tab and you will have the entire code

    • @ayanchatterjee2416
      @ayanchatterjee2416 2 หลายเดือนก่อน +1

      already knew that lol....thanks anyways !

    • @ShakirAhmed-e6u
      @ShakirAhmed-e6u 2 หลายเดือนก่อน

      Thanks! Wasn't aware about it

    • @egg_man_pro_max
      @egg_man_pro_max 29 วันที่ผ่านมา

      or you can use html:5 then tab

    • @AUDIOKINGS
      @AUDIOKINGS 17 วันที่ผ่านมา

      Thanks a lot of ❤

  • @masterman7624
    @masterman7624 ปีที่แล้ว +7

    Your vids are amazing bro, as a beginner, they are helping me massively keep it up

  • @hapikus5157
    @hapikus5157 ปีที่แล้ว +2

    Waited 1,5 months! Thanks a lot!

  • @nguyencanh1651
    @nguyencanh1651 2 หลายเดือนก่อน

    I'm very happy to both code and play this game again. Thank you very much for your tutorial.

  • @RayShine52777
    @RayShine52777 ปีที่แล้ว +4

    Your video is so useful and easy-understanding. I love it! Thank you for teaching me this and improving my Javascript

  • @sociedpro3584
    @sociedpro3584 5 หลายเดือนก่อน +1

    You are cooking so hard , hats off

  • @henkdevries6380
    @henkdevries6380 10 หลายเดือนก่อน

    really helpfull when you draw out what you are programming, helped me alot. Good tutorial video.

  • @chetanrathi8070
    @chetanrathi8070 ปีที่แล้ว

    awsome tutorial!!! you make coding game look like playing it!

  • @ksamuelchris
    @ksamuelchris 10 หลายเดือนก่อน +1

    This is great example of creating flappy bird with HTML5 I would like to know if you would talk about making the game for mobile .
    For example using the screen to make the bird move by tapping the screen. I also was wondering about game sound input and perhaps level generations

    • @KennyYipCoding
      @KennyYipCoding  10 หลายเดือนก่อน +1

      Not sure what levels you would make with flappy bird since it’s an infinite platform game. Unfortunately web on mobile is different from mobile apps so there are limitations on what you can do. You could add a mouse click handler function (check my wordle or sudoku tutorial where I show how to create one) and add the code that makes the bird jump into the mouse click handler.

  • @ChaosSpeed24
    @ChaosSpeed24 หลายเดือนก่อน

    Thanks for the tutorial!

  • @tanmayi8452
    @tanmayi8452 6 หลายเดือนก่อน

    Amazing! Thank you so so much Kenny! Really appreciate the detailed explanation! Grateful

  • @zarakikenpachi1773
    @zarakikenpachi1773 ปีที่แล้ว +9

    I have a really small request, hoping you could incorporate it in one/some of your tutorials.
    If you could show how to add a clickable link or modal to a canvas game, and how to make the game responsive for standard phone and tablet screen sizes.
    Apart from that, amazing tutorial. Thanks a lot for your efforts.

  • @chetanrathi8070
    @chetanrathi8070 ปีที่แล้ว

    super awesome!!! just finished it!!

  • @yamraj4054
    @yamraj4054 ปีที่แล้ว +2

    can someone help me when i tried to run the Top pipe movement code, the pipes did sucessfully moved to left but then they left a black screen between them

    • @KennyYipCoding
      @KennyYipCoding  ปีที่แล้ว +1

      Not sure what this bug looks like but perhaps you could compare the completed code with the one you wrote and see if you missed something?

    • @ievgenod9708
      @ievgenod9708 ปีที่แล้ว

      Most probably you wrote birdHeight istead of boardHeight in clearRect function)

    • @ajaysaini2349
      @ajaysaini2349 28 วันที่ผ่านมา

      Did you find the bug?

  • @josearanda2558
    @josearanda2558 7 หลายเดือนก่อน +1

    writing it in vs code and I completed the first 5 minutes of the tutorial, am I doing something wrong?

  • @mustafaali-nk8mx
    @mustafaali-nk8mx 3 หลายเดือนก่อน

    i didnt understand the context and ratio management and stuff would you kindly help me abt the calculations ?

  • @sobu2767
    @sobu2767 3 หลายเดือนก่อน

    can you please teel the logic for the detectcollision function, didn't get it.

  • @QuackQuack6
    @QuackQuack6 ปีที่แล้ว +2

    and for the flappy bird instead of drawing it with complicated math, can't you just create a div called bird and in the CSS file put the flappy bird image in the div with: background-image: url(Birb);
    and then code it to move? and then do the same thing with the board cuz it looks complicated compared of what you did with the Whack a mole vid

    • @KennyYipCoding
      @KennyYipCoding  ปีที่แล้ว +3

      It may seem complicated but it actually isn’t once you take a bit of time to understand it. This is fundamental for game programming. The css trick is just a hacky way to do it and is not recommended.

    • @KennyYipCoding
      @KennyYipCoding  ปีที่แล้ว +3

      For games that only require clicking on a grid/board, it’s easier to create html elements. But a game involving movement and physics, you’re better off using canvas or some other graphics library.

  • @classicarroll
    @classicarroll 6 หลายเดือนก่อน

    How to you create the two vertical lines that signify “or”.

  • @chrisrutledge2348
    @chrisrutledge2348 ปีที่แล้ว

    Only recommendation would be to have touch support. Otherwise, this is awesome!

  • @Hoodies
    @Hoodies ปีที่แล้ว

    This tutorial is very helpfull, and well explained. I just think that u should add the code for resetting the bird as his original place when u restart the game cause the bird will spawn as the exact same place he died in the precedent run. Anyway thank you a lot it was a very nice tutorial.

  • @Suiqq
    @Suiqq 9 หลายเดือนก่อน

    i cannot figure out why i cant get the imagine of flappybird to load it just stays a green block

  • @sumitapandey5042
    @sumitapandey5042 หลายเดือนก่อน

    Sir i am getting error as getcontext is not a function . .. can you plz help

  • @ahriad2217
    @ahriad2217 วันที่ผ่านมา

    Subscribed !😊

  • @Umut34
    @Umut34 ปีที่แล้ว

    Thank you my friend amazing tutorial

  • @raoufassam2969
    @raoufassam2969 2 หลายเดือนก่อน

    what about the image class ??

  • @BrilliartStudios
    @BrilliartStudios 4 หลายเดือนก่อน

    I can't get mine to show up on a browser? I'm a beginner.

  • @Polymath1729
    @Polymath1729 ปีที่แล้ว

    Thanks a lot bro you are just awesome🥰

  • @ellis-pr7hh
    @ellis-pr7hh ปีที่แล้ว +1

    the explanation is so great and code is pretty much easy to understand ..just one question ..as someone is playing the game, after some period of playing usually games gets pretty fast so that it becomes hard to play...can we do in this too? if yes then how..

    • @KennyYipCoding
      @KennyYipCoding  ปีที่แล้ว +1

      Yes you can build levels or check after a certain number of points, you can increase certain things like how fast the player is going. In the case with flappy bird, I don’t think anything changes . Check out my space invaders tutorial for an example!

    • @ellis-pr7hh
      @ellis-pr7hh ปีที่แล้ว

      @@KennyYipCoding alrighty thank you

  • @Rafael_2008
    @Rafael_2008 7 หลายเดือนก่อน

    i have a question about the birdImg.src, for the js in the newest version, the js couldn't read it, can you help me ASAP please?

    • @KennyYipCoding
      @KennyYipCoding  7 หลายเดือนก่อน

      Right click inspect console, what error do you see?
      Also I have the completed code for you to compare. It could be your img path is not correct

  • @RoadRageEntertainment
    @RoadRageEntertainment 10 หลายเดือนก่อน

    I've went a long and made sure all my code was lined to yours and everything was working
    fine at first but than i went to check again and it stays stuck on the bluescreen and doesnet
    update the dementions when i view live server in visuail studio and doesen't update the background and I double checked the code is right

    • @KennyYipCoding
      @KennyYipCoding  10 หลายเดือนก่อน

      did you link your css.js properly?

    • @RoadRageEntertainment
      @RoadRageEntertainment 10 หลายเดือนก่อน

      @@KennyYipCoding pretty sure I did doube check but now im trying to do the snake game and the html just does not want to read my javascript, your videos are awesome and helpful but when i try to open it i get the letters but it doesent update the picture

    • @YousifMahdi-v3e
      @YousifMahdi-v3e 3 หลายเดือนก่อน

      @@RoadRageEntertainment you can copy your codes and open a new window and start again

  • @johnanthonylontoc151
    @johnanthonylontoc151 ปีที่แล้ว

    Your video is so good!!but can you make a video of that flappy bird but with highscore theme

  • @artofbenjo3700
    @artofbenjo3700 ปีที่แล้ว

    how to center the text Game Over?

  • @MuhammadAzmiRayana
    @MuhammadAzmiRayana 5 หลายเดือนก่อน +1

    How to make it works on mobile?, when i try play it on mobile, the bird didn't jump. Pls answer😢

    • @aravindr4630
      @aravindr4630 3 หลายเดือนก่อน

      You got it bro ? Can you share how

    • @tusharyadav5874
      @tusharyadav5874 3 หลายเดือนก่อน

      On the computer we are using different event listeners i.e keypress . But in mobile we will be using touch to make bird jump . So you need to use touch listener for that

  • @anishmainali6535
    @anishmainali6535 ปีที่แล้ว

    you are too good
    love from nepal

  • @umermemon876
    @umermemon876 3 หลายเดือนก่อน

    bro can we use this on our own website😊

  • @saddamdhaif8793
    @saddamdhaif8793 10 หลายเดือนก่อน

    I have problem with let board;

  • @cotonillo
    @cotonillo ปีที่แล้ว

    Nose inglés pero Justo lo que buscaba

  • @anngela6345
    @anngela6345 8 หลายเดือนก่อน

    How to add music?

  • @Asifkhan-rv2bc
    @Asifkhan-rv2bc ปีที่แล้ว

    bro i write the same code like you write but after adding pipes moving code, there is no gap between two pipes ,my game background is not visible can you tell what i should i do

    • @KennyYipCoding
      @KennyYipCoding  ปีที่แล้ว

      Right click inspect and see if there’s an error message. Best thing to do is to backtrack, rewatch the previous parts of the videos and try to catch where you made a mistake!

    • @vitaminprotein2217
      @vitaminprotein2217 9 หลายเดือนก่อน

      same issue lol

  • @GusVine
    @GusVine ปีที่แล้ว

    this was pretty awesome! but once you have made a game like this one, how would you upload it or publish it in an actual website? i've followed this tutorial but cant seem to figure it out how to publish it in a website. i've tried to test what i have so far but cant seem to be able to embed it.
    any help is greatly appreciated!!!

    • @KennyYipCoding
      @KennyYipCoding  ปีที่แล้ว +1

      th-cam.com/video/OltY8JIaP-4/w-d-xo.html
      I have a video showing how to upload a webpage for free on GitHub

    • @lovelypicturepro
      @lovelypicturepro 7 หลายเดือนก่อน

      just put the same code on neocities

  • @Maxi_Puch
    @Maxi_Puch ปีที่แล้ว

    how do i run it on my browser

  • @Error-er1ki
    @Error-er1ki 7 หลายเดือนก่อน

    THANKYOU SO MUCH!!!!, I JUST DID YOUR CHALLENGE AND IT WORKING NOW. But my real challenge is giving it a coins to collect or pts to earn to acquire some power ups :< its so damn hard. Hope I can finish it.

  • @omniaabdalaziz7917
    @omniaabdalaziz7917 8 หลายเดือนก่อน

    can you please put the link of the pictures of the pic even the pipes pleeeeeease

    • @KennyYipCoding
      @KennyYipCoding  8 หลายเดือนก่อน

      As mentioned in the video, it’s in the GitHub link in the video description

  • @Eminence-in-shadow
    @Eminence-in-shadow ปีที่แล้ว

    This has helped me soo much

  • @david-agarpowers3555
    @david-agarpowers3555 7 หลายเดือนก่อน

    yo i did the same but if i press the key to make the bird jump it will go super fast that rlly weird

    • @KennyYipCoding
      @KennyYipCoding  7 หลายเดือนก่อน

      I forgot to take into account the refresh rate (used by requestAnimationFrame), mine is 60hz yours might be faster. In this case it’d be better to use setInterval(update, 1000/60); so that it’s 60 frames per second

    • @david-agarpowers3555
      @david-agarpowers3555 7 หลายเดือนก่อน

      @@KennyYipCoding yh i got 165hz, gotts try it tommorow

    • @Aana1205
      @Aana1205 3 หลายเดือนก่อน

      @@KennyYipCoding so what do i change in the code?

  • @itsmk3584
    @itsmk3584 หลายเดือนก่อน

    when my bird passed the pipe score is increasing by 42

  • @vitaminprotein2217
    @vitaminprotein2217 9 หลายเดือนก่อน

    the reset thing not working anyway gr8 tutorial :D

  • @xzex2609
    @xzex2609 10 หลายเดือนก่อน

    Hi I have a problem with the setInterval() timing , if I pass 1500 there will be just one pipe in the game , but around 500-700 ms is ok but the game appear fast. shouldn't be these timing standard , why when I set it to 1.5 I have just one pipe? should i use setTimeOut function to make delay? what do I do with just one pipe?

  • @dhruvbharti-yv2qs
    @dhruvbharti-yv2qs 8 หลายเดือนก่อน

    Good work bro
    But your bird Wing is not moving

  • @zoltanszadoczki5665
    @zoltanszadoczki5665 ปีที่แล้ว

    Hy! I have a problem and I dont know why... when I try to set the board sizes in the js file, it dont do nothin. I checked and i think i am wrote the same as you. I refered int the html correctly I tried with a alert message. I have the same issues with other games tutorials to. Please help me!:)
    My code:
    js
    let board;
    let boardWidth = 500;
    let boardHeight = 640;
    let context;
    let birdWidth = 34;
    let birdHeight = 24;
    let birdX = boardWidth/8;
    let birdY = boardHeight/2;
    let bird = {
    x : birdX,
    y : birdY,
    width : birdWidth,
    height : birdHeight
    }
    window.onload = function(){
    board = document.getElementById("board");
    boardHeight = boardHeight;
    boardWidth = boardWidth;
    context = board.getContext("2d");
    }
    context.fillStyle = "green";
    context.fillRect(bird.x, bird.y, bird.width, bird.height);

    • @KennyYipCoding
      @KennyYipCoding  ปีที่แล้ว +1

      Inside window.onload, it should be:
      board.height = boardHeight;
      board.width = boardWidth;

    • @zoltanszadoczki5665
      @zoltanszadoczki5665 ปีที่แล้ว

      Thank you now better but I still not have the bird

    • @zoltanszadoczki5665
      @zoltanszadoczki5665 ปีที่แล้ว

      And IT is jumps back , when I wrote what you suggest it worked but now thensame issue

  • @57Gulbar
    @57Gulbar 10 หลายเดือนก่อน

    Hello, can you explain me how do u find the ratio like the 17 and 12, i know that u did x2 for 34, 24. But the 17 and 12 iam lost....
    Btw i do like this video and your tutorial, nice job.

    • @KennyYipCoding
      @KennyYipCoding  10 หลายเดือนก่อน

      Width of image / height of image, is the ratio you wan my to scale

  • @syetoday2942
    @syetoday2942 ปีที่แล้ว

    how do i add the flappybird.css and flappybird.js?

    • @anakayam.45
      @anakayam.45 10 หลายเดือนก่อน

      On head tag you can add link tag and script tag

  • @aasthapant
    @aasthapant 10 หลายเดือนก่อน

    hey i have recently started practicing your vids and i must say you are incredible!! Is there your community page on discord ,insta or anywhere else where we could post over frequent queries and get other's suggestions as well as yours along with project ideas?

  • @sahilprasad4417
    @sahilprasad4417 ปีที่แล้ว

    Why my code is not working

  • @Pritam_Saha03
    @Pritam_Saha03 6 หลายเดือนก่อน

    This game cannot play in mobile please say the solution

  • @emluvskpop
    @emluvskpop ปีที่แล้ว

    I am stuck on how to add the mouse click into this :/ can someone help?

    • @KennyYipCoding
      @KennyYipCoding  ปีที่แล้ว +1

      You need to assign a mouse click event handler to the canvas tag. Check out my other tutorials like wordle or connect 4 to see how to do that!

    • @emluvskpop
      @emluvskpop ปีที่แล้ว

      @@KennyYipCoding thank you! I have been stuck on this for over 10 mins. I appreciate the comment :)

    • @emluvskpop
      @emluvskpop ปีที่แล้ว

      @@KennyYipCoding 1 more question. Where in the code would I add it?

  • @nicholaskh5306
    @nicholaskh5306 ปีที่แล้ว +1

    keep it up bro

  • @hrxm
    @hrxm 4 หลายเดือนก่อน

    thanks a lot!

  • @CryptoGrady
    @CryptoGrady 11 หลายเดือนก่อน

    LFG!! 🔥🔥🔥

  • @tryingcodebang
    @tryingcodebang ปีที่แล้ว +1

    nice sir

  • @omniaabdalaziz7917
    @omniaabdalaziz7917 7 หลายเดือนก่อน

    please send us the link of the whole code pleeeeeeease

    • @KennyYipCoding
      @KennyYipCoding  7 หลายเดือนก่อน

      It’s in the video description in the GitHub link…..

    • @omniaabdalaziz7917
      @omniaabdalaziz7917 7 หลายเดือนก่อน

      send it here pls i am subscribed

    • @omniaabdalaziz7917
      @omniaabdalaziz7917 7 หลายเดือนก่อน

      i am the biggest fan

    • @KennyYipCoding
      @KennyYipCoding  7 หลายเดือนก่อน

      @@omniaabdalaziz7917 github.com/ImKennyYip/flappy-bird

  • @FedericoSantini-fw4kh
    @FedericoSantini-fw4kh 6 หลายเดือนก่อน

    you are the number 1

  • @JosueSilva7
    @JosueSilva7 ปีที่แล้ว

    19:21

  • @marcosek5103
    @marcosek5103 ปีที่แล้ว

    22:58

  • @mxeturbo
    @mxeturbo 11 หลายเดือนก่อน

    Awesome :D

  • @zoku5896
    @zoku5896 9 หลายเดือนก่อน

    thanks!

  • @randomplay9145
    @randomplay9145 ปีที่แล้ว

    God Bless You

  • @PandaWithAnASharp
    @PandaWithAnASharp 8 หลายเดือนก่อน

    Bro you didnt make it mobile device friendly. Wtf

    • @KennyYipCoding
      @KennyYipCoding  8 หลายเดือนก่อน

      Well games are generally designed to be played on a computer/console or as mobile applications. People generally don’t go on mobile websites to play games.

    • @PandaWithAnASharp
      @PandaWithAnASharp 8 หลายเดือนก่อน

      @@KennyYipCoding then why did you adjust it for mobile devices using meta name? That just seemed redundant if you weren't gonna actually make it mobile friendly?

  • @infinite2886
    @infinite2886 ปีที่แล้ว

    Bad game