I'm working on a game where a key design element is the ability to keep flying either left or right and end up back at your starting point seamlessly, just like the old arcade game Defender. After a lot of pondering and a bit of tinkering, I've ended up pretty stumped... so I'm curious to see what kind of advice anyone would have for solving such a peculiar problem.
The best approach I could come up with so far is to simply make two copies of the physics world, and keep swapping one out to the left or right extent of the other depending on which side you're closest to, giving the impression of an infinite and seamlessly looping world. But this method doesn't seem very efficient, and I foresee some major framerate issues at the moment that an entire world would have to be moved, especially once it's filled with a lot of physics objects (unless there's some way to tie a b2World to a single matrix or position that I could modify quickly without moving every individual object).
Has anyone ever attempted anything similar, or would have any suggestions on the best way to solve this? Any ideas would be highly appreciated. Thanks!
The best approach I could come up with so far is to simply make two copies of the physics world, and keep swapping one out to the left or right extent of the other depending on which side you're closest to, giving the impression of an infinite and seamlessly looping world. But this method doesn't seem very efficient, and I foresee some major framerate issues at the moment that an entire world would have to be moved, especially once it's filled with a lot of physics objects (unless there's some way to tie a b2World to a single matrix or position that I could modify quickly without moving every individual object).
Has anyone ever attempted anything similar, or would have any suggestions on the best way to solve this? Any ideas would be highly appreciated. Thanks!