I hope you took away lots from this video. Let me know below! PS. Check out my Android Game called Quiz of Knowledge. I am sure you are going to like it. bit.ly/QuizOfKnowledge
I just finished school in programming. It was 18 months. I learned c#, kotlin, html, css, js (node, express), sql, mongodb but i always wanted to learm C and C++ because I want to pursue a career in the gaming world as a developer. Throughout the education, i had to use stack overflow and chatgpt to help me with projects( i know i shouldnt depend on chatgpt) because i couldnt understand the books and my teacher (it was an online class). You are the only one so far that explains every code and why its written that way (function, class, etc). I cant thank you enough!!!
Wow! I just wanted to say THANK YOU for making these Raylib tutorials. You are excellent at describing WHY we write the code (the most crucial aspect of learning), both while you code but also before we start to code when you break down what we are gonna do. Sometimes I loose interest in a tutorial when the person is not explaining and or has a pedagogical way of explaining. But I've been glued to your Raylib videos! Please don't stop doing Raylib tutorials, you are the best I've seen on RUclips regarding c++ game programming (and I really mean it)!!
Amazing Tutorial! Thank you for making it! this tutorial only needs to set a winning max score and sounds when the ball collides with the paddles and walls and when either side scores a point.
I really like the way you break everything down, it really helps with understanding what's going on. I hope you will continue to make more contents. Thank you so much!
Thank you for such a fantastic tutorial. I have taught myself python and found you via your pong pygame video. I spent time a couple of years ago trying to teach myself C++. This tutorial has now whetted my appetite to try and continue this journey. I look forward to what you post in the future.
Glad to hear that you found the tutorial helpful and that it has inspired you to continue learning programming! Learning by building games can definitely be a fun and rewarding way to learn a new programming language. By the way, I'm currently working on a new video tutorial for creating a Snake game in C++, which I think you might find interesting. Stay tuned for that, and let me know if you have any questions or need any help along the way!
Incredible tutorial! I just started programming and chose c++ as my first language. Ive done many tutorials even another pong video but it was convoluted and didnt explain what the code did or how to break it down into small problems. Thank you so much for this knowledge! On to Snake now!
Hey man, I wanted to thank you for this tutorial, I've been learning a lot with it! I'm definitely looking at you snake tutorial next! As well, this type of tutorial motivates me more, in becoming a c++ dev!
You can do it. Watch the snake game tutorial, next the Tetris game tutorial, and next the Space Invaders tutorial and you will able to build simple 2d games on your own.
Let me just point out that in the beginning you show 1 big thing broken down into 9 smaller things to showcase the divide & concquer method. Let me also say that the video is made up of 9 parts of actual coding. :D Satisfying.
Hey Nick I'm really excited for the next tutorial as this one is very well explained and I understood it easily. Keep up the good work (Επίσης είμαι και εγώ Έλληνας :))
Hey, thanks for the comment! I am really excited for the next video as well! It will be my best so far! Γεια σου πατρίδα, αν φτιάξεις κάτι καλό να μου το στείλεις να το δω!
Couple of things, you really should make the member variables private and have appropriate setters/getters, in addition, the naming of the variables should be more descriptive, x can refer to many things, position_x or positionX would be an appropriate name.
Thank you for a great tutorial! One question though, and my question might be off but, delta time was not used for the movement of the ball nor the movement of the paddles. Is this because you know that your computer will be able to run the pong game at 60 FPS at all times? If you were to make the game available for anyone, would you then use delta time for the movement?
Yes, since this is a super simple game, very computer can run it fast enough. This makes things easy. If I remove the fps limit, my computer can run the game at 5000 fps. Check the latest video on my channel for more info.
Thanks very much this is one of the best tutorials for beginners about both raylib and oop abilities in c++ , thank you a lot sir💙 But just a small question , do you need any extra extentions to run this on vs code? (Execpt the c++ extension of course) And using codeblocks will do the same work right?
Fantastico tutorial,es tan bueno que hasta yo que no se ingles he podido seguirlo sin problemas.Sigue haciendo mas video de raylib que son muy buenos. No se si te molesta que publique en español pero me es mas comodo que usar el traductor de google,pero si hay algun problema puedo usar el traductor.
¡Muchas gracias por tus palabras! Me alegra saber que pudiste seguir el tutorial a pesar de no hablar inglés. Continuaré haciendo más videos sobre raylib y trataré de hacerlos lo más claros y fáciles de entender posible. ¡Gracias por seguirme!
@@programmingwithnick Podrias en proximos videos,hacer un juego con dos niveles y ver como se puede pasar de un nivel a otro.Y tambien me gustaria saber como pausar el juego
Hi Nick, loved your tutorial videos. I want to ask, is there a way to make all of these game projects without needing to delete the main.cpp source code and rewrite it all and instead make a new file and write the code there? Thank you in advanced!
for some reason whenever i run the program the ball keeps hitting an invis wall at x being 781 i have no clue what the reason could be because to me it looks like i did everything like the video showed
ball is moving back and forth on x axis in very small distance when i add circle rect collision code, it works file if i comment it, any idea what light be wrong?
This is terrific!!! I'm 90% into it and just have the players paddle moving inside the screen, however I seem to have TWO player paddles as one does move up and down, and another is stationary in the middle position???? Can't find the code issue causing this? Thanks!!
class Player { public: float x , y; float speed; float height, width; KeyboardKey key_up, key_down;
Rectangle rec = {x, y, width, height}; void draw() { DrawRectangle(x, y, width, height, mainTheme[3]); } void update() { if (IsKeyDown(key_up)) { if (y > 10) // moving only if its within the field { y -= speed; } } if (IsKeyDown(key_down)) { if (y + height < display_height - 10) { y += speed; } } } }; class Computer : public Player{ public: void update(float ball_y, float ball_x) { if ((ball_y < y + height/2 && ball_x > display_width/2) || (ball_x > display_width/4.5 && ball_x < display_width/2.6)) // extra condition for more interactive bot { if (y > 10) // moving only if its within the field { y -= speed; } } if ((ball_y > y + height/2 && ball_x > display_width/2)|| (ball_x > 20 && ball_x < display_width/5)) { if (y + height < display_height - 10) { y += speed; } }
Thanks a lot :) one question ... there is a weird edge case for the collision, where the ball gets stuck in the paddle and is thrown back and forth. It happens when you catch the ball with the edge of the paddle. Is there a way around this ? Looked in documentation and web but wasnt able to find a solution
@@programmingwithnick hello I just completed creating the whole game, now I decided to create something more and male a menu screen which has start and exit buttons, so i came across raygui i wanted to ask how should I link raygui in the starter raylib template folder structure taken from git
You can decrease the cpu speed variable, increase the ball.speed variable or alter the AI algrotithm to move only when the ball is its part of the screen for example. There are many ways to achieve it.
because code gets executed from top to bottom, logically it makes more sense to update the position before drawing the ball on the screen again, right? :)
Thank you very much for your comment and the nice words. I am glad that you liked the video and the structure. I don't use social media, they distract me from the work, and believe me producing videos like this require a huge amount of time. If you want to see updates from me on the projects I am building check my community tab here on RUclips.
I hope you took away lots from this video. Let me know below!
PS. Check out my Android Game called Quiz of Knowledge. I am sure you are going to like it.
bit.ly/QuizOfKnowledge
Is it in C++?
I just finished school in programming. It was 18 months. I learned c#, kotlin, html, css, js (node, express), sql, mongodb but i always wanted to learm C and C++ because I want to pursue a career in the gaming world as a developer. Throughout the education, i had to use stack overflow and chatgpt to help me with projects( i know i shouldnt depend on chatgpt) because i couldnt understand the books and my teacher (it was an online class). You are the only one so far that explains every code and why its written that way (function, class, etc). I cant thank you enough!!!
Wow!
I just wanted to say THANK YOU for making these Raylib tutorials.
You are excellent at describing WHY we write the code (the most crucial aspect of learning), both while you code but also before we start to code when you break down what we are gonna do.
Sometimes I loose interest in a tutorial when the person is not explaining and or has a pedagogical way of explaining. But I've been glued to your Raylib videos!
Please don't stop doing Raylib tutorials, you are the best I've seen on RUclips regarding c++ game programming (and I really mean it)!!
Thank you very much for your kind words! It means a lot. Messages like yours, keep me motivated!
Amazing Tutorial! Thank you for making it! this tutorial only needs to set a winning max score and sounds when the ball collides with the paddles and walls and when either side scores a point.
I really like the way you break everything down, it really helps with understanding what's going on. I hope you will continue to make more contents. Thank you so much!
If I would've found your channel earlier, I would be a game dev by now, thanks for all the hard work you put into these videos.
your contents are far better than the contents in paid Udemy courses!
Thank you very much for the feedback. I wan to create the best possible free content available. It seems I am on the right track.
Thank you for such a fantastic tutorial. I have taught myself python and found you via your pong pygame video. I spent time a couple of years ago trying to teach myself C++. This tutorial has now whetted my appetite to try and continue this journey. I look forward to what you post in the future.
Glad to hear that you found the tutorial helpful and that it has inspired you to continue learning programming! Learning by building games can definitely be a fun and rewarding way to learn a new programming language. By the way, I'm currently working on a new video tutorial for creating a Snake game in C++, which I think you might find interesting. Stay tuned for that, and let me know if you have any questions or need any help along the way!
I followed your step by step tutorial on how to set up raylib in Visual Studio 2022. You made it super easy to follow along with you awesome job.
Incredible tutorial! I just started programming and chose c++ as my first language. Ive done many tutorials even another pong video but it was convoluted and didnt explain what the code did or how to break it down into small problems. Thank you so much for this knowledge! On to Snake now!
Your explanation is REALLY FANTASTIC!! You got me subscribed and thumbs up in Vegas. Thank you!!!!
Hey man, I wanted to thank you for this tutorial, I've been learning a lot with it! I'm definitely looking at you snake tutorial next! As well, this type of tutorial motivates me more, in becoming a c++ dev!
You can do it. Watch the snake game tutorial, next the Tetris game tutorial, and next the Space Invaders tutorial and you will able to build simple 2d games on your own.
@@programmingwithnick Will do, thank you!
very good tutorial and good explanation, thank you .
This was incredible. Thank you so much!
Great Tutorial. It helped me A LOT!
Man this is really helpful can you do more tutorial in C++ like making enemies and also doing 3D game dev stuff
True gem , exactly what i needed ! thank youu
Let me just point out that in the beginning you show 1 big thing broken down into 9 smaller things to showcase the divide & concquer method.
Let me also say that the video is made up of 9 parts of actual coding. :D
Satisfying.
Yes, that was not a coincidence ;-)
Amazing video dude! thank you so much for making this.
Thank you!! This helps a lot!!
Awesome tutorial!!! THANKS A LOT!!!
It's awesome video, thank you!
Legendary tutorial
;-) Thanks for your support!
Thank you for a super tutorial!
Hey Nick I'm really excited for the next tutorial as this one is very well explained and I understood it easily. Keep up the good work (Επίσης είμαι και εγώ Έλληνας :))
Hey, thanks for the comment! I am really excited for the next video as well! It will be my best so far! Γεια σου πατρίδα, αν φτιάξεις κάτι καλό να μου το στείλεις να το δω!
@@programmingwithnick I will for sure!
awesome video, God bless you for your channel
Couple of things, you really should make the member variables private and have appropriate setters/getters, in addition, the naming of the variables should be more descriptive, x can refer to many things, position_x or positionX would be an appropriate name.
Loved it. 👍
Super! Thanks You for the lesson.
I am glad you like it!
Great videos thank you
THANKS, i made my first game!
Thanks this is gold, keep it up plz
You are amazing bro I try to make it with SDL2
Awesome video
Awesome tutorial 👍
Thank you! Cheers!
Thank you for a great tutorial! One question though, and my question might be off but, delta time was not used for the movement of the ball nor the movement of the paddles.
Is this because you know that your computer will be able to run the pong game at 60 FPS at all times? If you were to make the game available for anyone, would you then use delta time for the movement?
Yes, since this is a super simple game, very computer can run it fast enough. This makes things easy. If I remove the fps limit, my computer can run the game at 5000 fps. Check the latest video on my channel for more info.
Thanks very much this is one of the best tutorials for beginners about both raylib and oop abilities in c++ , thank you a lot sir💙
But just a small question , do you need any extra extentions to run this on vs code? (Execpt the c++ extension of course)
And using codeblocks will do the same work right?
Glad it was helpful!
Fantastico tutorial,es tan bueno que hasta yo que no se ingles he podido seguirlo sin problemas.Sigue haciendo mas video de raylib que son muy buenos.
No se si te molesta que publique en español pero me es mas comodo que usar el traductor de google,pero si hay algun problema puedo usar el traductor.
¡Muchas gracias por tus palabras! Me alegra saber que pudiste seguir el tutorial a pesar de no hablar inglés. Continuaré haciendo más videos sobre raylib y trataré de hacerlos lo más claros y fáciles de entender posible. ¡Gracias por seguirme!
@@programmingwithnick Podrias en proximos videos,hacer un juego con dos niveles y ver como se puede pasar de un nivel a otro.Y tambien me gustaria saber como pausar el juego
Beautiful ❤
Wow, Excellent tutorial! I loved it! You have a new subscriber! Would it very difficult to do the same Pong Game in Unreal Engine 5?
Thanks for the sub! I have no experience with Unreal Engine so I can't help you with that. Sorry!
Hi Nick, no problem! Thank you so much for your excellent videos. Have a nice day!
Yes i do ti Game Creating for Beginers😅
may i ask, if i compile the project using your makefile, will i have to ship the game with all the assets and .dll files?
No you just have to ship the executable!
Hi Nick, loved your tutorial videos. I want to ask, is there a way to make all of these game projects without needing to delete the main.cpp source code and rewrite it all and instead make a new file and write the code there? Thank you in advanced!
for some reason whenever i run the program the ball keeps hitting an invis wall at x being 781 i have no clue what the reason could be because to me it looks like i did everything like the video showed
I am getting at CheckCircleCollisionRec saying narrowing of int to float
ball is moving back and forth on x axis in very small distance when i add circle rect collision code, it works file if i comment it, any idea what light be wrong?
nevermind, fixed it
Any help I am getting fetal error not found in such directory
This is terrific!!! I'm 90% into it and just have the players paddle moving inside the screen, however I seem to have TWO player paddles as one does move up and down, and another is stationary in the middle position???? Can't find the code issue causing this? Thanks!!
class Player {
public:
float x , y;
float speed;
float height, width;
KeyboardKey key_up, key_down;
Rectangle rec = {x, y, width, height};
void draw()
{
DrawRectangle(x, y, width, height, mainTheme[3]);
}
void update()
{
if (IsKeyDown(key_up))
{
if (y > 10) // moving only if its within the field
{
y -= speed;
}
}
if (IsKeyDown(key_down))
{
if (y + height < display_height - 10)
{
y += speed;
}
}
}
};
class Computer : public Player{
public:
void update(float ball_y, float ball_x)
{
if ((ball_y < y + height/2 && ball_x > display_width/2) || (ball_x > display_width/4.5 && ball_x < display_width/2.6)) // extra condition for more interactive bot
{
if (y > 10) // moving only if its within the field
{
y -= speed;
}
}
if ((ball_y > y + height/2 && ball_x > display_width/2)|| (ball_x > 20 && ball_x < display_width/5))
{
if (y + height < display_height - 10)
{
y += speed;
}
}
}
};
i hope this helps, its a better version of the one in vid
i just set it so that it can only move within the bounds
εισαι ωραιος
Thanks, cheers!
Thanks a lot :) one question ... there is a weird edge case for the collision, where the ball gets stuck in the paddle and is thrown back and forth. It happens when you catch the ball with the edge of the paddle. Is there a way around this ? Looked in documentation and web but wasnt able to find a solution
Did you manage to fix it?
how should we set-up raylib library before using it in this project ?
Check this video: ruclips.net/video/PaAcVk5jUd8/видео.html
@@programmingwithnick ok thanks
@@programmingwithnick hello I just completed creating the whole game, now I decided to create something more and male a menu screen which has start and exit buttons, so i came across raygui i wanted to ask how should I link raygui in the starter raylib template folder structure taken from git
Any plans on doing some sort of networking with raylib, always wanted to but never knew where to start
Thanks for the idea, I will look into it.
👍❤️👏👏
I did make Pong with olc PixelGameEngine
The big question, how can I win a score to cpu_player ? Because cpu_player never loose
You can decrease the cpu speed variable, increase the ball.speed variable or alter the AI algrotithm to move only when the ball is its part of the screen for example. There are many ways to achieve it.
Why is ball.Update called before ball.draw?
because code gets executed from top to bottom, logically it makes more sense to update the position before drawing the ball on the screen again, right? :)
💪 𝔭𝔯𝔬𝔪𝔬𝔰𝔪
Your tutorial was excellent! I loved how you broke down the steps and provided clear explanations.
btw, you have an instagram?
Thank you very much for your comment and the nice words. I am glad that you liked the video and the structure. I don't use social media, they distract me from the work, and believe me producing videos like this require a huge amount of time. If you want to see updates from me on the projects I am building check my community tab here on RUclips.