Positions Everyone - what is the best move?
rivetopia
Member Posts: 12
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?
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
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
Could I have all actors position within another actor and have them stop when they hit the wall?
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...