how do i keep my actors line up always
i have actors moving back an forth,create a self attribute on the actor,
when self.move =1 change velocity to 0 degree
when self.move = 0 change velocity to degree 270
so rule when self.position x is less than or equal 15 change attribute self.move to 1
when self.position x is greater or equal to 305 change attribute self.move to 0
but after a while the actors are closer to each other, i set each individual position to be 7 pixels away from each but they don't keep that distance , any idea guys
when self.move =1 change velocity to 0 degree
when self.move = 0 change velocity to degree 270
so rule when self.position x is less than or equal 15 change attribute self.move to 1
when self.position x is greater or equal to 305 change attribute self.move to 0
but after a while the actors are closer to each other, i set each individual position to be 7 pixels away from each but they don't keep that distance , any idea guys
Comments
My guess is the change velocity is throwing it off a tiny bit depending on which direction it was moving last. You could use interpolate and that will solve your problem.
Better yet if what your trying to do is have the 2 actors pace back and forth, check this video out