move acotor back and forward
chrisal
Member Posts: 74
Ho can i get an actor to move back anf forward between 2 points without endless move to then move to statements????
Many thanks
Chris
Many thanks
Chris
Comments
and why moveTo and not interpolate X or Y of the actor?
MH
Then use timer: every x seconds change attribute "self.motion.linear.x = -self.motion.linear.x"
Note the negative sign.
Not Used it before
how to do that
as I say to the grandkids... I am NOT yelling; I am telling.
How does interpolate work?... great.
but it is capable of doing so much... need a long tutorial to explain it all...
so I am going to suggest that you open a new My Great Project... and put it in iPad Landscape so you have plenty of room to play in.
Create an actor... drag it 6 times to the screenArea
click on an actor in the scene... unlock...
Create a [Rule] when touch is pressed
drag the interpolate behavior to the rule...
and change something like self.Position.X, self.Position.Y, self.Color.Alpha, self.Color.Red,self.Size.Width, or etc. pick one thing for each actor...
explore duration and Function: Linear, Ease In, etc.
when you finish playing... you will understand a lot about Interpolate ... and further explore with confining rules like if self.Position.X is > 500 interpolate self.Position.X to 50 Otherwise if self.Position.X is 50 interpolate to self.Position.X to 500!
Enjoy yourself!
MH