05-05-2012, 04:34 AM
I don't care where you are from
C++ is no language crafted specifically for game creation. Thus, you won't find such a function. However, depending on whatever premade engine you ight want to use, they might feature something similar. I'm pretty sure there are tons of game making engines for C++. I can't point you to anything specific, though.
Basically, in C++, you'll need to make a base class for your game objects which has all basic properties like x and y position as well as width and height. Then you can make a function which checks if a given point is within an objects boundaries. Note that the basic object class of C++ does not include the advanced specific properties a GML object has.
Generally speaking, if you want to recreate your given GML code in C++ without using an engine made by someone else, you're gonna have a bad time.
C++ is no language crafted specifically for game creation. Thus, you won't find such a function. However, depending on whatever premade engine you ight want to use, they might feature something similar. I'm pretty sure there are tons of game making engines for C++. I can't point you to anything specific, though.
Basically, in C++, you'll need to make a base class for your game objects which has all basic properties like x and y position as well as width and height. Then you can make a function which checks if a given point is within an objects boundaries. Note that the basic object class of C++ does not include the advanced specific properties a GML object has.
Generally speaking, if you want to recreate your given GML code in C++ without using an engine made by someone else, you're gonna have a bad time.