Code-It-Yourself! Flappy Bird (Quick and Simple C++)
Ғылым және технология
This video shows an implementation of, sigh, Flappy Bird in C++ at the command prompt.
Source: github.com/OneLoneCoder/Javid...
Blog: www.onelonecoder.com
Twitter: @javidx9
Twitch: javidx9
Пікірлер: 184
My favorite part are his negative comments of the game😂
@CodeDisease
2 жыл бұрын
aka the entire video
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
6 жыл бұрын
lol, I loved my BBC Micro - I think it should be compulsory for all programmers!
These are awesome tutorials. Many code instructions on KZread 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.
When you refuse to learn a graphics library
@noellekkar903
4 жыл бұрын
😂😂
@Thebasicmaker
3 жыл бұрын
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
3 жыл бұрын
@@Thebasicmaker First time?
@Thebasicmaker
3 жыл бұрын
@@mustnz998 i did study C++ just for a few days then went back to B.A.S.I.C!
@DanielBrotherston
3 жыл бұрын
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.
i have been looking for this for a long time ,thanks man u rock
@javidx9
6 жыл бұрын
No problem Dark Energy, Cheers! (but flappy bird, really? just kidding :D)
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.
after seeing this I'd like to code it myself. thx~
@javidx9
5 жыл бұрын
Nice one, good luck!
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
6 жыл бұрын
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
4 жыл бұрын
how is your c++ nowadays? :)
@crusial1281
3 жыл бұрын
@Circuit Carbon what happened
@crusial1281
3 жыл бұрын
@Circuit Carbon wdym was it a project u wanted to make?
@DarkReaperK97
3 жыл бұрын
@Circuit Carbon what do you mean you gave up? O.O
😂 when he says "should you wish to subject yourself to such a miserable form of entertainment"
Your way of naming variables like f before float ones is really good..
@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
3 жыл бұрын
@@DiveInsideTech every book i read about this language uses n for integers instead of i.
Someone with an 80x48 display would probably feel the same way. What did they do to deserve this punishment? :D
Love Your Videos, Dude!.
@javidx9
4 жыл бұрын
Cheers Xiao!
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.
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!
Man, you are the best
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
6 жыл бұрын
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
6 жыл бұрын
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.
Can you show how to implement levels for a game with OLC with a menu?
@javidx9
6 жыл бұрын
Hi NexGenSlayer, That's an interesting idea. Yes. I will think of something.
which book you would prefer for a java developer? the original from bjorn?
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
3 жыл бұрын
Don't forget in computer game world's the y axis is inverted!
great tutorial, sir. more video please :)
@javidx9
4 жыл бұрын
lol Sapto, ive made over 100 XD
Im interested in learning python, well, coding in general and this is already so exciting!! AHHHHHH!!!
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
6 жыл бұрын
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.
I was searching for the song ”The Bird Code” by VOITH and found this 👍 🦅
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.
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?
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
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
5 жыл бұрын
Did you program in a valid filename?
What is really sad is that flappy bird is more fun to play than many AAA games out there XD XD XD
Hi David, How to enable Unicode for compailer. I am using mingW g++. Kindly suggest. Thanks.
sir ,in which version ,you didi it 2010,2015 ????
Please tell me is the program the same if it is done in GEANY?
@javidx9
6 жыл бұрын
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.
Nice
Sir can I ask how to put leaderboard at the end of the game? Plss I need your help
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.
Do you have any videos on Turbo C++? ASCII fps? Thanks.
@javidx9
2 жыл бұрын
2 videos on ASCII FPS yes, none on Turbo C++, must confess, didn't realise it was still going
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
5 жыл бұрын
Hi William, you will need to download the source file from my github. The link is in the description.
@williamdeschenes3627
5 жыл бұрын
Thank you !
I just knock the code into my vs, but don't know most of them, lol, but no matter how, thank you.
"Those people were suckers."
Windows commnd prompt...you mean ms.dos?
@javidx9 how to enable unicode for compiler if you are not using VS:( . Please answer!
@jerinmathew995
3 жыл бұрын
Did you get any solution ? I am using MingW g++ compailer.
@HimanshuSharma-tm2ms
3 жыл бұрын
@@jerinmathew995 No I tried a lot but VScode is the only way we can do it :/
@javidx9
3 жыл бұрын
Define UNICODE as part of your compile command...
can you program in a noclip cheatcode.
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
2 жыл бұрын
99% of programming is using things that already exist. No you don't need to read the header before using it.
*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.
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
5 жыл бұрын
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
5 жыл бұрын
@@javidx9 Thank you Mr javidx9. One more question that why did fBirdVelocity = -fGravity / 4.0f? I mean why is 4.0f?
@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
5 жыл бұрын
@@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 @@
Sir can we do this program in code block software ??? Pls reply sir
@user-kx5es4kr4x
4 жыл бұрын
yes
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
6 жыл бұрын
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! 😁
could you do a video about hack in games? ive always found it interesting.
@javidx9
6 жыл бұрын
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.
where the heck is the previous code from??
Is there any way to run this in linux ?
@javidx9
4 жыл бұрын
Sure, use the olcConsoleGameEngineSDL.h file instead.
hi,what to do? Exception thrown: write access violation. this->m_bufScreen was 0x1110112.
@javidx9
5 жыл бұрын
You are creating a console that is too big for your display. Try halving the fontw and fonth values in construct console function.
@maximborisenko2590
5 жыл бұрын
@@javidx9 thank you
It doesnt work, It says no file directory
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
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
4 жыл бұрын
@@javidx9 rhanx for the quick response will check it ou
I am using mono develop and every time I had the code put in it said error
@javidx9
6 жыл бұрын
Is your compiler up to date? Does it support C++14 and winapi fully?
haha! 😂😂Ending👏👏
how do I use the engine, there is no file to download or anything
@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
5 жыл бұрын
Sir how to include or where to include in out project
How Can this work on linux
I don't know
I doubt you can bring down a sat by restarting its software. They hover in orbit...
I have this unicode issue:/
Where I can find "olcConsoleGameEngine.h" for this game?
@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.
And that ladies and gents is why ill become an artist and not a programmer
How do i download olcConsoleGameEngine.h?
@tomnetin7511
Ай бұрын
Do you understand how?
how its made :Flappy Bird
@javidx9
6 жыл бұрын
lol I love that show!
@janalbertgibson3192
6 жыл бұрын
Me too. You almost sound like that narrator... btw... *awesome* videos man
plz reply 2015 or 2010??
@javidx9
5 жыл бұрын
2017
Sir ,can you please provide whole program in one picture please???
@javidx9
5 жыл бұрын
Download the source from the description
@adityapandari5395
5 жыл бұрын
Sir can you please tell me which software you have used for coding this program??any other software can we use???
@javidx9
5 жыл бұрын
Its visual studio, free, from microsoft
@adityapandari5395
5 жыл бұрын
Code is c++ right sir??
@javidx9
5 жыл бұрын
It is yes
First ever copy of flappybird to run at over 7k fps???
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
Ай бұрын
Do you understand how?
Hai.. can you give me the script of this game?
@javidx9
3 жыл бұрын
Link is in the description
it said that there were build errors?
You lost me at 0.0 !! is there any beginner things to understand better what you do??
@javidx9
5 жыл бұрын
Hi Jonas, Ive deliberately avoided doing complete beginner videos, as there are plenty of good resources. However learning to code via KZread is not ideal, I really recommend finding a book that feels right for you.
@jonasstrabel
5 жыл бұрын
@@javidx9 okay thank you!
@jonasstrabel
5 жыл бұрын
@@wahomevictor6589 thank you too!
I want to code so bad but have a Windows vista
how do i build it it says error
@javidx9
6 жыл бұрын
Hi Crazyvides, You'll have to offer more than that if you need help!
How to include 'olcConsoleGameEngine.h' to project
@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.
Is it real Or what
ahhhahahah 10:50
So, it was fun learning coding, I have to retire now, this shit is not for me, see you guys
i don't wanna know how to code flappy bird, i wanna know how to code something like zelda 2
@javidx9
5 жыл бұрын
XD Then why are you watching this?
@ianciti
5 жыл бұрын
@@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
5 жыл бұрын
Well i have a whole series on RPGs, and a popular video on side scrolling platform games so id start there 😁
Code it yourself more like copy paste it yourself
@javidx9
3 жыл бұрын
Awww, thats nice! You want to watch me type it out character by character?
@entity5209
3 жыл бұрын
@@javidx9 I want u to code it yourself
@entity5209
3 жыл бұрын
@@javidx9 kzread.info/dash/bejne/f3WgtcytqNybkc4.html