Beginner Godot Tutorial - Make Flappy Bird in 12 Minutes!
HTML-код
- Опубликовано: 30 сен 2023
- Learn the basics of Godot by making a flappy bird clone in this tutorial.
The code for the game is built from scratch and will cover setting up the different scenes and their nodes as well as linking everything together using signals. I will add a pipe generator as well as collision detection for the pipes and ground.
Code and assets for this video: github.com/russs123/flappy_bi...
Keep doing complete projects on Godot 4, you are gold!
Thank you for sharing your knowledge and for being straightforward.
Thank you so much for the guide!
I just tried godot this year and haven't fully grasp the UI yet. But, this video explained it very well for a beginner. of course it's probably will be better if you can slow it down at some specific point.
I'll definitely watch the other guide to make games!
i agree
:)
Great tutorial, I like that you didn't spend too much time explaining concepts. Great when coming from Unity
Thank you very much, I'd say one of the best explained. You do need a high level of attention to detail, it took me two attempts to make it work (says a lot about me i guess).
I can understand the editing took a lot of time and effort but in some places it was not easy to follow so lowering the setting playback speed helped.
Having said that this was a brilliant video and great to see someone make a complete game with all of the code available.
Keep up the great work it is appreciated!
Thanks! The funny thing is that with all the editing, this video took me about as long to make as it would have if I made a full length tutorial 😅
Glad you found it useful though!
I used this to spawn in a ball for a new plinko clicker I am making. It was super helpful. Thanks!
Nice and clearly explained! Everything worked here
Very helpful and I did learn! Thank you!
Glad to hear!
this short video style is awesome. But it helps if one knows a little Godot. i have used Godot 4 for just a week and i can easily follow along. However the classic ross will work effectively for non beginners. either way this is super cool.
Thanks, Russ, for sharing your knowledge. I'm trying to convert a video poker app I wrote in Python/Pygame to Godot 4. After Snake and TicTacToe, I'm finally 'getting' Godot a little bit. I haven't watched Flappy Bird yet, but I'm sure it'll be helpful.
Glad to hear it's starting to come together. I switched from pygame to Godot not too long ago so it's a learning curve for me too!
These tutorials are really good.
I do have one issue though.
In this game and the dino run, when I plug the same data, the game movement speed is way faster.
Example, I had the same numbers, and the pipes moved at blistering speeds.
Tengo un problema, mis tubos se colocan muy abajo dejando poco y casi nada de espacio para que el ave pueda pasar, cómo lo puedo solucionar?
I've been playing Marshmallow Land (it's a built-in hidden Android game) so it's quite good timing that you make this. xD
I had to google that, can't believe I never heard of it before...I've had an android phone for years 😅. Looks like a very similar concept game.
I would definitely do code along. it seems like your niche. because people like me who are web developers and want to dabble in video game creation... so those people will love code explanations and walk throughs to increase their knowledge
do you know why when pipes spawn sometimes there are space between pipes and ground ? and when new game pipe spawn in front of bird ?
Hey Russ, I'd like to ask about the formulas in your tutorial, like:
`if flying:
set_rotation(deg_to_rad(velocity.y * 0.05))`
or
`pipe.position.y = (screen_size.y - ground_height) / 2 + randi_range(-PIPE_RANGE, PIPE_RANGE)`
As a newcomer to game development, I'm curious about their origin. Are these from your game dev experience, established best practices, or custom calculations for this project? Those techniques work great, and I'd like to learn more about them. Thanks!
Hello. I'm self taught so this stuff comes from previous experience making these kinds of games (I made flappy bird in pygame a couple years back) and also just trying different things and refining them until they work.
I try to avoid manually entering numbers and instead use the data available in the game, so that's what is going on with the second formula. I sketched out the position that I wanted to calculate, then looked at what existing variables I can use for reference and came up with an equation to tie them together.
I'm new to Godot and I appreciate the example here, thank you. I do have a quick question. Is it normal for autocomplete to sometimes not work? Like while I was following along, when I typed pipe.position or $Bird.falling, it wouldn't autocomplete position or falling. Does it behave that way for you too?
yeah it did the same thing for position for me
im pretty sure its jsut random
Hello Russ, who did all the graphics for you?
I'm still working on your pygame tutorials but I like the look of the Godot games much better. I'll see if I can follow along on this tutorial and just might switch over to Godot for my future games.
Thanks, Gary
Hi Gary, I just find them online, there are lots of open source images that can be used with or without attribution. I try to credit all my sources in the video description although I couldn't remember where I got the images for this game so I couldn't reference them.
Thanks Russ and keep on making these great tutorials!
THIS MAN IS SO UNDERRATED! HOW DOES HE NOT HAVE 1 MILLION SUBS??
After following the video and doing everything in it, I found out I suck a FlappyBird
Thanks for the video
loved it !💯💯
Glad to hear it!
i really like how concise this is. it encourages you to actually learn the software instead of just copy what you see
Thanks!
really nice. thanks a lot
Thanks!
thank you!
This was very well done, although 12 Minutes video turned into 1.5h of actually doing the steps :P
where can i get the animation
Well done thx dude
Glad it helped
been struggling along for hours. more and more issues as i got deeper in. double and triple checked the code compared to the gdscript provided and shown in video. can't get the pipes to appear. and the bird falls through the floor for a very very long time. and the ceiling area detection doesn't seem to be at the right height
started over from scratch and spent another day struggling through. i finally got it to work. thank you for this and the pong tutorial. what i've learned is that you have to be extremely exactly perfectly precise. part of the difficulty for me is that this one felt a bit too fast. "blink and you miss it" kind of stuff threw a wrench in things several times
i'm learning godot but it is just so Madding!
I love these videos, but sometimes you go too fast and I miss some code lines or something
I love the vid dude but i have one problem when i try to run the game it has a error with $Bird.reset() and the error it gives is
main.gd:24 @ new_game(): Node not found: "bird" (relative to "/root/Main").
i tried for so long how do i fix this?
I think it's because your 'bird' has a lower case b. Make the node Bird and it should be okay.
@@dezatoosweet I'll try thanks
Hello im making this in Godot 4.2 and i did all the same and this happen
Invalid get index 'position' (on base: 'previously freed'). and the game instantly crash and doesnt let me even execute it.
2 breakpoints are marked.
1) Line of code 10: var screen_size : Vector2i
2) Line of code 60: for pipe in pipes:
pipe.position.x -= SCROLL_SPEED
I had this same issue.
Be sure to add the "pipes.clear()" function below this call.
It did this because the "queue_free" method removes the pipes from memory, so it's basically looking for a "null" value when accessing the position.x of the pipe in the pipes array (even tho we're generating new pipes... idk memory management 101 I guess).
Not sure if this exactly helps, I'm still learning myself! LMK what happens.
extends CharacterBody2D
const GRAVITY : int = 1000
const MAX_VEL : int = 600
const FLAP_SPEED : int = -500
var flying : bool = false
var falling : bool = false
const START_POS = Vector2(100, 400)
Thanks
Hard to follow along, try to show slower steps.
thanks for the tuts Russ...
I really don't like the copy paste approach that you've been using in your latest couple of vids. The old coding along style was much better imho. hope you can return to using that instead
Thanks for the feedback, it's good for me to know whether people like the new approach or not. I thought people would find the code along style repetitive plus those videos take much longer to make so I switched it up. I have a few more short style tutorials planned so once they are done, I'll look at which style is preferred and try to find a balance.
hopefully with this i can finally get the grade i need to pass one of my tech classes, thank u for giving what was supposed to be gave
When I press the mouse button nothing happens
Did you set up the input correctly in project settings?
Hello nice video, would it be possible to send me the entire code please?
Plz make a 3d foghting game in ursina of guns plz
I think I'm cursed i followed this to the exact and i got to 4:05 mins and nothing happened lmao
same
found the solution . in bird script i changet this line from = to += ( velocity.y += GRAVITY * delta)
Bird_hit doesnt work for me, My bird continues flying through pipes even after 9:00
I had the same issue. Turns out I'd created the node in the Main scene as a "Node2D" instead of just a "Node"
Have the same issue. I am trying to make a computer game for the first time at all. Don't understand whats nok... My main scene is "Node". @TechnicalParadox did you solve your issue and how?
@@aijavisnevska5116 I didn't specifically fix this issue but I took a Godot course on udemy. Make sure the area or body of the bird has the on_area_entered or on_body_entered linked to the script. If that's good then check the collision properties of the bird and of the pipes, other than that I can't think of anything else it wouldve been
I found my issue :) In Pipe script the function "func _on_body_entered(body):" was not connected. :)
@@aijavisnevska5116 sorry I had typed out a reply earlier but must not have sent it. I never fixed this issue in this project but I took a udemy course for godot since and yeah it's either that the script wasn't connected to the signal or the collision layers are messed up, or you have a mix up between area/body and are using wrong function
Is this work on mobile?
I haven't tried
Thanks
Can you make tutorial for mobile?
6:48
its says that it doesnt exist
Deep.
@Coding With Russ
Can you make tutorials for roblox studios please?
I wanna learn how to make games in roblox but I don't have that much money. Thanks
it works!
I wish you would explain why instead of just a step-by-step.
you cant just copy and paste it in the video you gotta type with us
You see what is written, just read
I actually find this more complex than just coding the game from scratch!😅
my pro hacker coder friend says ur code is DOODOO please make easier code for us beginners UwU!!!!! TY DADDY mwahh!!!
this is a lot of code
Please actually explain what your doing at a slower pace, if I just blindly follow along as a beginner I won’t actually learn anything.
thank you for the tutorial but when i opened it up it said
E 0:00:00:0637 Main.gd:28 @ new_game(): Node not found: "ScoreLabel" (relative to "/root/Main").
Method/function failed. Returning: nullptr
scene/main/node.cpp:1634 @ get_node()
Main.gd:28 @ new_game()
Main.gd:20 @ _ready()
i did just copy paste the code so im guessing thats where i went wrong but how do i fix it or do i just gotta redo the code parts?
yeah, really wanted solution to this. I also copy and pasted code and followed all the tutorial but same error is occuring. Please explain whats the issue
finally found the error, in code of github underscore"_" was missing like _body, _delta and another mistake was i wrote names of node in small letters but in code it was capital