Jump to content
  • Advertisement
Sign in to follow this  
Don_Wuh

HELP!!!!

This topic is 4841 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 want to produce a simple program with a black box and a white box that bounces around in the black box but if it hits the sides it bounces back off and goes in a different direction can any one help i know a little c and a little cpp i have the dev cpp compiler and wx devcpp

Share this post


Link to post
Share on other sites
Advertisement
WX is a GUI interface. Why are you using it to develop games? The only part about it that is game related is that it can set up an OpenGL context. My suggestion is to start out using SDL instead of WX Widgets. It should be in your DevC++ Package Manager (under the tools menu) and when it is done downloading repost your help message with a more descriptive title.

Here's a hint about bouncing off of a box: read the pixel that's at the position the white box will be at before it gets there. If the pixel is black it will have to bounce. If you read one pixel ahead on the x-axis but equal on the y-axis and it's black then you know the x-axis will need to reverse. Likewise if you read one pixel ahead on the y-axis but equal on the x-axis and it's black then the y-axis will need to reverse. If both the previous conditions were clear but the pixel directly in the path was still black then both axes need to reverse since you've hit a corner.

Share this post


Link to post
Share on other sites
You should learn more C++ or C.

Most graphics libraries (like SDL) make extensive use of pointers, and if you are not comfortable with them you will get lost.

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!