Page 1 of 1

Wrap around

PostPosted: Sat May 29, 2010 8:58 am
by MrB
Hi there

Having got GE working on my ubuntu netbook (and it is more stable than win7 now) I am trying to develop a navigation type game. What I would like to do is have a wrap around on the edges, so if you go off the edge of the world one way, you come back onto the world from the other side.

I tried

Code: Select all
if (x>=10350) x=-10349;
if (x<=-10350)x=10349;


Inside a timer event so it would check the planes position every 100ms but this does not seem to work. I am not sure if I understand what is going on with the x variable so any help would be great.

Oh and my division tutor thing is almost there but I got side tracked like you do.


Thanks all

MrB

Re: Wrap around

PostPosted: Sun May 30, 2010 5:10 am
by DST
I think no one responded because your code appears to be correct.

Perhaps try placing it in draw actor, instead of a timer.

Re: Wrap around

PostPosted: Sun May 30, 2010 7:27 am
by MrB
DST wrote:I think no one responded because your code appears to be correct.

Perhaps try placing it in draw actor, instead of a timer.

OK thanks I will give it a go.

Re: Wrap around

PostPosted: Sun May 30, 2010 7:55 am
by MrB
DST wrote:I think no one responded because your code appears to be correct.

Perhaps try placing it in draw actor, instead of a timer.


Thanks worked perfectly in draw actor.
Magic