Code-It-Yourself! Flappy Bird (Quick and Simple C++)

Поделиться
HTML-код
  • Опубликовано: 27 янв 2025

Комментарии • 185

  • @Brandlin
    @Brandlin 6 лет назад +135

    Javid - wonderful to see you showing development and concentrating on the game engine not the graphics. As an old school amateur programmer brought up on a 32k BBC micro and later learned C and now python its a breath of fresh air to see someone actually understands and explains the physics and not just the flashy animation.
    Oh, love the great sarcastic British humour too.

    • @javidx9
      @javidx9  6 лет назад +17

      lol, I loved my BBC Micro - I think it should be compulsory for all programmers!

  • @dillonreed6860
    @dillonreed6860 4 года назад +159

    My favorite part are his negative comments of the game😂

  • @LiangchengYin
    @LiangchengYin 4 года назад +12

    I'm here to finish my C++ assignment. The teacher asked us to code a game ourselves. It's not easy since he didn't teach us anything about making a game. Therefore, your video is of great help to me, thx so much.

  • @evensandvik6140
    @evensandvik6140 5 лет назад +369

    When you refuse to learn a graphics library

    • @noellekkar903
      @noellekkar903 4 года назад +5

      😂😂

    • @Thebasicmaker
      @Thebasicmaker 4 года назад +6

      I Still don't understand why usefull commands must be in libraryes...well I do understand but a language should come with some basic graphics at least

    • @mustnz998
      @mustnz998 4 года назад +8

      @@Thebasicmaker First time?

    • @Thebasicmaker
      @Thebasicmaker 4 года назад +1

      @@mustnz998 i did study C++ just for a few days then went back to B.A.S.I.C!

    • @DanielBrotherston
      @DanielBrotherston 4 года назад +4

      When you understand why languages don't come with graphics builtins, then you will better understand how the systems you are programming work and are organized.

  • @linkinparkrulz2275
    @linkinparkrulz2275 5 лет назад +3

    These are awesome tutorials. Many code instructions on RUclips rush through the main details and they make it impossible for beginners to figure things out. I like that I can just plug things in and switch up the parameters to see how the fundamentals work. Thanks so much.

  • @thegigasurgeon
    @thegigasurgeon 5 лет назад +26

    😂 when he says "should you wish to subject yourself to such a miserable form of entertainment"

  • @anandk1977
    @anandk1977 6 лет назад +36

    This is the first game i made in C++. Thanks man for these tutorials. My c++ journey is off to a good start, or at least I hope so.

    • @javidx9
      @javidx9  6 лет назад +8

      Hi Anand, no problem, Good luck with your journey - just take it at a pace that's right for you, and it will work out fine!

    • @finrodable
      @finrodable 4 года назад +2

      how is your c++ nowadays? :)

    • @crusial1281
      @crusial1281 4 года назад

      @ what happened

    •  4 года назад

      @@crusial1281 i gave up

    • @crusial1281
      @crusial1281 4 года назад

      @ wdym was it a project u wanted to make?

  • @salmanahmad1
    @salmanahmad1 6 лет назад +10

    i have been looking for this for a long time ,thanks man u rock

    • @javidx9
      @javidx9  6 лет назад +4

      No problem Dark Energy, Cheers! (but flappy bird, really? just kidding :D)

  • @Altekameraden79
    @Altekameraden79 Год назад +1

    Apart from Eve Online I hate games, but learning C++ now for scientific computing w/a MATLAB background, these projects really teach dynamic ideals better than stale apps. For any future viewers, learn C or C++ before MATLAB or Python.

  • @linowmik
    @linowmik 6 лет назад +34

    after seeing this I'd like to code it myself. thx~

    • @javidx9
      @javidx9  6 лет назад +7

      Nice one, good luck!

  • @BrekMartin
    @BrekMartin 7 лет назад +46

    Someone with an 80x48 display would probably feel the same way. What did they do to deserve this punishment? :D

  • @CoolDude911
    @CoolDude911 3 года назад

    Velocity should be positive and gravity negative. From a young age I have always dreamed of being a flappy bird escaping to the heavens. Now with this video I am finally able to do it.

    • @javidx9
      @javidx9  3 года назад +4

      Don't forget in computer game world's the y axis is inverted!

  • @HimanshuSharma-tm2ms
    @HimanshuSharma-tm2ms 4 года назад

    Your way of naming variables like f before float ones is really good..

    • @diveinsidetech
      @diveinsidetech 4 года назад

      Actually, I think he has used UE (unreal engine) before and there that's normal. I like it too! Especially when you changing the types of variables. But why does he use n for int instead of i?

    • @rastaarmando7058
      @rastaarmando7058 4 года назад

      @@diveinsidetech every book i read about this language uses n for integers instead of i.

  • @BrekMartin
    @BrekMartin 8 месяцев назад

    Hmm... Lynx doesn't have a float variable type, but it does have a 102 pixel high screen (a small number) and some fairly large integers if the calculations are few. Someone did have a go at Flappy Bird for it, and it's kind of there. I must take note... I like the game in small doses when it's right. Like all games :D

  • @mvd3517
    @mvd3517 2 года назад +1

    I was searching for the song ”The Bird Code” by VOITH and found this 👍 🦅

  • @xkilla911
    @xkilla911 6 лет назад +6

    cool replica! though I do notice your flappy game is exceedingly difficult... it's hard passing through the pipes!
    i believe the flap escalation is higher than the gap between the pipes, making this harder than the original game!

  • @Zyk0tiK
    @Zyk0tiK 7 лет назад +17

    Hey javidx dude, I'm really enjoying your videos, but I'm wondering if you'll ever write a port of your game engine to run in a Linux terminal? Relying on Windows.h means I can't join in :(

    • @javidx9
      @javidx9  7 лет назад +2

      Hi Steven, if I got a great British pound every time someone mentioned the L word. Lol, I'm going to investigate Linux but I don't think I could do much better than those that have already tried. Never say never though! Thanks for the support.

    • @ym1118
      @ym1118 7 лет назад +2

      You can use ANSI escape characters to set the mouse position, background colors, and get a lot of data.
      So you may want to look into that.

  • @NexGenSlayer
    @NexGenSlayer 7 лет назад +6

    Can you show how to implement levels for a game with OLC with a menu?

    • @javidx9
      @javidx9  7 лет назад +1

      Hi NexGenSlayer, That's an interesting idea. Yes. I will think of something.

  • @eggaming8292
    @eggaming8292 5 лет назад +5

    Flappy bird can flap before having a negative velocity. He can flap again and again. I think that's how it worked in the original game. Btw flappy bird isnt a rubbish its a masterpiece.

  • @Thebasicmaker
    @Thebasicmaker 4 года назад +2

    Windows commnd prompt...you mean ms.dos?

  • @xiao_sings
    @xiao_sings 5 лет назад +1

    Love Your Videos, Dude!.

  • @vx.nocturne
    @vx.nocturne 4 года назад +1

    It doesnt work, It says no file directory

  • @stutteringcris468
    @stutteringcris468 4 года назад

    Im interested in learning python, well, coding in general and this is already so exciting!! AHHHHHH!!!

  • @ciceroalves9076
    @ciceroalves9076 6 лет назад +7

    could you do a video about hack in games? ive always found it interesting.

    • @javidx9
      @javidx9  6 лет назад +15

      I could, but it might not be as interesting as you would hope - Firstly, no matter which game I choose, it will be the wrong one! and Secondly, hacks are quite specific to individual games. That said, it might be interesting to do a video about memory analysis and interception in general, so i'll add it to the list.

  • @khanhchung4103
    @khanhchung4103 5 лет назад

    Dear Mr. Javidx9, on the part if( fBirdAcceleration >= fGravity ). Why did you not just let fBirdAcceleration = fGravity at the first place? Sorry for my bad English.

    • @javidx9
      @javidx9  5 лет назад +1

      The acceleration of the bird changes. It needs to move both up and down. The line you highlight is to set a maximum descent rate, which is a gameplay feature to stop the descent from becoming so fast the player cant actually play.

    • @khanhchung4103
      @khanhchung4103 5 лет назад

      @@javidx9 Thank you Mr javidx9. One more question that why did fBirdVelocity = -fGravity / 4.0f? I mean why is 4.0f?

    • @javidx9
      @javidx9  5 лет назад

      Again its a gameplay tuning factor. Changing this constant affects how the game plays, and needs tuning until it "feels" how you want the player experience to be.

    • @khanhchung4103
      @khanhchung4103 5 лет назад +3

      ​@@javidx9 I got it. Thank you Mr Javidx9. I'm trying to make a clone flappy bird. First, I used very simple physics for my bird and it doesn't work well. So that's why your video is really helpful. Anyway, I just read your code again, I realized my first question was dumb @@

  • @yigithanmete8790
    @yigithanmete8790 6 лет назад

    I have wirtten it. But there is a problem that the map does not re-upload. After you pass 3 obstacles, the game crashes. Any solutions to this?

  • @HimanshuSharma-tm2ms
    @HimanshuSharma-tm2ms 4 года назад +1

    @javidx9 how to enable unicode for compiler if you are not using VS:( . Please answer!

    • @jerinmathew995
      @jerinmathew995 3 года назад

      Did you get any solution ? I am using MingW g++ compailer.

    • @HimanshuSharma-tm2ms
      @HimanshuSharma-tm2ms 3 года назад

      @@jerinmathew995 No I tried a lot but VScode is the only way we can do it :/

    • @javidx9
      @javidx9  3 года назад

      Define UNICODE as part of your compile command...

  • @cruestoddard7614
    @cruestoddard7614 2 года назад

    where the heck is the previous code from??

  • @KJ7JHN
    @KJ7JHN 3 года назад

    Do you have any videos on Turbo C++? ASCII fps? Thanks.

    • @javidx9
      @javidx9  3 года назад

      2 videos on ASCII FPS yes, none on Turbo C++, must confess, didn't realise it was still going

  • @williamdeschenes3627
    @williamdeschenes3627 6 лет назад +1

    Hi, i know im late on the vid but when i try to run the project it says « Cannot open include file: ‘olcConsoleGameEngine.h ‘ : no such file or directory». Thats what it says. Idk what to do im a beginnee

    • @javidx9
      @javidx9  6 лет назад

      Hi William, you will need to download the source file from my github. The link is in the description.

    • @williamdeschenes3627
      @williamdeschenes3627 6 лет назад

      Thank you !

  • @jerinmathew995
    @jerinmathew995 3 года назад

    Hi David, How to enable Unicode for compailer. I am using mingW g++. Kindly suggest. Thanks.

  • @BluesManPeich
    @BluesManPeich 4 года назад

    "Those people were suckers."

  • @praniljadhav357
    @praniljadhav357 5 лет назад +2

    Why?!
    T_T this literally hurts more than death.
    Now whenever I'm binging (weird kid I know) this playlist Ill have to encounter this devil of a video idea. I'll drop a like for making this and making us suffer.

  • @sknchn9901
    @sknchn9901 5 лет назад

    which book you would prefer for a java developer? the original from bjorn?

  • @saptomudito6779
    @saptomudito6779 5 лет назад +2

    great tutorial, sir. more video please :)

    • @javidx9
      @javidx9  5 лет назад

      lol Sapto, ive made over 100 XD

  • @devanandhunnur8916
    @devanandhunnur8916 5 лет назад

    sir ,in which version ,you didi it 2010,2015 ????

  • @jonasstrabel
    @jonasstrabel 6 лет назад +2

    You lost me at 0.0 !! is there any beginner things to understand better what you do??

    • @javidx9
      @javidx9  6 лет назад +1

      Hi Jonas, Ive deliberately avoided doing complete beginner videos, as there are plenty of good resources. However learning to code via RUclips is not ideal, I really recommend finding a book that feels right for you.

    • @jonasstrabel
      @jonasstrabel 6 лет назад

      @@javidx9 okay thank you!

    • @jonasstrabel
      @jonasstrabel 5 лет назад

      @@wahomevictor6589 thank you too!

  • @richardvelasquez2676
    @richardvelasquez2676 3 года назад

    Sir can I ask how to put leaderboard at the end of the game? Plss I need your help

  • @sivavidhyamogankumar60
    @sivavidhyamogankumar60 7 лет назад +1

    Please tell me is the program the same if it is done in GEANY?

    • @javidx9
      @javidx9  7 лет назад

      Hi Sivavidhya, if GEANY is capable of compiling modern C++ code in a windows environment then I see no reason it should not work - I'm not familiar with the tool I'm afraid.

  • @Goregreet
    @Goregreet 5 лет назад

    Hey im trying to use your sprite editor to implement my own bird sprite for this game but the editor doesnt seem to be able to save sprites i keep pressing on f10 but nothing is being saved is there a simple solution for this?

    • @javidx9
      @javidx9  5 лет назад

      Did you program in a valid filename?

  • @BAMBAMBAMBAMBAMval
    @BAMBAMBAMBAMBAMval 2 года назад

    First ever copy of flappybird to run at over 7k fps???

  • @txorimorea3869
    @txorimorea3869 4 года назад +2

    What is really sad is that flappy bird is more fun to play than many AAA games out there XD XD XD

  • @PMCdev
    @PMCdev 4 года назад

    how do u debugge it as soon as i debug i get this
    ERROR: Screen Height / Font Height Too Big
    The operation completed successfully.
    debugged on visual studio code debugger

    • @javidx9
      @javidx9  4 года назад

      Well its telling you what the problem is. You are trying to create a console that is too big for your display. Try halving the fontw and fonth values in construct console function.

    • @PMCdev
      @PMCdev 4 года назад

      @@javidx9 rhanx for the quick response will check it ou

  • @lancate4566
    @lancate4566 4 года назад +2

    Where I can find "olcConsoleGameEngine.h" for this game?

    • @diveinsidetech
      @diveinsidetech 4 года назад

      On GitHub. He put it there, although he puts the latest version, so I don't know, but he might have some different code.

  • @tiriotis
    @tiriotis 5 лет назад +1

    Is there any way to run this in linux ?

    • @javidx9
      @javidx9  5 лет назад

      Sure, use the olcConsoleGameEngineSDL.h file instead.

  • @rizalabdurrahman8317
    @rizalabdurrahman8317 7 лет назад +1

    hei javidx dude, i'm really enjoy video have you made and that was simply explanation, but i have a request to next video of Code-it-yourself is Saint venant equation, something to visualized motion of water, thanks :))

    • @javidx9
      @javidx9  7 лет назад +2

      Hi Rizal, thanks for the suggestion! I don't think it'll be the next video, but I think a couple of fluid approximation algorithms would make for good videos.

  • @xehn224
    @xehn224 3 года назад

    How do i download olcConsoleGameEngine.h?

    • @tomnetin7511
      @tomnetin7511 8 месяцев назад

      Do you understand how?

  • @abbasjradi5001
    @abbasjradi5001 3 года назад

    I am new to programming, i know some basics but i hope someone can help me with this, as i look at the source code, i notice that there are a whole "olcConsoleGameEngine" written beforehand, have i to read this whole header file in order to be able to track with the rest of the code, secondly can we really progress if everything almost written by someone else?

    • @javidx9
      @javidx9  3 года назад

      99% of programming is using things that already exist. No you don't need to read the header before using it.

  • @МішаШелест-к1ж
    @МішаШелест-к1ж 4 года назад

    Man, you are the best

  • @maximborisenko2590
    @maximborisenko2590 5 лет назад

    hi,what to do?
    Exception thrown: write access violation.
    this->m_bufScreen was 0x1110112.

    • @javidx9
      @javidx9  5 лет назад +2

      You are creating a console that is too big for your display. Try halving the fontw and fonth values in construct console function.

    • @maximborisenko2590
      @maximborisenko2590 5 лет назад

      @@javidx9 thank you

  • @toastyPredicament
    @toastyPredicament 2 года назад

    I doubt you can bring down a sat by restarting its software. They hover in orbit...

  • @bobbylow175
    @bobbylow175 4 года назад

    can you program in a noclip cheatcode.

  • @nablislim4294
    @nablislim4294 3 года назад

    How Can this work on linux

  • @spzcortex628
    @spzcortex628 7 лет назад

    I am using mono develop and every time I had the code put in it said error

    • @javidx9
      @javidx9  7 лет назад

      Is your compiler up to date? Does it support C++14 and winapi fully?

  • @adityapandari5395
    @adityapandari5395 5 лет назад

    Sir can we do this program in code block software ??? Pls reply sir

  • @syalin4433
    @syalin4433 5 лет назад

    how do I use the engine, there is no file to download or anything

    • @javidx9
      @javidx9  5 лет назад

      Link in video description. All source on github. It's a single header file you just download and include in your project.

    • @adityapandari5395
      @adityapandari5395 5 лет назад

      Sir how to include or where to include in out project

  • @janalbertgibson3192
    @janalbertgibson3192 6 лет назад +1

    how its made :Flappy Bird

    • @javidx9
      @javidx9  6 лет назад

      lol I love that show!

    • @janalbertgibson3192
      @janalbertgibson3192 6 лет назад

      Me too.
      You almost sound like that narrator...
      btw... *awesome* videos man

  • @projektraven4149
    @projektraven4149 4 года назад

    And that ladies and gents is why ill become an artist and not a programmer

  • @alejandroflorez1718
    @alejandroflorez1718 3 года назад

    Hello guys , i am a newby, i copied and pasted the code, but it gave me the error: 6 34 [Error] olcConsoleGameEngine.h: No such file or directory.

    • @tomnetin7511
      @tomnetin7511 8 месяцев назад

      Do you understand how?

  • @spjewkes
    @spjewkes 7 лет назад +1

    Another great video. However, I'm slightly perplexed as to why you'd go out of your way to write a game that you really don't like :)

    • @javidx9
      @javidx9  7 лет назад +5

      Thanks Steve. I'd love to say it's a positive example of mental discipline, finishing a project you don't like against the odds, and that it's good for you to do this from time to time. But in reality I wanted a code-it-yourself video less than 20 minutes that I could inject some wry humour into, flappy bird fit the bill! 😁

  • @yaoyao-ainiyo
    @yaoyao-ainiyo 4 года назад

    I just knock the code into my vs, but don't know most of them, lol, but no matter how, thank you.

  • @adityapandari5395
    @adityapandari5395 5 лет назад

    Sir ,can you please provide whole program in one picture please???

    • @javidx9
      @javidx9  5 лет назад

      Download the source from the description

    • @adityapandari5395
      @adityapandari5395 5 лет назад

      Sir can you please tell me which software you have used for coding this program??any other software can we use???

    • @javidx9
      @javidx9  5 лет назад

      Its visual studio, free, from microsoft

    • @adityapandari5395
      @adityapandari5395 5 лет назад

      Code is c++ right sir??

    • @javidx9
      @javidx9  5 лет назад

      It is yes

  • @lepureur4657
    @lepureur4657 4 года назад

    I have this unicode issue:/

  • @devanandhunnur8916
    @devanandhunnur8916 5 лет назад

    plz reply 2015 or 2010??

  • @robertboran6234
    @robertboran6234 7 лет назад +1

    Nice

  • @5a_fabioshelbyaulnurhilmi93
    @5a_fabioshelbyaulnurhilmi93 4 года назад

    Hai.. can you give me the script of this game?

    • @javidx9
      @javidx9  4 года назад

      Link is in the description

  • @spzcortex628
    @spzcortex628 7 лет назад +1

    I don't know

  • @spzcortex628
    @spzcortex628 7 лет назад

    I want to code so bad but have a Windows vista

  • @uniqueshorts2256
    @uniqueshorts2256 2 года назад

    Is it real Or what

  • @__hannibaalbarca__
    @__hannibaalbarca__ 2 года назад

    *HELLO*
    _l learn a lot from your video_
    I m going to write on class behave same sfml windows and methods draw and display .
    Thanks.

  • @FishNChips
    @FishNChips 6 лет назад

    it said that there were build errors?

  • @k9ijou
    @k9ijou 5 лет назад +3

    So, it was fun learning coding, I have to retire now, this shit is not for me, see you guys

  • @spzcortex628
    @spzcortex628 7 лет назад

    how do i build it it says error

    • @javidx9
      @javidx9  7 лет назад +1

      Hi Crazyvides, You'll have to offer more than that if you need help!

  • @ianciti
    @ianciti 5 лет назад +1

    i don't wanna know how to code flappy bird, i wanna know how to code something like zelda 2

    • @javidx9
      @javidx9  5 лет назад +3

      XD Then why are you watching this?

    • @ianciti
      @ianciti 5 лет назад +1

      @@javidx9 because you're very educational, and also i wanted to make a request. could you do a tutorial on a full on side scrolling platformer/RPG?

    • @javidx9
      @javidx9  5 лет назад +1

      Well i have a whole series on RPGs, and a popular video on side scrolling platform games so id start there 😁

  • @mallikarjunsomanni1584
    @mallikarjunsomanni1584 5 лет назад

    How to include 'olcConsoleGameEngine.h' to project

    • @kriluk1214
      @kriluk1214 5 лет назад

      You need to download it from his github page, then put it in the same directory as your .cpp file, after that include it in the code.

  • @ashutoshaswal
    @ashutoshaswal 5 лет назад +1

    haha! 😂😂Ending👏👏

  • @brianx2405
    @brianx2405 4 года назад +1

    ahhhahahah 10:50

  • @entity5209
    @entity5209 4 года назад

    Code it yourself more like copy paste it yourself

    • @javidx9
      @javidx9  4 года назад +2

      Awww, thats nice! You want to watch me type it out character by character?

    • @entity5209
      @entity5209 4 года назад

      @@javidx9 I want u to code it yourself

    • @entity5209
      @entity5209 4 года назад

      @@javidx9 ruclips.net/video/MAlSjtxy5ak/видео.html