"Simple" back and forth sin movement
I've been studying this:
http://gamesalad.com/wiki/how_tos:gsc_wave_movement
I'm trying to have a simple back and forth with the gentleness of sin math.
The example is proving too complex for me to reassemble into just a simple back and forth on X access. Embarrassed, but head spinning.
Can anyone help simplify this for me?
Thank you,
CircleTime
http://gamesalad.com/wiki/how_tos:gsc_wave_movement
I'm trying to have a simple back and forth with the gentleness of sin math.
The example is proving too complex for me to reassemble into just a simple back and forth on X access. Embarrassed, but head spinning.
Can anyone help simplify this for me?
Thank you,
CircleTime
Comments
I'm studying the examples from:
http://gamesalad.com/wiki/how_tos:gsc_wave_movement
Copied exactly, the first example has the left and right movement that I want, however, the actor also is rising up on the Y access. I'm trying to unlink the rising up on Y, but the equation seems to be so tightly tied to this exact result. All my tinkering seems to just break the system.
Thoughts?
Thank you,
CircleTime
eg. every 1 second change attribute MoveState 1 to (MoveState1+1)%2
then
When movestate = 1 interpolate actor to pos x whatever
and add change velocity + gravity to make it fall again.
The specific movements I need are simply "left and right" with no rise or fall on Y whatsoever.
Additionally I would like simple "up and down" with no drifting on the X whatsoever.
I'm hoping for that wonderful sin math movement, rather then abrupt starts and stops.
I've been experimenting and searching the forums for a solution, and it usually leads to a reference to this tutorial:
http://gamesalad.com/wiki/how_tos:gsc_wave_movement
However, this tutorial creates something more complicated than I want, such as "left and right" + rising up. When I try and tinker with the code for my simpler goals, I just break it.
Any help with this is greatly appreciated.
Thanks again,
CircleTime
halfWaveHeight * sin( timeFactor * oscillationSpeed) + centerOfWave
To apply that in GameSalad, use something like this:
Constrain Attribute
.....self.Position.X To: 230 * sin( self.Time * 200) + 240
Hope this helps!
Joe