Hey these tutorials have helped me so much with my programming and everything that i have created so far has worked perfectly except I don't fully understand making the Rectangle Header, all I have in there right now is the "struct Rect {int x, y, w, h;};", yet when I include the Rectangle header into let's say the Stick Header and try to assign the variables "x, y, w, or h" a number, it tells me, identifier "variable" is undefined, what am I doing wrong? Please help, your the best :D
@ForeverMick32 Are you literally trying to assign something to "variable"? It sounds like you're using that as a variable name, but it doesn't actually exist.
what about if a small rectangle is completely encompassed by a bigger rectangle... in that case, there is a collision, but it would not be detected by this, right? :)
@retromelon123 If you have a large rectangle (say, around the entire sprite), and then a smaller one inside (perhaps the character's head, specifically), you would do a test for only the large rectangle first.
If the large rectangle is not hit, it goes without saying that the small one is also not hit so you don't have to test.
If the large rectangle is hit, you'd do a second test with the small one to see if, say, it's a "head shot" and then react accordingly whether it's true/false.
sorry iam new on all this stuff and i have a question,, idont know if u can help me ,mmm as i say iam new and iam going to star learning programing but this is the thing what lenguage is the best to leran right now C++ or C#?? i realy appreciate if u can help me a little whit this !!..
@TypeRCsl Go to the "LusikkaMage" channel and look at the "FAQ 01 - Where do I Begin?" playlist.
This is the playlist for "Game Development: Where to Begin?", I explain a bit about different languages and varying difficulty of each. You'll probably want to watch these to figure out where you should start.
OK.... I Dont get it... I Get this video but... few videos ago we were at initializing and now we should have billions of classes that we never made so.... WUT?
@FrozenMasters I'm not teaching you guys to use classes; you guys should know this before watching this tutorial. I am teaching you the elements of the library, as well as some basic functionality you need- say, collision detection.
Anyone who doesn't have an intermediate understanding of C++ should not be utilizing my BGtGP tutorials.
Couldn't you just find the area of the stick's collision box and the person and then see if one of the objects area's changed? Sorry, I'm just really, really confused.
thanks for the videos! Gotta question though, is it better to handle collision in main, or have the separate objects( player/ collectible ) handle collision? Currently I let main handle collision, but Im wondering if there is a better way?
man I couldn't figure out how to do collision, so I made it in my own style, its works fine. BUT its not as efficient since I would have to change a lot of my code if I were to add a new collision object. Well ALMOST done with my pickin sticks game :D Thanks for all tutorials helped a LOT!! :D
I'm still having trouble making this work. I'm mainly confused about at what point in the code you actually assign the x,y,w and h of the rectangles and also I don't understand what a "get function" is. Can anyone help?
When you're learning C++, you'll learn that generally it's a good idea to keep all your variables in a class private. you create "Get" and "Set" functions in order to get the variable, and set the variable. (one will have return [var];, the other will have [var] = [var2])
You store the location in (X, Y) (see: Algebra), and their Width and Height in W and H. This is generally something you should know from having a sprite sheet, and tell the program yourself.
@LusikkaMage why do you make rectangles? When I tried to make a collision box, I made 4 variables for each object. top, bottom, left, and right, and I gave each a value relevant to their x and y coordinates. Then I used your hit detection if statement and that's all I needed. Why would you make rectangles? Isn't it a lot more work than just having the value of the edges of the hit detection update constantly?
@askmiller If you're storing the Y value of the top, Y value of the bottom, X value of the left, and X value of the right, then you ARE doing rectangular collision detection. I create a Rectangle struct/class in order to keep the code clean and more manageable.
@CoderRach ok, makes more sense now, but what i'm having a huge issue with is:
something went HORRIBLY wrong. When I try to build with visual c++, it says Microsoft internal linker has stopped working, then it says there are build errors and I check and there are 2, both in "main.obj" which is a blank file that I didn't make. It's basically saying the file is corrupt. I tried to run the last successful build but it says something aobut some messed up binary stuff. What do I do?
I mean i have to check all side, so if is collision with upper one, then gravity = 0; if is collision with left, then you can press left arrow and move there.
Thank you very much for taking the time to produce such excellent video tutorials. I am studying computer games development at Southampton Solent University and for our next assignment for one of the units we have to design and create a game in C++ and allegro. These tutorials came in very helpful so thank you once again.
So cute. this brings me back soooome years ago when i was learning about programming and i was eager to create a game!!
I prefered to use segment intersections (solving Mx + B = mx + b). Advantages? This let objects collide no matter how fast they run or which shape their bounding boxes have.
Hey these tutorials have helped me so much with my programming and everything that i have created so far has worked perfectly except I don't fully understand making the Rectangle Header, all I have in there right now is the "struct Rect {int x, y, w, h;};", yet when I include the Rectangle header into let's say the Stick Header and try to assign the variables "x, y, w, or h" a number, it tells me, identifier "variable" is undefined, what am I doing wrong? Please help, your the best :D
ForeverMick32 4 weeks ago in playlist Beginner Game Programming 1 Allegro 4
@ForeverMick32 Are you literally trying to assign something to "variable"? It sounds like you're using that as a variable name, but it doesn't actually exist.
LusikkaMage 3 weeks ago
@LusikkaMage No, lol, I was assigning it a number but I figured out what I was doing wrong and I finally finished my game!!
ForeverMick32 3 weeks ago in playlist Beginner Game Programming 1 Allegro 4
what about if a small rectangle is completely encompassed by a bigger rectangle... in that case, there is a collision, but it would not be detected by this, right? :)
retromelon123 3 months ago
@retromelon123 If you have a large rectangle (say, around the entire sprite), and then a smaller one inside (perhaps the character's head, specifically), you would do a test for only the large rectangle first.
If the large rectangle is not hit, it goes without saying that the small one is also not hit so you don't have to test.
If the large rectangle is hit, you'd do a second test with the small one to see if, say, it's a "head shot" and then react accordingly whether it's true/false.
CoderRach 2 months ago
thanks a lot! =] you're awesome!
kuhkoa 5 months ago
YES! I'M! I'M SO CLOSE TO FINISHING MY PICKI-
"You should then be ready to make your own Pickin' Sticks!"
:|
DrunkenWaffle 6 months ago
sorry iam new on all this stuff and i have a question,, idont know if u can help me ,mmm as i say iam new and iam going to star learning programing but this is the thing what lenguage is the best to leran right now C++ or C#?? i realy appreciate if u can help me a little whit this !!..
PD: your videos r awesome!!!!!!!!!!!!!!!!!!!!!!
TypeRCsl 11 months ago
@TypeRCsl
Sorry, I am new to all of this stuff and I have a question:
I don't know if you can help me, but I am new and I am going to start learning programming.
This is the thing: What language is the best to learn right now: C++ or C#?
I really appreciate it if you can help me a little bit with this!
PS: Your videos are so awesome!
(btw this is LusikkaMage's new account)
OK time to respond.
CoderRach 11 months ago
@TypeRCsl Go to the "LusikkaMage" channel and look at the "FAQ 01 - Where do I Begin?" playlist.
This is the playlist for "Game Development: Where to Begin?", I explain a bit about different languages and varying difficulty of each. You'll probably want to watch these to figure out where you should start.
Also, these tutorials cover C++, not C#.
CoderRach 11 months ago
OK.... I Dont get it... I Get this video but... few videos ago we were at initializing and now we should have billions of classes that we never made so.... WUT?
FrozenMasters 1 year ago
@FrozenMasters I'm not teaching you guys to use classes; you guys should know this before watching this tutorial. I am teaching you the elements of the library, as well as some basic functionality you need- say, collision detection.
Anyone who doesn't have an intermediate understanding of C++ should not be utilizing my BGtGP tutorials.
LusikkaMage 1 year ago
@LusikkaMage nvm, i missed the title
FrozenMasters 1 year ago
@LusikkaMage AND i know the basics and stuff but this is not helping
FrozenMasters 1 year ago
@FrozenMasters you do NOT know the basics at all. From what we can make out, you are appalling.
EoN604 10 months ago
@EoN604 Meh, i knew i just was confused, I have made at least 10 games now ( Using C#, though )
FrozenMasters 5 months ago
This has been flagged as spam show
What I'm confused about is that you don't have x1, y1, x2, and y2 cords, so how do you specify corners without them?
cplusplusgamer 1 year ago
Couldn't you just find the area of the stick's collision box and the person and then see if one of the objects area's changed? Sorry, I'm just really, really confused.
cplusplusgamer 1 year ago
@cplusplusgamer Not really sure what you're asking? Only check for collision on the movement of an object, rather than every cycle?
LusikkaMage 1 year ago
thanks for the videos! Gotta question though, is it better to handle collision in main, or have the separate objects( player/ collectible ) handle collision? Currently I let main handle collision, but Im wondering if there is a better way?
seealsoidiot 1 year ago
Comment removed
seealsoidiot 1 year ago
thank you!! now xna makes sense!
take care.
TheAkyatbahay 1 year ago
man I couldn't figure out how to do collision, so I made it in my own style, its works fine. BUT its not as efficient since I would have to change a lot of my code if I were to add a new collision object. Well ALMOST done with my pickin sticks game :D Thanks for all tutorials helped a LOT!! :D
YouKondziu 1 year ago
awesome tutorial similar to how lazyfoo did it
anyways im using SDL on muh wii and this has helped alot thankies :D
mouseroot 1 year ago
I'm still having trouble making this work. I'm mainly confused about at what point in the code you actually assign the x,y,w and h of the rectangles and also I don't understand what a "get function" is. Can anyone help?
Spacechicken100 1 year ago
@Spacechicken100
When you're learning C++, you'll learn that generally it's a good idea to keep all your variables in a class private. you create "Get" and "Set" functions in order to get the variable, and set the variable. (one will have return [var];, the other will have [var] = [var2])
You store the location in (X, Y) (see: Algebra), and their Width and Height in W and H. This is generally something you should know from having a sprite sheet, and tell the program yourself.
LusikkaMage 1 year ago
@LusikkaMage why do you make rectangles? When I tried to make a collision box, I made 4 variables for each object. top, bottom, left, and right, and I gave each a value relevant to their x and y coordinates. Then I used your hit detection if statement and that's all I needed. Why would you make rectangles? Isn't it a lot more work than just having the value of the edges of the hit detection update constantly?
askmiller 3 months ago
@askmiller If you're storing the Y value of the top, Y value of the bottom, X value of the left, and X value of the right, then you ARE doing rectangular collision detection. I create a Rectangle struct/class in order to keep the code clean and more manageable.
CoderRach 3 months ago
@CoderRach ok, makes more sense now, but what i'm having a huge issue with is:
something went HORRIBLY wrong. When I try to build with visual c++, it says Microsoft internal linker has stopped working, then it says there are build errors and I check and there are 2, both in "main.obj" which is a blank file that I didn't make. It's basically saying the file is corrupt. I tried to run the last successful build but it says something aobut some messed up binary stuff. What do I do?
askmiller 3 months ago
i wuv you!!!
bathoids 2 years ago
How to check it in mario-like platform game?
I mean i have to check all side, so if is collision with upper one, then gravity = 0; if is collision with left, then you can press left arrow and move there.
Neomex000 2 years ago
Why is this video set to private?
Beginner's Guide to Game Programming Ep1 Part 9 Bounding Box Collision Detection
TheReasonWhyGuy 2 years ago
Thank you very much for taking the time to produce such excellent video tutorials. I am studying computer games development at Southampton Solent University and for our next assignment for one of the units we have to design and create a game in C++ and allegro. These tutorials came in very helpful so thank you once again.
GamingJediPwns 2 years ago 8
So cute. this brings me back soooome years ago when i was learning about programming and i was eager to create a game!!
I prefered to use segment intersections (solving Mx + B = mx + b). Advantages? This let objects collide no matter how fast they run or which shape their bounding boxes have.
nice job lady!
pincherman 2 years ago 3
Brilliant way to learn! Great videos, great teacher!
Thank ye! :]
gammarush 2 years ago 3
Your videos are AMAZING! I <3 them so much!
lemonadeaz92 2 years ago 7
3:00 been studyin' calculus, yea?
;-)
MalaTemporaCurrunt 2 years ago
Sonny, I studied calculus four years ago! *waves cane at*
LusikkaMage 2 years ago
The sum is divergent! :D
Bummslang 2 years ago
OMIGAWD FURST KAWMENT
and thanks once again :D
ADeadRock 2 years ago 4
Not sure if I should vote your comment up or down. ;P
LusikkaMage 2 years ago