Jump to content
  • Advertisement
Sign in to follow this  
macmacmac

OpenGL help with structure using opengl c++ to design a 2d racing game

This topic is 3032 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!