Тёмный

Learn Godot by creating Pong 

Clear Code
Подписаться 215 тыс.
Просмотров 123 тыс.
50% 1

An practical introduction to the Godot Game Engine by creating a simple Pong game. I will be using the python-like GDScript for the project, but you don't need any coding knowledge to follow along.
Link to my game development course: • An introduction to gam...
Timestamps:
0:00:00 Intro
0:02:26 Intro to Godot
0:13:37 The player character
0:25:20 Moving the player
0:39:12 Setting up the level
0:50:09 Creating the opponent
0:59:01 Creating the ball
1:09:53 Making the ball bounce
1:15:14 Opponent Ai
1:24:02 Ball reset
1:32:43 Adding a score
1:41:36 Countdown
2:01:03 Final details
Assets and project files available here: github.com/clear-code-project...

Опубликовано:

 

1 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 322   
@Jatniel-Snchez
@Jatniel-Snchez 10 месяцев назад
Take this into consideration while following the tutorial in Godot4: 1. Kinematicbody2d is now characterbody2d 2. Move_and_slide() doesn´t work (because is build in or something), use move_and_collide() instead and change the speed to a smaller number 3. "Invalid get index 'normal' (on base: 'KinematicCollision2D)" to fix this change .normal to .get_normal() and the ball will bounce 4. .find_node() is not going to work, use .get_node() instead (also change the speed to a smaller number like 5)
@M3TOXI
@M3TOXI 9 месяцев назад
unfortunately .get_normal() ends in the preview closing after the collision with no error message
@guyug6940
@guyug6940 9 месяцев назад
thnaks
@guyug6940
@guyug6940 9 месяцев назад
i changed .normal to .get_normal(), but the ball doesnt bouce, it just slides very slowly, does anyone know how to fix this?
@M3TOXI
@M3TOXI 9 месяцев назад
@@guyug6940 The tutorial is made for an earlier version of godot. what I did, to finish this tutorial, is to simply download godot 3 and finish it in godot 3. was worth it as I was able to learn stuff. now I am doing clears 12h godot 4 video
@JetTheOneAndOnly
@JetTheOneAndOnly 9 месяцев назад
Not all hero's wear capes. Thank you so much!
@nogoodgod4915
@nogoodgod4915 3 года назад
This feels like it is premium like I paid $20 for it but it's actually free. You are amazing and your tutorials are extremely good. Keep it up!
@InnerEagle
@InnerEagle 3 года назад
Asking for more contents like this would be a steal for everyone who would pay for courses, but this guy, for this guy I would keep this video in loop to make him earn everything he deserves
@MadaraUchiha-bt4hg
@MadaraUchiha-bt4hg Год назад
Important Note: if you're using Godot 4 then you should now that Kinematicbody2d has been changed to Characterbody2d.
@radiantintrovert3833
@radiantintrovert3833 Год назад
Thank you, thought I was going crazy for a moment.
@welrdo1234
@welrdo1234 Год назад
Move and slide works for characterbody2d?
@xenosunbro
@xenosunbro Год назад
@@welrdo1234 it works differently as it now uses 0 argument instead of 1. "Velocity" is preexistent now and it's made specifically for movement functions, check the documentation
@hectichive889
@hectichive889 9 месяцев назад
@@xenosunbro Is the 'documentation' on their Github? I figured this out very quickly that they already had a pre-existing velocity variable or whatever because of the errors the engine was throwing haha! Figured out my own way of solving my own issue with the character model, just wondering where I can learn more about all the preloaded stuff that comes with the engine I suppose
@JetTheOneAndOnly
@JetTheOneAndOnly 9 месяцев назад
You are a hero
@XtrimUniverse
@XtrimUniverse 3 года назад
I wasted 4 hours for a pong before I came here. And you made it golden in only 2 hours. Such easy and clean within this short time. Hats off !!
@synthoelectro
@synthoelectro 2 года назад
some youtube videos are such a dud aren't they, but these videos are worth the price if sold.
@jestjames88
@jestjames88 11 месяцев назад
This needs to be redone for Godot 4, I went through loops trying to figure out enemy ai!
@looako
@looako 11 месяцев назад
Would you care to share it? I've been stuck for a while
@johnbenjaminvistan6013
@johnbenjaminvistan6013 3 года назад
This tutorial/course is so great. The explanations are so clean and also the visuals too. Almost everyone said it feels like a great Godot course and it really does. Pls make more Godot course-like tutorials like this, it really helps me to learn Godot and GDscript as a Beginner.
@user-zl5cv6vw2m
@user-zl5cv6vw2m 3 года назад
This video is amazing. I'm a Unity developer but having some trouble understanding Godot's workflow, this video explained it very well. Thanks again!
@Jchap7777
@Jchap7777 17 дней назад
I just finished the course and WOW!! This has got to be the BEST way to learn godot 3. Thank you so much man. I almost quit game dev because I just couldn't learn but you actually made it simple enough to where I could understand and follow. I actually at one point tried a course that was from a real game dev teacher and I got to say, You LEGIT teach better than an actual SCHOOL TEACHER!! Thank you so much. You are the best!
@aditgaur1585
@aditgaur1585 3 года назад
The animations and the annotations on the screen really helps us to learn! Thanks for your effort!
@lufog
@lufog Год назад
46:00 You could set up one static body. Name it Walls, and add 2 collision shapes to it, naming them CollisionTop and CollisionBottom.
@pablo199014
@pablo199014 4 года назад
Thanks for the video. Love the clean and clarity aspect of it. 🥰
@phoxpsy7236
@phoxpsy7236 2 года назад
For anyone who is confused why only the opponent is making Score but the player is not. heres the solution to fix it. Hey, so the problem in the code is that only the opponent score is updated, not the player score. So even if the player scores a goal, the opponent would get the point. To fix it, just remove opponent_score += 1 from score_achieved() and add it to on_right_body_entered() and add player_score += 1 to on_left_body_entered() and then you should be good :)
@ClearCode
@ClearCode 2 года назад
Yeah, I realised afterwards and felt very silly :)
@BeatemupMaster
@BeatemupMaster Год назад
Hmm, strange, that Work on First try? Just don't do tell the func _on_CountdownTimer_timeout(): to the _on_left _on_right func, just let it be, you already have! (But still some other Bugs are there) 😉
@-smile-1
@-smile-1 9 месяцев назад
@@ClearCode the ai i made for the pong is impossible to beat its wayy to accurate and also sometimes it slows down its speed to improve accuracy i guess you could say that, hre is the code i used func _ready(): Ball = get_parent().get_node("Ball") func _physics_process(_delta): move_and_collide(Vector2(0,get_opponent_direction()) * speed) func get_opponent_direction(): if abs(Ball.position.y - position.y) > 25: if Ball.position.y > position.y: return 1 else: return -1 else: return 0 i am using godot 4 pls helppp
@sirpickle2347
@sirpickle2347 3 года назад
You are the man who taught me Pygame, all for free with AMAZING quality. I would have had to learn Pygame and the basics of Godot for $50. Thank you for producing these amazing tutorials for free, keep it up!
@Juice_-jt9qv
@Juice_-jt9qv 3 года назад
Very high quality stuff! Glad i stumbled across this as im interested in both python and godot. Perfect!
@claymaroon6041
@claymaroon6041 3 года назад
Thank you so much I love the feeling of accomplishment. All of the other tutorials didn’t work but this one did!
@savmass
@savmass 2 года назад
This is an amazing tutorial. Very well explained and planned out. I will be sharing this with anyone that wants to start with Godot. Thank you!
@godotuser1622
@godotuser1622 3 года назад
Amazing tutorial , you did a lot of works and carefully explain simple
@galaxfire8591
@galaxfire8591 3 года назад
Thanks for this! The tutorial was very clear and concise and the visuals explaining some concepts were also great. Thanks for this video i sincerely appreciate it.
@cuervo_gaston
@cuervo_gaston 2 месяца назад
In godot 4+ the collision is func _physics_process(delta): var collision: KinematicCollision2D = move_and_collide(velocity * SPEED * delta) if collision: var reflect = collision.get_remainder().bounce(collision.get_normal()) velocity = velocity.bounce(collision.get_normal()) move_and_collide(reflect)
@Mike-ks8xt
@Mike-ks8xt 3 года назад
Thanks for the tutorial. I work if Godot for 2 years and i still learned a bunch of things that will help me so much! keep the great work :)
@sjacobson42
@sjacobson42 3 года назад
I've wasted so much time and money on GODOT tutorials that start off strong and then hit a huge off-putting snag halfway through. "CLEAR CODE" is a perfect name for your channel! As a game design instructor trying to curate the perfect tutorial playlists, I feel I've struck gold :) I'd be a big fan of your PYGAME tutorials too if it had an IDE with graphic layout editor and easy install like GODOT does.
@Ryangosden
@Ryangosden Год назад
Easing into godot, and the simplicity of this tutorial helped tremendously compared to other tutorials.
@umerfaisal9171
@umerfaisal9171 3 года назад
You explain everything so nicely!!!!!!! Keep it up!
@Pulkz
@Pulkz Год назад
Transitioning from using C# to GD Script and your Tutorials are awesome dude!
@basilhsxatzhkostas
@basilhsxatzhkostas Год назад
Thank you man for the tutorial! Really helped me out understanding godot better! I also had a lot of fun coding and your video is amazing! you teach really really well!
@fantomas1770
@fantomas1770 2 года назад
absolutely brilliant video that set a mark for how tutorials should be made thank you very much
@Neerajkumar-fv8zx
@Neerajkumar-fv8zx 3 года назад
man your explanations i just loved it !. keep the viedos coming and you will reach good number of subs for sure.
@North_annex
@North_annex Год назад
why is this dude so good at tutorials, not just this one, literally all of his tutorials are like this
@SabeDoesThingsChannel
@SabeDoesThingsChannel 2 года назад
It's a very good tutorial the editing is very good and you explained everything very well. Keep doing what you do.
@spaghettiman512
@spaghettiman512 3 года назад
This truly is clear and easy to understand, Thanks a lot!
@naytron210
@naytron210 Год назад
Awesome tutorial thanks for sharing! Well explained and thorough. Much appreciated!
@Steelglowhawk
@Steelglowhawk 2 года назад
Thank you for such comprehensive lesson!
@AndIChoseToSpeakFAX
@AndIChoseToSpeakFAX 2 года назад
37:07 Amazing work with that! It was confusing for me to press down and go up
@danielgutierrez9520
@danielgutierrez9520 3 года назад
Loved the tutorial! Super Well made and easy to understand. I learned a lot, Thank you!
@happygofishing
@happygofishing Год назад
k-on!
@DrW1ne
@DrW1ne Год назад
You're a good teacher, also you helped me to start developing in Godot.
Год назад
I think that the coordinate system in game engines is like this, because if we analyze CRT TV, the cathode rays start from the upper left corner and sweep row by row from left to right, when a row ends it goes down a scanline below and repeats the process, when it reaches the end in the lower right corner, restarts. As the Atari 2600 worked directly with this, it seems natural to choose the coordinate origin in the upper left corner and the positive y axis downwards. In 1:07:11, this is modular aritmetic, basically the clock, 15 = 3 mod (12), 15 is 3 modulo 12, if you pick the number 15 and divides by 12, the remainder is 3. If you pick any integer number a -> a = n mod (2) -> n in {0, 1}, because if a is divisible by 2, your remainder is 0, otherwise is 1.
@cokage2988
@cokage2988 4 года назад
Another Godot tutorial! Thanks for the videos you are awesome bro!!!
@TheCyclops777
@TheCyclops777 2 месяца назад
Neat tutorial. Very well explained for a total gamedev newbie.
@vaibhavkrkm
@vaibhavkrkm 4 года назад
Hey, love your awesome tutorials, please keep it up!! :)
@ClearCode
@ClearCode 4 года назад
thank you so much :)
@yashchaudhari3113
@yashchaudhari3113 3 года назад
I was looking for a good Godot video and I found one! New sub man!
@ralfgraf4055
@ralfgraf4055 2 года назад
Amazing tutorial. Keep up the good work. Thank you.
@mysterious_monolith_
@mysterious_monolith_ Год назад
So good I'm going to re-watch for a second time.
@ido5386
@ido5386 Год назад
Keep up the good work man!, you earned my sincerest thumbs up
@abdulwaasay8228
@abdulwaasay8228 2 месяца назад
for people who got stuck on 39:00 min something due to move_and_slide() error, its because they changed it in godot4. now move_and_slide doesnt take any args but it does take velocity by default so you cant name your variable in the 6th line as velocity. just change it to something and remove args from move_and_slide(). dont forget to match the names in the if statement
@legowyn24
@legowyn24 4 месяца назад
I didn't know pong would be complicated enough to come back to beginner tutorials 3 months later and learn this much new stuff
@beratcimen1954
@beratcimen1954 Год назад
Great tutorial, thank you so much! I learned so much.
@Jellylamps
@Jellylamps 4 месяца назад
I followed along with this on godot 4. A little frustrating but debugging from the version differences taught me a lot too.
@erickrommel5810
@erickrommel5810 2 года назад
dude, thank you very much. You helped me a lot. I have already subscribed to your channel and will see your other videos about Godot. Thank you again
@TheEricounet26200
@TheEricounet26200 Год назад
Superb course! Thank you a lot! :D
@BlackCat-gh8fr
@BlackCat-gh8fr 3 года назад
Thank you! Great descriptive video!
@cerstar5725
@cerstar5725 2 года назад
Thanks you , for the tutorial is simple and well explained please continue doing tutorials
@BeatemupMaster
@BeatemupMaster Год назад
You are a Greater Teacher! Better than the most Godot Tutorial or in General! Have you more Videos like this? ☺️
@BeatemupMaster
@BeatemupMaster Год назад
And almost Finish! But you don't tell, how to do it on a Game Icon and can Play outside the Engine, like all Games... Still very Good!
@bjkorb7272
@bjkorb7272 Год назад
Amazing tutorial!!! I like the part where you say "there are a couple ways to do this"
@synthoelectro
@synthoelectro 2 года назад
A very understandable tutorial.
@hasdh9504
@hasdh9504 2 года назад
The invertion of the Y axis is a feature that has been inherited in graphics programming from history. Back in the day computers used CRT monitors that paint the picture on the monitor from top left to bottom right (several technical reasons why that is the simplest way to go about it). Since then graphics libaries have been using this as a standard and still do till this day. Engine builders simplely inherit this since this is only a small inconvenience for the user (and will be complex to correct).
@AntonioBrandao
@AntonioBrandao 11 месяцев назад
Excellency in teaching skill.
@BigIce420
@BigIce420 Год назад
This is the best free software Ive seen. Respect.
@gonedark1049
@gonedark1049 3 года назад
I really love this!
@LoveYing
@LoveYing 4 месяца назад
Thank you for the tutorial!
@joshuarodgers4122
@joshuarodgers4122 2 года назад
Better than ANYTHING on udemy. Thank you.
@blytical
@blytical Год назад
Awesome tutorial!
@tanjibulanimations5653
@tanjibulanimations5653 7 месяцев назад
man i love your explanation
@Bananeisafree
@Bananeisafree 2 года назад
The origin of the coordinates being top left instead of bottom left in computer related stuff is usually attributed on the way display (used to ?) work. Where things are drawn on the screen from top left to bottom right. I know it was the case back in the 8bit era computer, do not know if it is still the case now. (then again I might be wrong) thank you for your work and a very nice and efficient tutorial.
@nicolasalexandre8951
@nicolasalexandre8951 3 года назад
Very nice, thx bro!
@tanewhite7328
@tanewhite7328 10 месяцев назад
Hello everyone, if you are new here, make sure that you know this is not a Godot 4 tutorial, as this was made before it was released. But most of everything is the same except some of the code is different.
@klausbrier6307
@klausbrier6307 2 года назад
great course
@user-gp2vn9lp2i
@user-gp2vn9lp2i Год назад
Awesome. Thank you.
@devsquares
@devsquares Год назад
CONGRATS ON 100K
@rafaeu292
@rafaeu292 3 года назад
2 hours for a pong tutorial... Im in :D
@ayushsidam289
@ayushsidam289 3 месяца назад
Wow!!! Man I didn't know that there were bounce() and move_and_collide() available. Previously, I did the collision of a ball with vectors. It takes me a whole 2 days to get ball collision functionality. I wish I had seen the video earlier. 😅
@alexcustodio9497
@alexcustodio9497 2 года назад
thank you so much for this video
@Barveth
@Barveth 3 года назад
Nice tutorial :)
@bucketcmsdud8966
@bucketcmsdud8966 Год назад
This course is great although I had some trouble earlier I fixed is am now an creating the ball
@Albrecht-Adrian
@Albrecht-Adrian 3 года назад
Insane Content for only 1730 Subs.
@Asatipankaj
@Asatipankaj 3 года назад
He Does deserve more subs that is true
@christophechouinard7619
@christophechouinard7619 2 года назад
I guess that's why he went so quickly from 1730 to... more than 20k !
@tommy-jf4xh
@tommy-jf4xh 3 года назад
ok this is amazing thanks
@HeyManOK
@HeyManOK Год назад
Thanks for this tutorial!! it's been very helpful and easy to understand. I'm now trying to improve the game by adding some more stuff to it. I understand that the final detail of resetting the Player's position is an easy way to do and explain for beginners, but I'd like to know if there's a better way to avoid the Player from moving in the first place when it hits the ball at certain angles. Thanks again!!
@amaterasuHS
@amaterasuHS 3 года назад
For fixing the score issue, do the following: declare your score_achieved function with it accepting a variable and then pass an apporpriate variable if the player or opponent has scored. So: func score_achieved(assignScore): $Ball.position = Vector2(640,360) if assignScore == 1: OpponentScore += 1 else: PlayerScore += 1 Now all you to do is pass 1 or something else at your instance functions: func _on_Left_Goal_body_entered(body): score_achieved(0) func _on_Right_Goal_body_entered(body): score_achieved(1)
@daleji926
@daleji926 Год назад
still the same problem sadly always the player score is 1 at the begging
@baehm3617
@baehm3617 3 года назад
What a great video! Could you tell me what I should do if I want to increase the speed of the ball over time?
@frenlyneybur7544
@frenlyneybur7544 3 года назад
30 seconds in and already subbed
@Arslan2077
@Arslan2077 2 года назад
Thank you very much
@vinayabhat6006
@vinayabhat6006 3 года назад
Thanks a lot !!!!
@larisdalley7383
@larisdalley7383 3 года назад
very good thank you
@YannSchmidt
@YannSchmidt 3 года назад
Nice tutorial, just one thing you missed: The function score_archived has a bug. It will always trigger to update the score of the opponent, never the player since you refact it as it will only apply the score on OpponentScore :)
@synthoelectro
@synthoelectro 2 года назад
I had a problem with this as well, I had to make a copy of L and R paddles, and sadly that breaks what he was doing, better luck next time.
@Greld0n
@Greld0n 2 года назад
I fixed it by passing a string of the winner: score_achieved("opponent") Then pass the winner back into the score_achieved function: func score_achieved(winner): if winner == "opponent": OpponentScore += 1 if winner == "player": PlayerScore += 1
@jelliebyte
@jelliebyte 8 месяцев назад
note for godot 4: velocity is an inbuilt variable, you dont need to define it
@toadhermit7238
@toadhermit7238 3 года назад
Really great video, I learned a lot! My only question is the custom font, when I opened the asset folder I didn't see anything for the font in there. edit: I decided to grab a custom font from Google Fonts, which is a great resource! Helped me learn by searching fonts out for myself
@silasdurans
@silasdurans 8 месяцев назад
Man, this tutorial was perfect, in fact, it stops being a tutorial and becomes a complete Godot class, you gained a new subscriber, thank you
@guritche
@guritche 2 года назад
Great video! Note the custom font is not in the assets zip.
@valevenga797
@valevenga797 Год назад
wonderful
@farhanandfathima7165
@farhanandfathima7165 2 года назад
Thanks ❤ from India🇮🇳
@bigbananae
@bigbananae Год назад
Bro it’s very intimidating! I’ve been slacking on it for a month now. The symbols are very confusing. You have to train your mind to
@jimmyslaughter6262
@jimmyslaughter6262 2 года назад
When I make my first 1$ from game making, I'm subbing to your patreon!
@dianaandgameing
@dianaandgameing 9 месяцев назад
If anyone has a problem with the countdown label appearing every time you start the game, what I did is go to the CountdownLabel node in level and in the inspector go to visibility -> visible and turn that off so by default it is invisible
@tildesarecool7782
@tildesarecool7782 Год назад
There's only one in my version not consistent with your version and that's pretty good for me (on the first/startup match there isn't a count down, it's a 1 and the ball starts going). Still, pretty good that I have a working pong game now. I'm going to see if I can convert it to Breakout (player paddle on x-axis) all on my own.
@danyalmalik4245
@danyalmalik4245 3 года назад
Love the tutorial man. I have a question. When I fullscreen my color rect, it kinda just disappears instead of covering the whole screen. Any idea of what I might've done to cause this issue?
@ClearCode
@ClearCode 3 года назад
Hey, you probably use a node2d as root node. Change it to a plain node and it should work
@danyalmalik4245
@danyalmalik4245 3 года назад
@@ClearCode yup I did do that. Thanks, it works now
@tsummerhays
@tsummerhays 2 года назад
This was fantastic. Thanks for creating the first thing that I ever made in Godot!
@rainytapestry977
@rainytapestry977 Год назад
If you can't get ColorRect to work properly, I saw in another tutorial that you can just change the background color by going to Project Settings -> Rendering -> Environment -> Default Color
@sappito0
@sappito0 3 года назад
Conteúdo grosso😁👍
@bjkorb7272
@bjkorb7272 Год назад
1:58:45 - I recommend using the ceiling function, ceil(), instead.
@htshongany4969
@htshongany4969 4 года назад
Thanks you
@sujucface0073
@sujucface0073 2 года назад
I have a problem at 1:08:09 when I put func _physics_process(delta): in the ouput says its an error. And when I play the scene it´s just black
Далее
The 7 Greatest TIPS for Any Godot Developer
5:19
Просмотров 49 тыс.
I made a game using Godot for the first time
7:35
Просмотров 1,1 млн
Викторина от МАМЫ 🆘 | WICSUR #shorts
00:58
How I Mastered GODOT In Only 5 DAYS!
7:03
Просмотров 172 тыс.
Godot: How to transition from a Beginner to a Novice
6:49
How to ACTUALLY get into Gamedev
14:01
Просмотров 707 тыс.
I Made the Same Game in 8 Engines
12:34
Просмотров 4 млн
I Made My First Game in Godot in 3 Weeks...
26:21
Просмотров 276 тыс.
How to make a Video Game - Godot Beginner Tutorial
1:17:12
I Paid Fiverr Game Developers to Make the Same Game
10:25
How Games Make VFX (Demonstrated in Godot 4)
5:46
Просмотров 329 тыс.
A new way to generate worlds (stitched WFC)
10:51
Просмотров 520 тыс.
Викторина от МАМЫ 🆘 | WICSUR #shorts
00:58