Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

djsteffey

space game prob

This topic is 5953 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 am making a little space game (2d) and I have a fixed size uuniverse i guess you would say. So that when i get to the right side of the univerese it wraps me back around to the left side of the universe and vice versa and the same thing for the top and bottom. But the prob is that when i hit that border and wrap around to the other side of the universe then stuff like enemies that were near me vanish for a second, because they are on the other side of the universe and dont get drawn where i am until they wrap around as well.......which the whole situation causes a blurp in the game which i want to work out. Anyone know how i can correct of even what i am talking about ? "I pity the fool, thug, or soul who tries to take over the world, then goes home crying to his momma." - Mr. T

Share this post


Link to post
Share on other sites
Advertisement
What language are you doing this in, is it tile based, /*more detail enquiring questions*/. I assume you have some sort of rendering function that goes through all the objects like ships/missles/etc, determines if they are on the screen and draws them. If thats the case and your function is designed well you can just call it 4 more times, specifies as a center point (I assume the player ship is the center point) offset by the size of the universe in all 4 directions. If your render function checks to see if something is visible before drawing it (using a simple bounding box function) there should be no noticable drop in performance. Once that works just add a few if statements to determine which mirror universes are visible (bounding box works fine) and only draw them.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!