Wrapping play area

Blitz3D Forums/Blitz3D Beginners Area/Wrapping play area

blackbag(Posted 2006) [#1]
I am working on my first game, and I have a solution to this problem but would like some advise on its suitability or if there is better way.

The play area is a 2d plain with the camera moving around "above" it to display the action. I want the player (any everything else) to move off one "side" of the plain and back on the other, and this to happen seamlessly (i.e you move towards the top of the area and can see the bottom with no transition between the two).

At the moment my entities are held within varoius TYPE's which also incudes the x and y co-ordinates of each, each iteration of the program updates the x and y co-ordinates then translates these into the correct position in the "3dworld" taking the wrapping into account, then positions the entity appropriatly.

Now as I said the whole thing works fine, but I would much rather be working within the correct blitz3d framework of move/transition entity. For example I grabbed a copy of CSP Particles from the code archives (its great thanks), but had to rewrite it to work within the framework I have imposed upon myself.

Any ideas how I can get this back on track?

Ian.


Stevie G(Posted 2006) [#2]
I wrote Z-Virus ( zarch remake ) using similar methodology and found that this was the best solution. Admittedly, you are stuck with holding global positions for everything and converting them to local positions( at least local to the camera ) each frame. At the time and I couldn't think of a quicker or simpler way around it.

Everything including particle engine / collisions / ai had to use this framework. I wasn't using Blitz in-built collisions which probably made life alot easier. I'd imagine you'll run into issues repositioning things all the time.

Stevie


blackbag(Posted 2006) [#3]
I also bailed out of blitz collisons early on, just running a simple - if the distance between two objects drops below the sum of their sizes, smack!