Jump to content
  • Advertisement
Sign in to follow this  
xtr33me

Some GDI Starfield Direction please

This topic is 4162 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

I currently am writing one of my first windows based programs for class. We just needed to create a basic Pong game using GDI+. All the AI and paddles are all implemented, but I wanted to try and do more with it. Well this whole wekeend I have tried all kinds of stuff with graphics and to no avail, have I been successful. I have bitmaps loaded for the paddles now and the ball graphic is fine. My problem is my background. I have a nebulae image in the back but wanted to create a moving starfield image over top of it if possible. An angle I attempted to take this weekend was creating about 25 images, with stars, tie fighters and some x wings moving across the screen. Then I attempted to randomly display these in the background one by one. At first this went way too fast, so I created a timer which I then had slowly display the images. With just a few images, this wrked fine but when I got into my 25 images, it looked like crap. So I have been trolling through the internet just looking for some code that might help me on this venture and have had no luck yet. A lot of stuff for VB, but nothing for C++. I was wondering if I may get some direction and ideas on the easiest way to do this. Thans all in adavance for your help and time. X

Share this post


Link to post
Share on other sites
Advertisement
I have some old code kicking around. I tried uploading it to my space here so that I could link you to it, but it failed (side effects from the big crash). Is your email in your profile correct? I can send you the zip file if you'd like. Send me a PM.

Share this post


Link to post
Share on other sites
Create some particle structs/classes with a position and a small, random movement vector relative to the center of the screen.
Each frame, update the position by adding the movement vector to it, drawing a line from the old position to the new one at the same time.
When the particle's new position goes out of the screen, don't draw it, and re-initialize it to a new starting state.


This will give a nice effect of flying through space in a first-person view. Some particles will move slowly, others will move more quickly - resulting in longer lines and the impression that they are closer than the slow-moving particles.

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!