help with structure using opengl c++ to design a 2d racing game
Hi, I have been researching alot before joining and have drawn my 2d car as well as some obstacles. Ive managed basic movement and have started to write code for more realistic driving involving accleration and speed and collisions.
I have seen many good tutorials and help guides but is there anything specifically made to help game layout? ie is it best to have completly different files for obstacles, physics, user mobvements etc? or should they remain in the main file?
thanks
mac
Quote:I have seen many good tutorials and help guides but is there anything specifically made to help game layout? ie is it best to have completly different files for obstacles, physics, user mobvements etc? or should they remain in the main file?Does this have anything specifically to do with OpenGL, or is it more of a general programming question? (It seems like the latter, but you posted it in the OpenGL forum, so...)
Anyway, yeah, in C++ it's pretty typical to split things up into separate header and source files for different structs, classes, modules, etc. If you need more specific advice, you might need to clarify your question a bit.
hey thanks for the reply. I am using microsoft visual writing c++/opengl and started looking at tutorials and they made my headspin. Ive rejected previous plans and gone back to a very easy design in one file for now to learn. Sorry if I posted in the wrong forum.
At the moment Ive created a 2d top down car game where the camera will eventually follow the car around. Ive created the car and obstacles and now (after scrapping too complex ideas) have gone back to just increasing speed when the key is held down and later I will put in some time of deceleration when the key is released.
I am looking into AABB collision detection. Right now Im just trying to work out how to assign the collison points to my polygons (car and obstacles)
thanks.
At the moment Ive created a 2d top down car game where the camera will eventually follow the car around. Ive created the car and obstacles and now (after scrapping too complex ideas) have gone back to just increasing speed when the key is held down and later I will put in some time of deceleration when the key is released.
I am looking into AABB collision detection. Right now Im just trying to work out how to assign the collison points to my polygons (car and obstacles)
thanks.
I can create a struct and I can also create an image and get that to move around the screen via the keyboard but I still cant assign the image to the struct to make the collision I have code for. Can anyone help?
Quote:I can create a struct and I can also create an image and get that to move around the screen via the keyboard but I still cant assign the image to the struct to make the collision I have code for. Can anyone help?Since this isn't really OpenGL-related, I'd recommend making a new thread for the above question in, say, For Beginners. Be sure to be specific (as is, I think the question is probably too vague and/or general to answer effectively). It might also help to post some of your code, along with an explanation of exactly where you're getting stuck.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement