The Easiest Flappy Bird Tutorial Ever? - Beginner Javascript Game

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ม.ค. 2025

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

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

    Simple and easy, doesn't over-explain, like a tutorial should be! Well done!

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

    Man, your videos are really helping me learning some coding during the quarantine. Thank you.

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

    "Every single hole has a different position", lol. He was gonna laugh at that, lol.

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

      the hand covering the mouth lol

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

    Amazing Tutorial!!! I love these and thank you so much!
    Just for anyone coding along if you run into errors with the jump function it might have been the same as mine. At 9:26 line 24 (at this time 23)is
    if((characterTop>6)&&(counter6)&&(jumpCount

    • @switchtoanotherone
      @switchtoanotherone 2 ปีที่แล้ว

      Thanks a lot!!! I just started to learn JavaScript since today. And I wrote some code as him but it didn’t work. But I could solved it thanks to you!!

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

    Man, you're a genious. I think you are among a few programmers that actually know how to explain the code in "real human language"...you should have had much more followers for all your work that you do! As a sidenote, I'd like a bit more interaction and interactivity between the js code and the actual rendered html especially when you had to show how modifying the position of the elements is reflected on the page...but anyways, you do alot of work to make everyone understand! I liked so much how you imagined the "gape" with that relative div thing, very logical and straightforward as well!! Also, your english is so easy to understand and I am a romanian :) Well done, bro!!

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

    this video is hilarious ive watched it about 20 times now in the span of a while and everytime I watch it it gets better

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

    I love making games in code especially with your tutorials I’ve been making a website where I keep all my games I’ve coded

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

    Nice man, really digging the clean code and simplicity. Thanks for the knowledge

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

    Dude your projects are really helping me start making my own games! I love your content! I figured out your last code, can't wait to give this one a go.

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

      That's so amazing to hear! Thanks so much for the support!

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

      @@KnifeCircus Me too,but i have a question,
      which coding app or browser do you use?

    • @18hridyandeshpande94
      @18hridyandeshpande94 4 ปีที่แล้ว +2

      @@komalkarwa5624 He uses brackets as his code editor

    • @amitsoni7685
      @amitsoni7685 4 ปีที่แล้ว

      @@KnifeCircus
      Debugging your code by looking you video many times
      I can't understand when I copy code for github it does not works and .
      Do you have any suggestions please I want to work on this project because it is cool.
      You also don't used any input that would be taken from flappy bird that made me think like what you wrote in js.

    • @nikeedev
      @nikeedev 3 ปีที่แล้ว

      @@komalkarwa5624 he said in beginning

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

    saw the post yesterday on reddit for this, great video and you explain your thought processes really well! love it, thank you! 🤙

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

    Really cool to see these games take shape - keep them coming Shawn! 💯

  • @김밥김씨-r2q
    @김밥김씨-r2q 2 ปีที่แล้ว

    really really thanks a lot!!! today is the first day to love javascript!!!!!!!!!! I got motivation to prepare my portfolio for webpublisher.. thank you!

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

    So quick question because I can’t figure out why the hole isn’t working, I’m at 3:45 in the video, and have everything up to this point word for word but can’t see the hole when I have the background-color set to white

    • @KnifeCircus
      @KnifeCircus  3 ปีที่แล้ว

      Try going into inspect element and clicking on the hole element in the html and it should highlight it in blue so you can find it, then adjust it from there. Also changing the background colour temporarily will help.

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

    After the jump is added for some reason when I click the ball just stops moving.

  • @simoncordova5655
    @simoncordova5655 4 ปีที่แล้ว

    Hey buddy keep it up - I've been coding for almosot 5 years and I'm a decade older but but enjoying some of your videos - keep it up buds! PS I see that Raptors mat yes sir!

  • @周熙-q1l
    @周熙-q1l 3 ปีที่แล้ว +3

    It's a good demo for my first game and help me practice what I learned.

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

    Can we run the jump function by clicking 'space' key??

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

    how can I make it so it jumps or moves when the spacebar is pressed?

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

    Just to remind you that the var counter is not even initialized at 9:26, so maybe that is why the "Bird" wasn't performing the function jump().
    Thank you very much for the tutorial, it was fun to practice with this game.

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

      i could not understand what the problem is, but thanks to you I found the cause

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

    what a beautiful explanation loved it, you made my day !

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

    Thanks for helping me learn JavaScript!

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

    This works for windows as well, you just need visual studio code

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

      I did it on VIM

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

    this will make a nice weekend project!

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

    Question, when you put the ! To make the html what do you press so it creates it? Is it enter? Because when I do it, it doesn’t make the html layout

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

    How do you jump? It won't do anything? The ball just falls

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

    After the game over part
    The animation for block and hole keeps running
    Can you tell us how to hold it for that interval of time where the alert pops

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

      Did you find a solution?

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

      ​@@irfanmahmood566 i tried

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

    who can even dislike this ??

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

    if there is still a error change "if((characterTop>6)&&(counter6)&&(jumpCount

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

    Really awesome idea and also nice dialogue, intresting and thorough, subbed!

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

      Thanks so much! It really means a lot!

    • @umarjonbakirov6850
      @umarjonbakirov6850 4 ปีที่แล้ว

      @@KnifeCircus can you creat pin ball in javascript

  • @TheSaltyCook
    @TheSaltyCook 2 ปีที่แล้ว

    your videos are super helpful, thank you for making the information so approachable

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

    hello I have a problem whit addEventListener.

  • @mikexue5104
    @mikexue5104 4 ปีที่แล้ว

    my 9 years old son likes this very much. thanks.

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

    it is not working. i dont get space in starting of the script.

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

    I get an error in my Java script saying “parsing error: unexpected token ) hole.addEventListener(‘animationiteration’, () => {

  • @user-ze3ui8ur9h
    @user-ze3ui8ur9h 2 ปีที่แล้ว +1

    so i was just thinking, how do i add a high score thing?

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

    Some pillars have holes and others don't have holes. could you tell me how to fix it

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

    Once again, an epic video by KnifeCircus!

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

    dude, I coded everything in the script.js script but the hole in the block doesn't appear.

    • @KnifeCircus
      @KnifeCircus  4 ปีที่แล้ว

      did u so a margin-top: -20px? making the background color not white would make it easier to see aswell, and then change it back

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

    its a great tutorial thank u for uploading it...I TRIED IT AND IT WORKS SOO FINE!

  • @shobhitpreetamsahoo4267
    @shobhitpreetamsahoo4267 4 ปีที่แล้ว

    Whoa bro!! Thank you for making such videos... It's really helpful for JS beginners.

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

    How did you instantly get by just type div#game?

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

      Emmet abreviation from VS or Brackets

  • @snakgamerz8081
    @snakgamerz8081 3 ปีที่แล้ว

    what should we press to jump

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

    Nice brother!! You are doing great!!Keep coming with more 😎

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

    Hey KnifeCircus, just a question, how can you add a background image to the red square?

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

      hey! in the css instead of
      background-color: red;
      put
      background-image: url(link ur img here);

    • @chogi9860
      @chogi9860 4 ปีที่แล้ว

      wait I can't find the css you are talking about my css only has the canvas css not the square

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

    why's the jumping function not working ? guess. something to do with Mac

  • @burakaltintas5918
    @burakaltintas5918 3 ปีที่แล้ว

    Hi I appreciate what you do
    I have got a question for you, which I would like to know if we can change the ball and how can we actually change it?
    Thank you

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

    Super cool. Thanks for the tutorial!

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

    For some reason, mine's not working. I followed all and triple checked everything and found an error that says "ERROR: Parsing error: Unexpected token) hole.addEventListener('animationliteration', () => " and I dont know what to do. If maybe someone would help me 👉👈

  • @memecroissant5869
    @memecroissant5869 3 ปีที่แล้ว

    thanks this is gonna be my first game thanks dood

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

    why does my bird not jump ?
    i checked all the code twice. when i click it only stops falling for a second. it does not fly up

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

      const canvas = document.getElementById("gameCanvas");
      const ctx = canvas.getContext("2d");
      let gravity = -0.6; // Gravity is negative, pulling the bird upwards
      let jump = 10; // Jump sends the bird downward
      let score = 0;
      let gameOver = false;
      // Bird settings
      const bird = {
      x: 100,
      y: canvas.height / 2,
      width: 40,
      height: 40,
      velocity: 0,
      image: new Image(),
      };
      // Load the bird image
      bird.image.src = 'i.imgur.com/3JRIHaF.png'; // Replace with your own bird image
      // Pipes (Obstacles) settings
      const pipes = [];
      const pipeWidth = 50;
      const pipeGap = 150;
      const pipeSpeed = 2;
      function createPipe() {
      const pipeHeight = Math.random() * (canvas.height - pipeGap - 100) + 50;
      pipes.push({
      x: canvas.width,
      bottomHeight: pipeHeight,
      topHeight: canvas.height - pipeHeight - pipeGap
      });
      }
      setInterval(createPipe, 2000); // Create a new pipe every 2 seconds
      function drawBird() {
      ctx.drawImage(bird.image, bird.x, bird.y, bird.width, bird.height); // Draw the bird
      }
      function drawPipes() {
      pipes.forEach((pipe) => {
      ctx.fillStyle = "#A1887F"; // Pipe color (brown)
      // Bottom pipe (obstacle coming from the bottom)
      ctx.fillRect(pipe.x, canvas.height - pipe.bottomHeight, pipeWidth, pipe.bottomHeight);
      // Top pipe (obstacle coming from the top)
      ctx.fillRect(pipe.x, 0, pipeWidth, pipe.topHeight);
      });
      }
      function movePipes() {
      pipes.forEach((pipe, index) => {
      pipe.x -= pipeSpeed;
      if (pipe.x + pipeWidth < 0) {
      pipes.splice(index, 1); // Remove the pipe when it goes off-screen
      score++; // Increase score when a pipe passes
      }
      });
      }
      function checkCollision() {
      // Check if the bird hits the ground or ceiling
      if (bird.y < 0 || bird.y + bird.height > canvas.height) {
      gameOver = true;
      }
      // Check for collision with the pipes
      pipes.forEach((pipe) => {
      if (
      bird.x + bird.width > pipe.x &&
      bird.x < pipe.x + pipeWidth &&
      (bird.y < pipe.topHeight || bird.y + bird.height > canvas.height - pipe.bottomHeight)
      ) {
      gameOver = true;
      }
      });
      }
      function displayScore() {
      ctx.fillStyle = "black";
      ctx.font = "30px Arial";
      ctx.fillText("Score: " + score, 10, 40);
      }
      function gameLoop() {
      if (gameOver) {
      ctx.fillStyle = "red";
      ctx.font = "50px Arial";
      ctx.fillText("Game Over!", canvas.width / 2 - 150, canvas.height / 2);
      ctx.font = "30px Arial";
      ctx.fillText("Final Score: " + score, canvas.width / 2 -

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

    Does someone know how i can change the speed of falling down ??

  • @soumya00
    @soumya00 4 ปีที่แล้ว

    Sir, event listner is not working properly.....what should I do?

  • @thedrumdude1780
    @thedrumdude1780 3 ปีที่แล้ว

    what do you click to jump

  • @danoverload999yearsago8
    @danoverload999yearsago8 3 ปีที่แล้ว

    When I write the first script.js (different hole position) it won't change

  • @haroldgordon-smith3462
    @haroldgordon-smith3462 4 ปีที่แล้ว

    When I click the character just stops and does not bounce back up??

  • @skeleton-bullfrog
    @skeleton-bullfrog 3 ปีที่แล้ว

    I know I'm late, but whenever I click the ball just stops. any suggestions?

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

    Could you start making links to your code?

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

    Dude your explanation is awesome, thanks.
    and can you plzz upload a video on " i.o " games ? plzz

  • @ilkinhuseynov9011
    @ilkinhuseynov9011 3 ปีที่แล้ว

    how did you make your game web searching? like in google

  • @AnandKumar-bj3zf
    @AnandKumar-bj3zf 3 ปีที่แล้ว

    Can you please tell me how to use an image as your game characters

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

    I think you learn web development in India, Mumbai, am i right?

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

    Can you also use the Math.random to determine how fast the animation goes? Like one time the tubes go by by 1.5 seconds and the other time it takes 3 seconds?

    • @NewLondonMarshall
      @NewLondonMarshall 2 ปีที่แล้ว

      yup! And math.random for the icon for the bird itself, colour of the tubes etc

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

    Hey, great video. Just a quick question, what would be the issue if you used a relative position in the "character". Why did you choose to go with absolute?

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

      because if it were position relative, all the elements before it would push it down the page and then setting the top position would have to be negative numbers, so its just easier to keep as absolute.

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

    I tried to set a custom image using css the function and it just makes everything on screen white. Here is the code. please help! #character{
    width: 20px;
    height: 20px;
    background-image: background-image: url("599.png");
    position: absolute;
    top: 100px;
    border-radius: 50%;
    }

    • @KnifeCircus
      @KnifeCircus  4 ปีที่แล้ว

      you have background-image: twice when u only need it once, thats probably the problem

    • @andrei9115
      @andrei9115 2 ปีที่แล้ว

      Try to use one of the background-position type: contain, cover...etc!

  • @sarveshmishra340
    @sarveshmishra340 2 ปีที่แล้ว

    why we use two html two css and two js file

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

    For some reason every time I click, my character just stops moving instead of jumping. If anyone can help in anyway please do. Thanks!

  • @desolan9968
    @desolan9968 3 ปีที่แล้ว

    I try this on android but nothing's happened
    Can u make a tutorial of basic html games compatible for android

  • @aa-kv2zk
    @aa-kv2zk 4 ปีที่แล้ว +1

    loved it man!

  • @samehzaky
    @samehzaky 2 ปีที่แล้ว

    very simple and effective tutorial, keep up awesome games

  • @BitCloud047
    @BitCloud047 4 ปีที่แล้ว

    this is awesome!! But how do you add a sprite to overlap the dot?

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

    Where do i get java script html and cc+apps

  • @sankalpkapoor9031
    @sankalpkapoor9031 4 ปีที่แล้ว

    Which app are you using which application

  • @IZZYE661
    @IZZYE661 3 ปีที่แล้ว

    When the ball hits the block it does not end the game. Only hitting the bottom ends it. I have triple checked the code. Any idea how I can fix this?

  • @samtianero558
    @samtianero558 4 ปีที่แล้ว

    what app did you use on creating that game

  • @zhangjeremy4969
    @zhangjeremy4969 2 ปีที่แล้ว

    Hi guys, it is a nice video. But my red ball will keep falling out of the game border and the scroll bar on the window will be smaller and smaller, what am I going to solve this problem?

  • @سمارتبورد-ز6ت
    @سمارتبورد-ز6ت 2 ปีที่แล้ว

    Thanks a lot, but is it possible to add a bird image like in the real game?

    • @KnifeCircus
      @KnifeCircus  2 ปีที่แล้ว

      yes instead of background-color use background-image!

  • @Zachary-it8cx
    @Zachary-it8cx 2 ปีที่แล้ว

    what button to the jump

  • @neginma6285
    @neginma6285 2 ปีที่แล้ว

    THANK YOUUUUUUUUUUUUUUUUU. you saved my LIFE 😂😍

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

    how can u type the star on keyboard??

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

    Thank you for sharing ur knowledge

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

    Bro it's a miracle cz my name is also Shawn ❤

  • @ilkinhuseynov9011
    @ilkinhuseynov9011 3 ปีที่แล้ว

    can you make video how to put web or game in google

  • @marcinooooo
    @marcinooooo 3 ปีที่แล้ว

    Tutorial on How to make a leaderboard? Great vid btw!

  • @RamiYaFF
    @RamiYaFF 4 ปีที่แล้ว

    Can you make a video about change website theme as your 2nd Version website using css

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

      Sure! Thats an interesting video idea. The way I did it on version 2 probably isn't the best way, so maybe a video showing multiple ways to do it with pros and cons of each!

    • @RamiYaFF
      @RamiYaFF 4 ปีที่แล้ว

      @@KnifeCircus Thanks

  • @zitrix7848
    @zitrix7848 3 ปีที่แล้ว

    "Uncaught ReferenceError: counter is not defined" please help

  • @nair38
    @nair38 4 ปีที่แล้ว

    This was my first working game :D

  • @opivaan8061
    @opivaan8061 2 ปีที่แล้ว

    how to publish it on google play console?

  • @greencodeliz6049
    @greencodeliz6049 4 ปีที่แล้ว

    Thank you!🥰
    your videos are really helpful

  • @_xoi.d_
    @_xoi.d_ 4 ปีที่แล้ว

    do you use a mac book or a I Mac

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

    I think I copied the code correctly but when I click nothing happens.

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

    Counter is not defined
    Edit: create a VAR named counter and give it a value of 0.

  • @skullcookie5369
    @skullcookie5369 3 ปีที่แล้ว

    What are the controls

  • @mioheinola4111
    @mioheinola4111 3 ปีที่แล้ว

    any help my character keeps rising up when i jump

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

    please add code for start ,pause and restart button for any game.

    • @KnifeCircus
      @KnifeCircus  4 ปีที่แล้ว

      rajendra kumar singh Thats for you to add! im just here to make the games

  • @ShyamnaikGuguloth
    @ShyamnaikGuguloth 4 ปีที่แล้ว

    Awesome videos .... keep going really loving the videos

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

      Glad you like them!

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

    Why mine is not jumping

  • @ryangehani7893
    @ryangehani7893 3 ปีที่แล้ว

    your website is blocked and the arrows do not work

  • @shobhitpreetamsahoo4267
    @shobhitpreetamsahoo4267 4 ปีที่แล้ว

    Next game u can try to make a hangman's game.... Simple hangman's game with just JS...

  • @michaelp.channel331
    @michaelp.channel331 4 ปีที่แล้ว

    I love watching your videos! I learned a lot, I'm hoping you will upload another videos sooner!

  • @Almaguer.
    @Almaguer. 2 ปีที่แล้ว

    Really cool video!