I need help on "Move To" behavior. Strange things happening.

cbtcbt Member Posts: 644
edited November -1 in Working with GS (Mac)
As the title says, or it is just me... :)

I'm trying to do something like this;

An actor named "Moving" should "Move To";

X: Random(200,280)
Y: -200

This did not work! "Moving" actor started to go to positions like X=500 or X=0. So, I made a self.RandomX.

Change Attr.
self.RandomX=rand(200,280)

Move to:
X:self.RandomX
Y:-200

And ofcourse;
Display Text:
self.RandomX

It ALL seems OKAY. On the actor 210 is visible as the "Move To" X coordinate, but, it just goes somewhere irrelevant.

Maybe I wasn't so clear, so, here is what is going on;
http://gamesalad.com/game/9930

Just start it and watch for few seconds. Than everything starts to go wrong. What is this about?

Comments

  • HunnenkoenigHunnenkoenig Member Posts: 1,173
    As far as I know, Move To behaviour is still messy.

    Use interpolate or change attribute X instead.
  • cbtcbt Member Posts: 644
    Damn.. I really needed this. I don't think anything else will work to accomplish what I want..

    This is BS!
  • HunnenkoenigHunnenkoenig Member Posts: 1,173
    You don't need move to.

    You can make:

    Interpolate to X and Y
    and experiment with the time frame.

    If it should move with different speeds, then it is a bit more complicated.
  • cbtcbt Member Posts: 644
    Hunnenkoenig said:
    You don't need move to.

    You can make:

    Interpolate to X and Y
    and experiment with the time frame.

    If it should move with different speeds, then it is a bit more complicated.

    They should move with different speeds, and they should be recycled to different Y values. So, I don't think I can handle time frame with these properties :D But, thanks anyway.. I hope someone comes up with a solution (CodeMonkey?) :D
  • HunnenkoenigHunnenkoenig Member Posts: 1,173
    Maybe you should randomize the direction.

    As I understand, you want them to move out of the screen (hence the -200)

    I made a game, where the background moves from top to bottom, and when it's out of screen, it should be recicled on the top.

    I simply used a move behavior with direction 270 and placed a "wall" actor on the spot, where the image was fully out of screen.
    Then I said, if collide with WALL, change X to "whatever"

    Now you can do the same, but when it collides with the wall, you can add the rule, you want to happen.
  • cbtcbt Member Posts: 644
    Nope, the recycling part is OK.

    I solved the problem, but with a crappy method..

    I created an integer on the actor, "self.Number"

    -Change self.Number to rand(0,5)

    -If self.number=0;
    -Move to; X=200 Y=-200

    -If self.number=1;
    -Move to; X=240 Y=-200

    etc.
    etc.

    At least it looks like random to the player...
Sign In or Register to comment.