Changing image according to direction
Hi GS'ers
i have an actor that shoots from one side of the screen to another.
When my actor changes direction Left or right i want the image changing accordingly.
Problem is i cant use collide rules because it does not change direction every time depending on where i collides.
Iam thinking something with IF self.motionX or self.positionX is something then change image
But cant really figure it out.
Hope some one have the solution
i have an actor that shoots from one side of the screen to another.
When my actor changes direction Left or right i want the image changing accordingly.
Problem is i cant use collide rules because it does not change direction every time depending on where i collides.
Iam thinking something with IF self.motionX or self.positionX is something then change image
But cant really figure it out.
Hope some one have the solution
Comments
if self motion linear x is < 0 change image to left facing image
cheers
Rule: if self.motion.linearvelocity.y is less then 0, change image to [new image].
At first I thought "otherwise" might work, but then one of the directions would include 0, and so if you were moving right and stopped, the image might revert to the image that shows when you are moving left (or standing still). If your image never stops, this isn't a problem.
Thanks... sometimes the easiest solution is the one you think of last!!