Put objects in other place (portal's like)

I’m making a game like’s atari: ‘Asteroids’. But I don’t know how change the position of the asteroids when they touch the corners.

e.g. If they go to the top of the camera, and then they need to appear in the bottom.

I see some demos using “portals” but they are for 2.49b.

I’m working on blender 2.57b

It shouldn’t need portals or anything complex like that - if the object goes out of the view, use some Python to move it to the opposing side. e.g.


from bge import logic
cont = logic.getCurrentController()
obj = cont.owner

width = 20 # Size of the playing field

if obj.position.x > width / 2.0:
     obj.position.x -= width
elif obj.position.x < -width / 2.0:
     obj.position.x += width

Thank you.

I suppose it would be something like that.

But I don’t know how use python.