Positions Everyone - what is the best move?

rivetopiarivetopia Member Posts: 12
edited November -1 in Working with GS (Mac)
I have a dozen actors that I would like to move into position when a button is clicked.

The effect is like a burst. All actors start from the same position and then move to a unique position from there.

My 'show' script is simple:
When attribute, 'game.showtime' = 1
change attribute 'self.Position.X' to 'game.initX'
change attribute 'self.Position.Y' to 'game.initY'
MoveTo position x, y, relative to scene, speed 500, run to completion
if 'self.Color.Alpha' < 1
constrain attribute 'self.Color.Alpha' to 'self.Color.Alpha'+0.1

The problem is, the script is unreliable. Intermittently one or more actors will move past their target and off the screen.

Varying the speed of each actor helped but did not fix.

So.... I then move to a test file.
The difference is instead of all actors starting off screen with unique instance of MoveTo final x, y, I start the scene with them all in their final positions (which I assume is not a good solution for a final product)

The actor script initializes its self attributes, with its current position to self.finalX, and self.finalY
then moves offscreen to wait for the click, to run same script above.

The same thing happens. It takes many clicks to for it to happen, but it does. And funny thing this time it happened when my computer chimed on the hour.

So, is there another way to make this work?

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    Just a quick thought...

    If you have to put these actors into their initial positions, before moving them away and then *back* to their initial positions, you could 'hide' the actors under another graphic that encompasses the screen. This would then disappear when you call the actors to arms! ;)

    Cheers,

    QS :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • rivetopiarivetopia Member Posts: 12
    Thanks QS, but I am really stumped on the wandering actors. Is this a bug? what is another way to make a character move from point A to Point B, and not go beyond?

    Could I have all actors position within another actor and have them stop when they hit the wall?
  • harrioharrio Member Posts: 234
    what's cookin,

    hey riv, check out the wiki about different movement types. http://gamesalad.com/wiki/how_tos
    the first entry discusses which types to use in certain situations.

    also, do they have to 'move' to their unique positions or can they just all appear there instantly? if they can, then you can just chg attr their xy positions and the will 'pop' to where you want them.

    hope that helps.

    noodles...
Sign In or Register to comment.