🔥Pong Game with C++ and Raylib - Beginner Tutorial

  Рет қаралды 73,089

Programming With Nick

Programming With Nick

Күн бұрын

Пікірлер: 118
@programmingwithnick
@programmingwithnick 2 жыл бұрын
I hope you took away lots from this video. Let me know below! PS: I created a course named "Object Oriented Programming Made Easy"! Sign up at bit.ly/3NaMfg4. Enroll now.
@kausarfatima1318
@kausarfatima1318 Жыл бұрын
Is it in C++?
@Zivvv187
@Zivvv187 Жыл бұрын
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 KZbin regarding c++ game programming (and I really mean it)!!
@programmingwithnick
@programmingwithnick Жыл бұрын
Thank you very much for your kind words! It means a lot. Messages like yours, keep me motivated!
@PektraNao
@PektraNao 5 ай бұрын
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!!!
@AKG58Z
@AKG58Z 2 ай бұрын
After Learning C++ i was unable to do anything with it since most of the good stuff is behind a paywall so i found this video you Literally gave me something to actually use c++ in. Thank You for your Detailed Explanations for every step and your Time.
@nadineputri5987
@nadineputri5987 15 күн бұрын
Thanks a lot, Sir! I learned so much from your videos. i've struggled with looking for coding tutorials that could teach me how to code, your explanation is beyond my expectation. Hope you're having a good day.
@TayoEXE
@TayoEXE 4 ай бұрын
Wow. This is the most unintimidating C++ game development tutorial I've come across. A clear high level explanation of the fundamental concepts of what a "game" even is via the game loop, and Raylib seems so easy to try! I want to give it a try now myself.
@programmingwithnick
@programmingwithnick 4 ай бұрын
Thanks! If you like these videos spread the word!
@sobottrachhuth75
@sobottrachhuth75 Жыл бұрын
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!
@marlonhelder
@marlonhelder Ай бұрын
Amazing tutorial! You explain all the code in a very didatic way and make it easy to understand both the c++ language / raylib and basic game concepts.
@carloscosta4713
@carloscosta4713 Ай бұрын
I am brazilian. E o seu trabalho é fantástico. Parabéns pelo excelente trabalho. Mais um inscrito!!!!
@TheSelfUnemployed
@TheSelfUnemployed 8 ай бұрын
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!
@chalkypj
@chalkypj 2 жыл бұрын
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.
@programmingwithnick
@programmingwithnick 2 жыл бұрын
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!
@charlesg.smithjr.3677
@charlesg.smithjr.3677 Жыл бұрын
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.
@DoktorJeep
@DoktorJeep Ай бұрын
For me the process of stopping the video and taking time to make my own code was 4 hours. Very good tutorial. A stroke make this a one arm ordeal.
@akaa3144
@akaa3144 Жыл бұрын
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!
@programmingwithnick
@programmingwithnick Жыл бұрын
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.
@akaa3144
@akaa3144 Жыл бұрын
@@programmingwithnick Will do, thank you!
@D3ss3rtTV
@D3ss3rtTV 8 ай бұрын
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.
@saurabhs
@saurabhs 3 ай бұрын
One of the Best Tutorial with Well Explanation!!!
@syedshow811
@syedshow811 11 ай бұрын
your contents are far better than the contents in paid Udemy courses!
@programmingwithnick
@programmingwithnick 11 ай бұрын
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.
@burakggm
@burakggm 2 ай бұрын
I understood oop better with just this small project, so much thanks!
@americamtheantitankie4843
@americamtheantitankie4843 5 ай бұрын
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.
@dabunnisher29
@dabunnisher29 7 ай бұрын
Your explanation is REALLY FANTASTIC!! You got me subscribed and thumbs up in Vegas. Thank you!!!!
@the_yugandharr
@the_yugandharr 3 ай бұрын
man this tutorial was PERFECT! love you bro!
@rafaelbezerra9178
@rafaelbezerra9178 Ай бұрын
Valeu!
@programmingwithnick
@programmingwithnick Ай бұрын
Obrigado!
@dp2120
@dp2120 11 ай бұрын
This was incredible. Thank you so much!
@ManulF-rm8em
@ManulF-rm8em 11 ай бұрын
Great Tutorial. It helped me A LOT!
@AaliJahBaig
@AaliJahBaig Жыл бұрын
Amazing video dude! thank you so much for making this.
@OktatOnline
@OktatOnline Жыл бұрын
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.
@programmingwithnick
@programmingwithnick Жыл бұрын
Yes, that was not a coincidence ;-)
@MinerBruh
@MinerBruh Жыл бұрын
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 (Επίσης είμαι και εγώ Έλληνας :))
@programmingwithnick
@programmingwithnick Жыл бұрын
Hey, thanks for the comment! I am really excited for the next video as well! It will be my best so far! Γεια σου πατρίδα, αν φτιάξεις κάτι καλό να μου το στείλεις να το δω!
@MinerBruh
@MinerBruh Жыл бұрын
@@programmingwithnick I will for sure!
@MortySmith-ji2fx
@MortySmith-ji2fx Жыл бұрын
Awesome tutorial!!! THANKS A LOT!!!
@chakerjouini
@chakerjouini 7 ай бұрын
True gem , exactly what i needed ! thank youu
@blazexy5657
@blazexy5657 Жыл бұрын
Man this is really helpful can you do more tutorial in C++ like making enemies and also doing 3D game dev stuff
@nokia_n-gage
@nokia_n-gage Жыл бұрын
Thank you for a super tutorial!
@staymotivated628
@staymotivated628 2 жыл бұрын
Legendary tutorial
@programmingwithnick
@programmingwithnick 2 жыл бұрын
;-) Thanks for your support!
@batler12
@batler12 Жыл бұрын
awesome video, God bless you for your channel
@MrRajan-km5gg
@MrRajan-km5gg 7 ай бұрын
very good tutorial and good explanation, thank you .
@Tims_Projects
@Tims_Projects 2 жыл бұрын
Loved it. 👍
@MoviestarsEnglish
@MoviestarsEnglish 2 жыл бұрын
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?
@programmingwithnick
@programmingwithnick 2 жыл бұрын
Thanks for the sub! I have no experience with Unreal Engine so I can't help you with that. Sorry!
@MoviestarsEnglish
@MoviestarsEnglish 2 жыл бұрын
Hi Nick, no problem! Thank you so much for your excellent videos. Have a nice day!
@rajithlahiru5580
@rajithlahiru5580 6 ай бұрын
Thank you!! This helps a lot!!
@victorien.h
@victorien.h 3 ай бұрын
Great video Nick! 😀 I have some issue, my game frezzing often, and change FPS to 30 or to 5000 don't change issues. always littles freezing along the game. what is the problem? and how i can fix it? thanks.
@thomasengland1701
@thomasengland1701 6 ай бұрын
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.
@AlaaAreesPhoenix
@AlaaAreesPhoenix Жыл бұрын
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?
@programmingwithnick
@programmingwithnick Жыл бұрын
Glad it was helpful!
@Albertmars32
@Albertmars32 Ай бұрын
one thing i dont understand is the ClearBackground() lets say our game wasnt this simple of only having a color for the background of the game, imagine it was like a landscape of a lot of different things going on. what exactly would we be passing in the parameter (Color color) if our background of our game is not just a color?
@lomvil
@lomvil 7 ай бұрын
It's awesome video, thank you!
@SashaIraq
@SashaIraq 2 жыл бұрын
Super! Thanks You for the lesson.
@programmingwithnick
@programmingwithnick 2 жыл бұрын
I am glad you like it!
@diegoaredes2721
@diegoaredes2721 Жыл бұрын
Awesome video
@aaabbbccc899
@aaabbbccc899 Жыл бұрын
THANKS, i made my first game!
@arfihussain6172
@arfihussain6172 2 жыл бұрын
Awesome tutorial 👍
@programmingwithnick
@programmingwithnick 2 жыл бұрын
Thank you! Cheers!
@manuelgarciagarcia2501
@manuelgarciagarcia2501 2 жыл бұрын
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.
@programmingwithnick
@programmingwithnick 2 жыл бұрын
¡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!
@manuelgarciagarcia2501
@manuelgarciagarcia2501 2 жыл бұрын
@@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
@ByzantineNode21
@ByzantineNode21 Ай бұрын
it was great!
@davidefarona
@davidefarona 9 ай бұрын
Thanks this is gold, keep it up plz
@evertgoran
@evertgoran 2 жыл бұрын
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?
@programmingwithnick
@programmingwithnick 2 жыл бұрын
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.
@docboisgameplay4245
@docboisgameplay4245 7 ай бұрын
I am getting at CheckCircleCollisionRec saying narrowing of int to float
@cppforfun
@cppforfun 6 ай бұрын
You are amazing bro I try to make it with SDL2
@sarkkk2134
@sarkkk2134 11 ай бұрын
how should we set-up raylib library before using it in this project ?
@programmingwithnick
@programmingwithnick 11 ай бұрын
Check this video: kzbin.info/www/bejne/hpKklImhas-Impo
@sarkkk2134
@sarkkk2134 11 ай бұрын
@@programmingwithnick ok thanks
@sarkkk2134
@sarkkk2134 11 ай бұрын
@@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
@Bbdu75yg
@Bbdu75yg Жыл бұрын
Beautiful ❤
@jefftamatthew
@jefftamatthew 10 ай бұрын
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!
@Dustlantic
@Dustlantic 7 ай бұрын
Great videos thank you
@pointshootgo
@pointshootgo 8 ай бұрын
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
@ledschmidt1441
@ledschmidt1441 11 ай бұрын
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!!
@junaidsultanxyz
@junaidsultanxyz 10 ай бұрын
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; } } } };
@junaidsultanxyz
@junaidsultanxyz 10 ай бұрын
i hope this helps, its a better version of the one in vid
@junaidsultanxyz
@junaidsultanxyz 10 ай бұрын
i just set it so that it can only move within the bounds
@Inveist
@Inveist 3 ай бұрын
whenever I launch it it always has a cmd behind it but yours don't? How do I remove that if possible? (I use visual studio and not vs code so that might be why. If you know how still it'd help a lot.)
@JaydenBlah-q1p
@JaydenBlah-q1p 3 ай бұрын
Can someone help me out here? I cant seem to run it in VScode. It keeps giving me an error of raylib.h not found
@Arjun-g2o
@Arjun-g2o 4 ай бұрын
Is it possible to make this on a Mac OS
@Phonk-y2f
@Phonk-y2f 5 ай бұрын
Any help I am getting fetal error not found in such directory
@LOLjerel
@LOLjerel 4 ай бұрын
Same here. I fixed it by replacing #include with #include "C: aylib aylib\src aylib.h"
@jaguaratica8358
@jaguaratica8358 4 ай бұрын
@@LOLjerel it worked here too, thanks!!
@getonWexford
@getonWexford 2 ай бұрын
How do you get it to work for c++ I’m pulling my hair out trying to get it to work
@TrySomeCG
@TrySomeCG 6 ай бұрын
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?
@TrySomeCG
@TrySomeCG 6 ай бұрын
nevermind, fixed it
@HoangHarry
@HoangHarry Жыл бұрын
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?
@programmingwithnick
@programmingwithnick Жыл бұрын
No you just have to ship the executable!
@kencg6566
@kencg6566 4 ай бұрын
👍👍✌
@RomanWaves
@RomanWaves 10 ай бұрын
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
@dahoppin1008
@dahoppin1008 9 ай бұрын
Did you manage to fix it?
@victorien.h
@victorien.h 3 ай бұрын
I think you find a solution since 6 months but i answer for other people having same issue. //Checking for collisions if(CheckCollisionCircleRec(Vector2{ball.x, ball.y}, ball.radius, Rectangle{player.x, player.y, player.width, player.height})) { ball.speed_x *= -1; ball.x -=1; } if(CheckCollisionCircleRec(Vector2{ball.x, ball.y}, ball.radius, Rectangle{cpu.x, cpu.y, cpu.width, cpu.height})) { ball.speed_x *= -1; ball.x +=1; }
@dimasbajuri
@dimasbajuri Жыл бұрын
Your tutorial was excellent! I loved how you broke down the steps and provided clear explanations. btw, you have an instagram?
@programmingwithnick
@programmingwithnick Жыл бұрын
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 KZbin.
@edhemkrivdic7402
@edhemkrivdic7402 5 ай бұрын
You explain it really good, but I have one question. What if I want to send someone my .exe file to see the game? Do they have to install raylib? Can i make it automated?
@programmingwithnick
@programmingwithnick 5 ай бұрын
No, you only need to send the executable.
@edhemkrivdic7402
@edhemkrivdic7402 5 ай бұрын
@@programmingwithnick Thank you
@cyberghot6902
@cyberghot6902 7 ай бұрын
Yes i do ti Game Creating for Beginers😅
@R2Sam
@R2Sam Жыл бұрын
Any plans on doing some sort of networking with raylib, always wanted to but never knew where to start
@programmingwithnick
@programmingwithnick Жыл бұрын
Thanks for the idea, I will look into it.
@dipcrew7337
@dipcrew7337 2 жыл бұрын
εισαι ωραιος
@programmingwithnick
@programmingwithnick 2 жыл бұрын
Thanks, cheers!
@ReversedChannel246
@ReversedChannel246 13 күн бұрын
35:09
@qbixmex
@qbixmex 2 жыл бұрын
The big question, how can I win a score to cpu_player ? Because cpu_player never loose
@programmingwithnick
@programmingwithnick 2 жыл бұрын
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.
@ankanray962
@ankanray962 Жыл бұрын
Why is ball.Update called before ball.draw?
@treyabolicum
@treyabolicum 9 ай бұрын
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? :)
@rubialugattimoreira1978
@rubialugattimoreira1978 2 жыл бұрын
👍❤️👏👏
@ZainAhmad-jl4vt
@ZainAhmad-jl4vt Жыл бұрын
I did make Pong with olc PixelGameEngine
@Haris-v3y
@Haris-v3y 3 ай бұрын
I made the game without using oops ,just some equations of analytical geometry and it works more than fine
@rutgerkanarek1883
@rutgerkanarek1883 2 жыл бұрын
💪 𝔭𝔯𝔬𝔪𝔬𝔰𝔪
C++ Snake game using raylib - Beginner Tutorial 🐍 (OOP)
1:13:43
Programming With Nick
Рет қаралды 76 М.
Programming a multiplayer game from scratch in 7 DAYS
18:28
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.
Making a Game With C++ and SDL2
8:14
PolyMars
Рет қаралды 1,7 МЛН
Python With Pycharm 10 - Array
17:13
King Tut
Рет қаралды 8
Making a Game With C++ and SDL2
5:34
Goodgis
Рет қаралды 683 М.
Should I have used Unity instead of Raylib for my Indie game?
10:11
Lingon Studios
Рет қаралды 43 М.
Coding Adventure: Atmosphere
22:00
Sebastian Lague
Рет қаралды 1,1 МЛН
One year of my C++ SFML journey
5:39
Snapi
Рет қаралды 435 М.
Is C BETTER than C++ for beginners? // Code Review
31:16
The Cherno
Рет қаралды 96 М.
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41