Help please- move actor around scene

outasiteoutasite Member Posts: 417
edited November -1 in Working with GS (Mac)
I am on to the next one. Can anyone help me? I have an actor and I need it to randomly traverse its way around a screen.

Right now, I have;

rndX=random (50,230)
rndY=random (20,140)
accelerate to (rndX,rndY)

rule; hits (rndX,rndY)
rndX=random (50,230)
rndY=random (20,140)
accelerate to (rndX,rndY)

But it leaves the scene...

For example I need the top one, but receive the bottom one.

Photobucket

Thanks Guys

Comments

  • RedlerTechRedlerTech Member Posts: 1,583
    outasite said:
    I am on to the next one. Can anyone help me? I have an actor and I need it to randomly traverse its way around a screen.

    Right now, I have;

    rndX=random (50,230)
    rndY=random (20,140)
    accelerate to (rndX,rndY)

    rule; hits (rndX,rndY)
    rndX=random (50,230)
    rndY=random (20,140)
    accelerate to (rndX,rndY)

    Thanks Guys

    For the second one, did you change the attribute to a new random?

    Matt
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    you can just do something like every timer every 1 second with run to completion checked interpolate or accelerate or change velocity to: self position x to random(0,480) and interpolate self position y to random(0,320)
  • outasiteoutasite Member Posts: 417
    Thanks everyone. I actually went went John's idea.

    Actor:
    -Max speed: 150
    -Apply Max Speed

    Timer: (Run to completion)
    Every 1 second
    -Accelerate to X: random(-100,580) Y: random(-100,420)
    Acceleration: 300

    Thanks Guys,
    You rock.

    Can always count on the community.
Sign In or Register to comment.