I hope you took away lots from this video. Let me know below! PS: I'm creating an OOP course! Sign up at programmingwithnick.com/course for early access and a 50% launch discount.
You are honestly amazing, you explain everything so clearly and I have developed so quickly aswell watching your videos. Thank you soo much. You should definetly have atleast a hundred thousand subscribers with this content. Im sure if you keep going its a matter of time before you can reach it!!
Hi Nick, actually watching your video at midnight on New Year day lol Just wanted to say I really enjoyed your video, it must have been some work for you ! As a total beginner in game dev ( and 5 months of learning of C++ ), your way of teaching is really smooth for me ! I attempted to do Tetris by myself using SFML library as my second practice project, after a while I realized my mistake was to create new objects sliding in my grid instead of using the blocks already there as you did, and the map idea for the block's rotation really opened my mind ! Thanks for the video , happy 2024 for anyone reading this :)
bro you honestly have no idea... i was doing the exact same thing, i was drawing objects in front of the grid instead of updating the grid's colours, and it was such a pain to fix, only to realise it was 2 lines of code for updating the cell positions... i felt like such an idiot, but i'm proud to say I did it, and it was a fun project to do
Just wanted to say *thank you* for the tutorial! I'm brand new to RayLib and I've been using your tutorial to build the project in the Odin language. Even though I'm not using C++, your video made it a lot easier for me to get over the hurdles I've been having.
Gave a like before even watching the video. Was waiting for more C++ tutorials from you. I created the snake game following your video and loved the explanations and content quality. I am sure this one is going to be as good as that one. Keep up the good work 👍🏻😁.
Love the detail and some explanations done visually though it was kind of hard to code along trying to understand anything as a beginner, still like this stuff.
Another great tutorial from you Nick. Great to see you have put more info about classes. As before I need to watch it a bit at a time, I am about half way through it at the moment.
Fantastic tutorial Nick! Your work just gets better and better with every video. I love how much attention you put in structuring the code this time. We learned valuable lessons about proper c++ coding practices. Writing this code is not difficult for an experienced programmer, but explaining the idea behind every method and organizing optimal the order in which you present methods for learners, must have took a lot of planning. Can you share how much time it takes to make such video for us? P.S. Python is my primary language, but I too would like more C++ content please :)
Thank you very much for your kind words and the feedback. I am glad that work I do gets better and that it is useful. It takes a lot of time to prepare a video like this, around 1 month full time. Cheers!
Fantastic!! Can't get enough of your videos, already completed the raylib pong and raylib retro snake working through this project now. I really enjoy the progression in difficulty between these videos. Can't wait for more
You don't need to make it OOP to add different blocks. Just have an array of the blocks, and each block has 4 hard coded rotations Now you only need to have a block id and rotation id. To rotate it just do: rotation_id = (rotation_id + 1) % 4; To get the rotation do: blocks[block_id][rotation_id]; You could also put all the rotations into a struct named Block or something, and store the offset it needs to be centered. For example: #define ROTATIONS (4) #define GRID_SIZE (4*4) struct Block { uint8_t x, y; uint8_t rotation_id; uint8_t x_centered_offset; uint8_t rotations[ROTATIONS][GRID_SIZE]; }; If you want to optimize it more you could use a bit array on a uint16_t
thank u so much nick, I have never found a game tutorial as detailed and clear as this, I hope you continue this learning video again, especially c++ and raylib, let me know if you have a paid or free course related to raylib and c++.
8:30 Technically where the center of the coordinate system is depends on what you are using. OpenGL has it in the center of the window. Some have it in the bottom left. Others have it in the top left. And there a likely other ones out there too.
Nice tutorial, to reduce your code base you can use raylibs built in macros for colors e.g. raylib has #define GREEN (Color){ 0, 255, 0, 255 }. This means as part of function that returns a Color object you can simply say things like return GREEN and save yourself from defining your own colors.
I followed your other video to install raylib but its showing - fatal error : raylib.h : no such file or directory Please provide a solution for this as earlier i igonred incorporating raylib in vs code but now i am halfway in your tetris video and this is not working 😢😢
Truly an amazing video, a bit more advanced than my level but I was able to keep up and it learnt me a lot. Thank you for that deeply. And btw your voice is very nice to listen to, reminded me a bit about the voice actor of Crash Bandicoot's Neo. :D (y) May I ask how do you always build and run the game so fast? When I select either Start or Start without debugging, it takes a bit more time than yours.
Thanks for your feedback! I'm glad you're interested in a Raylib with C++ course. I'd love to get your input on what topics you'd like to see covered. Cheers!
@@programmingwithnick For a broader audience, I suggest beginning with a crash course in C++ and then diving into a smaller game project (so one can apply the c++ knowledge you learned). As the course progresses, introduce more advanced topics in C++ and raylib. Since I'm not a game dev by profession (I'm a full-stack dev in TS and Java not doing much math in my daily work), it'd be awesome to explore some Math topics related to Game programming too (since these are often not covered well in other videos I've seen). I think it'd be awesome to start with a 2D course first (covering the topics mentioned) and then move on to 3D later. Starting with 2D will be easier since it involves less advanced math. So a 2D course and 3D course would be ideal! :)
@@programmingwithnick I also think including Game Theory (like you explain very well in your tutorials with images) is invaluable! Once you learn the theory behind why something works the way it does, then you become good at thinking in the terms of it. Like an artist thinks in shapes before drawing.
Amazing tutorial! The game works very well! I have just one question. I am new to C++ and everyone is talking about pointers in C++ and how important it is to understand them, but the only pointer you used in the entire video was "this". Are you just trying to make it easier for beginners? Could you make the game better with pointers?
Nick, i do not understand the miltiplication in the grid. When you start with 0 * cellSize the product should be 0. If i remove the cellSize then the grid wil not work. Thank you.
Thank you so much for this tutorial! I've not only learned about game logic and programming, but also some C++ style. I read in a comment below that it's a bad practice to include a .cpp, why is that? I'm still a beginner at C++, and I'd really like to learn everything that's possible.
It is easier to quickly understand the functionality of a class by looking at the function headers in a .h file. The .cpp file only contains the implementation, which you dont need to see to be able to understand its purpose. This applies to both people using the code, and the compiler itself.
Hey i am beginner and using c programming language so will ut be hard to follow this video and make in c? because i heard that c and c++ are similar with c++ has more feature
BRO!! your ways is working.and I feel great! but next day1 when run program again in vscode, it was showing like raylib.h is not found.but yestday was working. I had no idea.When I research others also got error too. So can you please......
Hi nick great tutorial iv been waiting long time for someone to make GUI style games in cpp in a nice and easy framework like raylib. wanted to ask will it be better to use dynamic memory in this project for various things? Let me know what you think and if it possible for you to make future tutorial using dynamic memory ? just to make it more complete
Thank you Eric for your comment! I'm glad you enjoyed my Tetris tutorial. Dynamic memory is a powerful tool that can be used to allocate memory to variables at runtime. This can be useful for a variety of things, such as creating large data structures or allocating memory for objects that need to be resized or deleted. In the Tetris tutorial, I used static memory for all of the variables. This was done to keep the code simple and easy to follow. However, it is possible to use dynamic memory in the tutorial to improve performance or make the code more flexible. For example, you could use dynamic memory to allocate memory for the Tetris board. This would allow you to create boards of any size, which would be useful for creating more challenging levels. You could also use dynamic memory to allocate memory for the Tetris pieces. This would allow you to create new pieces as needed, which would make the game more unpredictable. If you're interested in learning more about dynamic memory, I recommend checking out the following resources: Dynamic Memory Allocation in C++: www.tutorialspoint.com/cplusplus/cpp_dynamic_memory.htm The new and delete operators in C++: www.tutorialspoint.com/new-and-delete-operator-in-cplusplus I'm planning to create a future tutorial on dynamic memory in C++. I'll be sure to let you know when it's available. Thanks again for your feedback!
@@programmingwithnick thank you for replying Nick ,in the meantime I’ll try my luck with this project I will try to recreate it from scratch again but using dynamic memory as you said , hopefully it will go well . 😅
@@programmingwithnick you wrote "This would allow you to create new pieces as needed" , when we use map as you did named cell isnt it already dynamically propetry that we can add more and more states ? and one more thing lets say i want to add more pieces to the game how can i do that dynamically ? I cant think of a way to create one and access its properties at the same time can you please help with that ?
Amazing video, but when I would rotate the TBlock and JBLock, some of the rotation states would not be completed, and I have tried to fix it for hours and I haven't figured it out, please help!
Nick, can you explain to me something i do not understand about the grid. In the grid you start with 0 and multiply it with cellSize. The product should be 0. If I eliminate the cellSize in the multiplication the grid will not work correctly. Thanks.
cellSize is not always multiplied by zero. It is multiplied by other numbers (in a loop) to give the coordinates of the corners of each cell in the grid. Change the value from 30 and it will appear a different size.
@30:05 I don't understand how this is working? is it because the only thing definable in the object/method Grid() only has one definable parameter? what would happen in there was another array parameter within Grid::Grid()?
Using raylib 5 and I'm getting a nasty console message popup, even Norton says bad things....SO am i using the wrong version? Can't get any game window to show? thanks much
This is a great tutorial, but I have a problem. When I delete the ball.cpp and ball.h file and I try to debug the program the game breaks and says that main file does not exist. Could you perhaps help me? I would be really thankful!
"Hey friend . This video you uploaded on RUclips can continue playing as a small window on mobile. This feature doesn't work with any other content on my phone. How did this happen? I'm using Android."
I Studies a DOUBLE Degree. Both Electronics and Software Engineering. I Had 4 Modules in My Final Year, Plus The Final Year Project, Tetris (5 in Total). The One Studying Software Engineering. Had Two Modules. 1 First Semester, Another the second Semester and Noughts and Crosses for final Year Project. Those Studying Computer Science. Had 1 Module 1st Semester and Their Final Year Project. Those Studying Computing. Had Half a Module and Their Final Year Project.
Man I can't get raylib working... I installed it from official website then I tried to run a project for vs code which comes with the installation but it keeps telling me that: raylib.h NOT FOUND but WTF everything is installed correctly and the path specified in all of the project files why doesn't it work??? I use windows 11 Idk if that makes a difference but raylib just doesn't work for me in vs code whatever I try to do and there is no answer on the web how to fix it. Pls help.
@@programmingwithnick I don't know how probably by pure magic but I made it work somehow... Before when I was trying to run it with F5 nothing happened then I tried to run basic_window program from raylib directory and it compiled and run then I tried your program and it ran as well. Now I can see the same windows with a ball like in your video. Thanks alot man It took me few hours to make it work and I still don't actually know how exactly lol...
Great tutorial and I learned a lot, however there an error when is used #include "grid.h" in main cpp file but works fine if I changed it to #include "grid.cpp"
Hello, I woud like to write the game in MC visual studio, but you provide the "starter template" only for VS code ? How I Can follow this tutorial or I dont need any started template in Microsoft Visual Studio ? / (I have installed raylib to my MC visual studio,)
It allows for user input and outputting audio/video. It is not a game engine, so you have to write your own logic, and that includes networking. It supports it as much as you're willing to do it yourself
I’m guessing it’s because the compiler can’t find the source files. The compiler only looks in the specified folder, it doesn’t automatically look into any subfolders you have created within it. After a quick look in the makefile, I can’t find any point where it checks for subfolders. You would have to modify the makefile so that it checks all subfolders in src/ as well (I don’t know how one would do that, GNU make is wizardry to me)
I found your channell and iots answering all my questions aboyt game dev with raylib, Thank you so muhc for your efforts, let me know if u have a patreon to subscribe there and suport this channel
Thank you very much for your feedback. I am glad my videos are helpful. I don't have a patreon account but If you want to help the channel financially you can become a member of the channel which is similar to Patreon by pressing the Join button. If you want you can also press the thanks button under any video and donate once. Thank you very much!
@@programmingwithnick no worries! I found your video useful to follow along. Since I wanted to watch a tutorial on raylib. I was able to follow along just fine and ended up making modifications as I saw best. The main things the bug me about your video for beginners is the mixing of C and CPP styles and conventions. You make no mention that raylib is a C library and that you are useing a CPP main. But you write headers with a h file and use c style arrays. Also you include iostream to access sprintf to write into a char [10] ??? That is just flat out wrong. Why would you not use std::string and std::to_string and use .c_str() to pass strings to RayLib? So for beginners this tutorial is very misleading and shows bad practices. But I did enjoy this tutorial non the less. Subscribed.
Thanks for your time to write this comment. It is really very useful to me to understand how beginners or advanced users use my videos. I noted all the issues you mentioned and I will fix them in the upcoming Space Invaders tutorial in C++ and raylib. You are right, I didn't mention clearly that we are using C++ with a C library. That's something that I didn't think it might mislead the viewers. That's a perfect example of the "Curse of Knowledge". Once you know something is dificult to think as someone who does not know that thing. Thanks to you, I know now how I might mislead and confuce my viewers. That's the power of a diferent perspective. No that I am aware of it, I will try to fix it. If there are any other areas of improvent I would love to know them. Thank you very much again for your help.
Tetris is Far Beyond Your Species Ability. Your Alan Turing (Leslie Lamport), Bill Gates or Steve Wozniak. The Best They Can Do is Noughts and Crosses or Pong. You're Brain is a Quarter the Power of Mine. Tetris is Medium Complexity. Donkey Kong (1981), Started Development in 1976 with Atari 2600. It Wasn't Released for Atari. NES: Donkey Kong (1981), Mario: NES 1985. Super Mario: Super NES: 1990. 5 Years to Donkey Kong. 10 Years to Mario. 15 Years to Super Mario. I'll Tell You Whats More Complex Than Tetris. Kernel Kesaria.
I hope you took away lots from this video. Let me know below!
PS: I'm creating an OOP course! Sign up at programmingwithnick.com/course for early access and a 50% launch discount.
amazing video but how can i make the move block left be able to hold and it will keep going to the left, not just one cell. thank you!
i am looking at doing this soon when i am motivated enough, how long did it take you to create this tetris? with or without internet ?
never have i seen a more in-depth tutorial than this, amazing work!
Just finished a computer siance degree , i have never had a better teacher than you . i wish i had professors this good ,
I followed this whole tutorial and it worked, thank you a lot
You are honestly amazing, you explain everything so clearly and I have developed so quickly aswell watching your videos. Thank you soo much. You should definetly have atleast a hundred thousand subscribers with this content. Im sure if you keep going its a matter of time before you can reach it!!
Hi Nick, actually watching your video at midnight on New Year day lol
Just wanted to say I really enjoyed your video, it must have been some work for you !
As a total beginner in game dev ( and 5 months of learning of C++ ), your way of teaching is really smooth for me !
I attempted to do Tetris by myself using SFML library as my second practice project, after a while I realized my mistake was to create new objects sliding in my grid instead of using the blocks already there as you did, and the map idea for the block's rotation really opened my mind !
Thanks for the video , happy 2024 for anyone reading this :)
bro you honestly have no idea... i was doing the exact same thing, i was drawing objects in front of the grid instead of updating the grid's colours, and it was such a pain to fix, only to realise it was 2 lines of code for updating the cell positions... i felt like such an idiot, but i'm proud to say I did it, and it was a fun project to do
dont stop making raylib tutorials!
I won't. More tutorials like this are coming, but they need a lot of time to produce!
@@programmingwithnick thanks for these videos
Trying to move Raylib to a different drive requires sacrificing your firstborn child and the blood of innocents
when installing raylib from the original source, it doesnt even allow to choose the location. Did hear some critics talking about it.
Just wanted to say *thank you* for the tutorial! I'm brand new to RayLib and I've been using your tutorial to build the project in the Odin language. Even though I'm not using C++, your video made it a lot easier for me to get over the hurdles I've been having.
Please keep these coming. Games are pretty cool, but I hope we also get to see some C++ CRUD apps also.
I love more C programming. But its interesting too!
Gave a like before even watching the video. Was waiting for more C++ tutorials from you. I created the snake game following your video and loved the explanations and content quality. I am sure this one is going to be as good as that one. Keep up the good work 👍🏻😁.
Thank you very much for your support! I am glad you find my videos useful!
the most under rated channel ever
It was such an amazing project! I learnt so much and made my first game!! 🤩 Totally a G.O.A.T 🙏
I followed this whole tutorial and it worked! Thank you for making it so straightforward, I am a beginner and I appreciate it! :D
Glad it helped!
Love the detail and some explanations done visually though it was kind of hard to code along trying to understand anything as a beginner, still like this stuff.
This was awesome. Love your process of explaining what the code does. Learned a lot. Keep it up!
Damn, so many things I was trying to do the hard way, but was so simple
I was trying to make sfml work but it never did so im now trying with raylib and im making huge progress tysm
Another great tutorial from you Nick.
Great to see you have put more info about classes.
As before I need to watch it a bit at a time, I am about half way through it at the moment.
Thank you Tim for your feedback, I hope this video helps you improve your C++ knowledge.
One of the best tutorials on game development BRAVISSIMO!! Tha a lot for sharing
Fantastic tutorial Nick! Your work just gets better and better with every video. I love how much attention you put in structuring the code this time. We learned valuable lessons about proper c++ coding practices.
Writing this code is not difficult for an experienced programmer, but explaining the idea behind every method and organizing optimal the order in which you present methods for learners, must have took a lot of planning.
Can you share how much time it takes to make such video for us?
P.S. Python is my primary language, but I too would like more C++ content please :)
Thank you very much for your kind words and the feedback. I am glad that work I do gets better and that it is useful. It takes a lot of time to prepare a video like this, around 1 month full time. Cheers!
Thanks for a new tutorial.😉😍
I hope you like it!
Fantastic!! Can't get enough of your videos, already completed the raylib pong and raylib retro snake working through this project now. I really enjoy the progression in difficulty between these videos. Can't wait for more
This is a really great tutorial. I dig your accent too. Thank you.
you are the best .. keep going you deserve a lot of subscribers.... your videos are amazing
10/10 Explanation, nice video!
Thank you!
Thanks a lot for great tutorial.
You don't need to make it OOP to add different blocks. Just have an array of the blocks, and each block has 4 hard coded rotations
Now you only need to have a block id and rotation id.
To rotate it just do: rotation_id = (rotation_id + 1) % 4;
To get the rotation do: blocks[block_id][rotation_id];
You could also put all the rotations into a struct named Block or something, and store the offset it needs to be centered.
For example:
#define ROTATIONS (4)
#define GRID_SIZE (4*4)
struct Block {
uint8_t x, y;
uint8_t rotation_id;
uint8_t x_centered_offset;
uint8_t rotations[ROTATIONS][GRID_SIZE];
};
If you want to optimize it more you could use a bit array on a uint16_t
thank u so much nick, I have never found a game tutorial as detailed and clear as this, I hope you continue this learning video again, especially c++ and raylib, let me know if you have a paid or free course related to raylib and c++.
Yes, I am working on a Space Invaders tutorial with raylib in C++. It is going to be awesome. Stay tuned!
best tutorial ever!
your wisdom of teaching is great i just subscribed now thanks💜💜💜💜💜💜💜💜
8:30
Technically where the center of the coordinate system is depends on what you are using.
OpenGL has it in the center of the window. Some have it in the bottom left. Others have it in the top left. And there a likely other ones out there too.
Please do more videos like this
This video is very helpful, thank you
I will watch this later completely, but it's good that you are using headers. I had some problems rewriting the snake example with headers.
Yes, this is a more complex project, and it is imposible to write it without headear files. Thanks for the feedback.
Nice tutorial, to reduce your code base you can use raylibs built in macros for colors e.g. raylib has #define GREEN (Color){ 0, 255, 0, 255 }. This means as part of function that returns a Color object you can simply say things like return GREEN and save yourself from defining your own colors.
Very informative tutorial. thank you so much 👍
Thanks for your feedback!
Thanks to you Nick for improving our game development skills, and teaching us how to use libraries, OOP concepts and VisualStudios.
Vector of blocks Out Of Range, debuged that for 2 hours, nothing happens
I followed your other video to install raylib but its showing - fatal error : raylib.h : no such file or directory
Please provide a solution for this as earlier i igonred incorporating raylib in vs code but now i am halfway in your tetris video and this is not working 😢😢
Truly an amazing video, a bit more advanced than my level but I was able to keep up and it learnt me a lot. Thank you for that deeply. And btw your voice is very nice to listen to, reminded me a bit about the voice actor of Crash Bandicoot's Neo. :D (y)
May I ask how do you always build and run the game so fast? When I select either Start or Start without debugging, it takes a bit more time than yours.
You deserve a lot of subscribers.... your videos are amazing and educational keep up good work 😄
Hey Nick, great tutorial! But why do you clear the completed rows if they are going to be overwritten by the upper rows anyway?
Please consider making a full paid course on Raylib with c++!!
I would be more than willing to pay for it.
Thanks for your feedback! I'm glad you're interested in a Raylib with C++ course. I'd love to get your input on what topics you'd like to see covered. Cheers!
@@programmingwithnick For a broader audience, I suggest beginning with a crash course in C++ and then diving into a smaller game project (so one can apply the c++ knowledge you learned). As the course progresses, introduce more advanced topics in C++ and raylib. Since I'm not a game dev by profession (I'm a full-stack dev in TS and Java not doing much math in my daily work), it'd be awesome to explore some Math topics related to Game programming too (since these are often not covered well in other videos I've seen). I think it'd be awesome to start with a 2D course first (covering the topics mentioned) and then move on to 3D later. Starting with 2D will be easier since it involves less advanced math.
So a 2D course and 3D course would be ideal! :)
@@programmingwithnick I also think including Game Theory (like you explain very well in your tutorials with images) is invaluable! Once you learn the theory behind why something works the way it does, then you become good at thinking in the terms of it. Like an artist thinks in shapes before drawing.
Amazing tutorial! The game works very well! I have just one question. I am new to C++ and everyone is talking about pointers in C++ and how important it is to understand them, but the only pointer you used in the entire video was "this". Are you just trying to make it easier for beginners? Could you make the game better with pointers?
finally managed to understand what the heck is .h file :)
Nick, i do not understand the miltiplication in the grid. When you start with 0 * cellSize the product should be 0. If i remove the cellSize then the grid wil not work. Thank you.
Thank you so much for this tutorial! I've not only learned about game logic and programming, but also some C++ style. I read in a comment below that it's a bad practice to include a .cpp, why is that? I'm still a beginner at C++, and I'd really like to learn everything that's possible.
It is easier to quickly understand the functionality of a class by looking at the function headers in a .h file. The .cpp file only contains the implementation, which you dont need to see to be able to understand its purpose. This applies to both people using the code, and the compiler itself.
very good!
Great tutorial Nick! Is it also possible to make an intermediate to advanced level project in Raylib as well? Thanks!
Hey i am beginner and using c programming language so will ut be hard to follow this video and make in c? because i heard that c and c++ are similar with c++ has more feature
good...channel...
hello...i do every things well but exactly not getrandomblock work in mine? and everytimes return last index of allblocks!
καλο το tutorial Νικο
BRO!! your ways is working.and I feel great! but next day1 when run program again in vscode, it was showing like raylib.h is not found.but yestday was working. I had no idea.When I research others also got error too. So can you please......
amazing vid 👍🙏
Thank you very much!
Guys, put it on 0.75 speed, works wonders...
Hi nick great tutorial iv been waiting long time for someone to make GUI style games in cpp in a nice and easy framework like raylib.
wanted to ask will it be better to use dynamic memory in this project for various things?
Let me know what you think
and if it possible for you to make future tutorial using dynamic memory ? just to make it more complete
Thank you Eric for your comment! I'm glad you enjoyed my Tetris tutorial.
Dynamic memory is a powerful tool that can be used to allocate memory to variables at runtime. This can be useful for a variety of things, such as creating large data structures or allocating memory for objects that need to be resized or deleted.
In the Tetris tutorial, I used static memory for all of the variables. This was done to keep the code simple and easy to follow. However, it is possible to use dynamic memory in the tutorial to improve performance or make the code more flexible.
For example, you could use dynamic memory to allocate memory for the Tetris board. This would allow you to create boards of any size, which would be useful for creating more challenging levels. You could also use dynamic memory to allocate memory for the Tetris pieces. This would allow you to create new pieces as needed, which would make the game more unpredictable.
If you're interested in learning more about dynamic memory, I recommend checking out the following resources:
Dynamic Memory Allocation in C++: www.tutorialspoint.com/cplusplus/cpp_dynamic_memory.htm
The new and delete operators in C++: www.tutorialspoint.com/new-and-delete-operator-in-cplusplus
I'm planning to create a future tutorial on dynamic memory in C++. I'll be sure to let you know when it's available.
Thanks again for your feedback!
@@programmingwithnick thank you for replying Nick ,in the meantime I’ll try my luck with this project I will try to recreate it from scratch again but using dynamic memory as you said , hopefully it will go well . 😅
@@programmingwithnick you wrote "This would allow you to create new pieces as needed" , when we use map as you did named cell isnt it already dynamically propetry that we can add more and more states ?
and one more thing lets say i want to add more pieces to the game how can i do that dynamically ? I cant think of a way to create one and access its properties at the same time
can you please help with that ?
You the real MVP
Wow! Thank you very much! That's really helpful!
Amazing video, but when I would rotate the TBlock and JBLock, some of the rotation states would not be completed, and I have tried to fix it for hours and I haven't figured it out, please help!
Plase: Time 1h37 debug : Vector subcript out of range
me too...
Nick, can you explain to me something i do not understand about the grid. In the grid you start with 0 and multiply it with cellSize. The product should be 0. If I eliminate the cellSize in the multiplication the grid will not work correctly. Thanks.
cellSize is not always multiplied by zero. It is multiplied by other numbers (in a loop) to give the coordinates of the corners of each cell in the grid. Change the value from 30 and it will appear a different size.
@30:05 I don't understand how this is working? is it because the only thing definable in the object/method Grid() only has one definable parameter? what would happen in there was another array parameter within Grid::Grid()?
This is great, but the "pop" sound when a key-combination appears on screen is a little piercing for those of us with headphones....
Thanks for great tutorial bro. But I have a issue my sound is not working I followed everything.
Do you call UpdateMusicStream(game.music); inside the game loop?
@@programmingwithnick It's working now. I accidentally gave wrong path to the sound 😅
Nick, Should I download Visual Studio Code or Visual Studio Community? Which one should I choose?
What ever you want. VS Code is lighter and ideal for small projects. For bigger project I would choose Visual Studio.
@@programmingwithnick Thank you very much!! Your video helped me a lot
Using raylib 5 and I'm getting a nasty console message popup, even Norton says bad things....SO am i using the wrong version? Can't get any game window to show? thanks much
It's work!!
This is a great tutorial, but I have a problem. When I delete the ball.cpp and ball.h file and I try to debug the program the game breaks and says that main file does not exist. Could you perhaps help me? I would be really thankful!
i just want raylib to work in my vscode ☠
Did it work?
"Hey friend . This video you uploaded on RUclips can continue playing as a small window on mobile. This feature doesn't work with any other content on my phone. How did this happen? I'm using Android."
I Studies a DOUBLE Degree. Both Electronics and Software Engineering.
I Had 4 Modules in My Final Year, Plus The Final Year Project, Tetris (5 in Total).
The One Studying Software Engineering. Had Two Modules. 1 First Semester, Another the second Semester and Noughts and Crosses for final Year Project. Those Studying Computer Science. Had 1 Module 1st Semester and Their Final Year Project. Those Studying Computing. Had Half a Module and Their Final Year Project.
Man I can't get raylib working... I installed it from official website then I tried to run a project for vs code which comes with the installation but it keeps telling me that: raylib.h NOT FOUND but WTF everything is installed correctly and the path specified in all of the project files why doesn't it work??? I use windows 11 Idk if that makes a difference but raylib just doesn't work for me in vs code whatever I try to do and there is no answer on the web how to fix it. Pls help.
Check out this video and tell me if it works: ruclips.net/video/RGzj-PF7D74/видео.html
@@programmingwithnick I don't know how probably by pure magic but I made it work somehow... Before when I was trying to run it with F5 nothing happened then I tried to run basic_window program from raylib directory and it compiled and run then I tried your program and it ran as well. Now I can see the same windows with a ball like in your video. Thanks alot man It took me few hours to make it work and I still don't actually know how exactly lol...
Now that I solved this problem I can finally dive into your tutorials. Thanks alot.
Great tutorial and I learned a lot, however there an error when is used #include "grid.h" in main cpp file but works fine if I changed it to #include "grid.cpp"
make sure the include statements match the file names
Hello, I woud like to write the game in MC visual studio, but you provide the "starter template" only for VS code ? How I Can follow this tutorial or I dont need any started template in Microsoft Visual Studio ? / (I have installed raylib to my MC visual studio,)
Check out this repo: github.com/educ8s/Cpp-Raylib-Starter-Template-for-Visual-Studio
Απ'το πρωτο λεπτο σε καταλαβα ρε ατιμε🤣🤣
Ενιωθες σαν το σπίτι σου ε;
is raylib support multiplayer and networking?
It allows for user input and outputting audio/video. It is not a game engine, so you have to write your own logic, and that includes networking. It supports it as much as you're willing to do it yourself
If I try to organize the files in directories inside the "src" folder, the project won't compile at all. Why? please help
Maybe the “imports” in each class needs to be updated
I’m guessing it’s because the compiler can’t find the source files. The compiler only looks in the specified folder, it doesn’t automatically look into any subfolders you have created within it. After a quick look in the makefile, I can’t find any point where it checks for subfolders. You would have to modify the makefile so that it checks all subfolders in src/ as well (I don’t know how one would do that, GNU make is wizardry to me)
@@Sealedaway thank you! that's very useful
20:41
2: 30:09
3: 57:55
Spaniard or Greek?
Can we make the columnOffset = 3 in the Block() definition instead of getting each subblock to Move(0,3)?
I found your channell and iots answering all my questions aboyt game dev with raylib, Thank you so muhc for your efforts, let me know if u have a patreon to subscribe there and suport this channel
Thank you very much for your feedback. I am glad my videos are helpful. I don't have a patreon account but If you want to help the channel financially you can become a member of the channel which is similar to Patreon by pressing the Join button. If you want you can also press the thanks button under any video and donate once. Thank you very much!
You sound like you are from Greece.
Yes I am Greek!
@@programmingwithnick you do awesome work !!!
this video has a lot of bad practices in it... including a .cpp
Thanks for the feedback. I understand my code is not perfect and messages like yours help me improve. Thanks again!
@@programmingwithnick no worries! I found your video useful to follow along. Since I wanted to watch a tutorial on raylib. I was able to follow along just fine and ended up making modifications as I saw best. The main things the bug me about your video for beginners is the mixing of C and CPP styles and conventions. You make no mention that raylib is a C library and that you are useing a CPP main. But you write headers with a h file and use c style arrays. Also you include iostream to access sprintf to write into a char [10] ??? That is just flat out wrong. Why would you not use std::string and std::to_string and use .c_str() to pass strings to RayLib? So for beginners this tutorial is very misleading and shows bad practices. But I did enjoy this tutorial non the less. Subscribed.
Thanks for your time to write this comment. It is really very useful to me to understand how beginners or advanced users use my videos. I noted all the issues you mentioned and I will fix them in the upcoming Space Invaders tutorial in C++ and raylib. You are right, I didn't mention clearly that we are using C++ with a C library. That's something that I didn't think it might mislead the viewers. That's a perfect example of the "Curse of Knowledge". Once you know something is dificult to think as someone who does not know that thing. Thanks to you, I know now how I might mislead and confuce my viewers. That's the power of a diferent perspective. No that I am aware of it, I will try to fix it. If there are any other areas of improvent I would love to know them. Thank you very much again for your help.
Thankyou so much!!
But, at the end, I've noticed the sound effects has a little bit delay on key pressed and complete the row.
Did you know why?
Tetris is Far Beyond Your Species Ability. Your Alan Turing (Leslie Lamport), Bill Gates or Steve Wozniak. The Best They Can Do is Noughts and Crosses or Pong. You're Brain is a Quarter the Power of Mine. Tetris is Medium Complexity.
Donkey Kong (1981), Started Development in 1976 with Atari 2600. It Wasn't Released for Atari.
NES: Donkey Kong (1981), Mario: NES 1985. Super Mario: Super NES: 1990. 5 Years to Donkey Kong. 10 Years to Mario. 15 Years to Super Mario.
I'll Tell You Whats More Complex Than Tetris. Kernel Kesaria.