Up/ down movement - best way

Hello,
imagine you have some actors moving up/down, left/right or even in a wave motion. Let's stay with up/down movement. Let's say we have waves moving up and down. The actor would be 480 pixels wide and - let's say- 60 pixels high.
At the moment my way to do this is:
if wave.position.y <=0 then
-> accelerate toward y=60
If wave.position.y >=60 then
-> accelerate toward y=0
Is there a more efficient way to do this? Is the option described in the Wiki (includes a timer) better?
http://gamesalad.com/wiki/how_tos:gsc_pacing
Or should I rather use interpolate?
Thanks for hints.
imagine you have some actors moving up/down, left/right or even in a wave motion. Let's stay with up/down movement. Let's say we have waves moving up and down. The actor would be 480 pixels wide and - let's say- 60 pixels high.
At the moment my way to do this is:
if wave.position.y <=0 then
-> accelerate toward y=60
If wave.position.y >=60 then
-> accelerate toward y=0
Is there a more efficient way to do this? Is the option described in the Wiki (includes a timer) better?
http://gamesalad.com/wiki/how_tos:gsc_pacing
Or should I rather use interpolate?
Thanks for hints.
Comments
but if your doing a wav movement, its completly different. Youll have to constrain the x and y positions to a sin and cos expresssions. Have a look at this
http://gamesalad.com/wiki/how_tos:gsc_wave_movement?s[]=wave&s[]=motion
___________________________________________________________________________________
GS BubbleBall Template HERE!!
Stacks Level Selection Template HERE!!
AppSolute Entertainment on Facebook