Changing image according to direction

BrynjeBamsenBrynjeBamsen Member Posts: 188
edited November -1 in Working with GS (Mac)
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

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    if self motion linear x is > 0 change image to facing right image
    if self motion linear x is < 0 change image to left facing image

    cheers
  • msonesmsones Inactive, Chef Emeritus Posts: 75
    Rule: if self.motion.linearvelocity.x is greater then 0, change image to [new image].
    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.
  • BrynjeBamsenBrynjeBamsen Member Posts: 188
    JESUS CHRIST....

    Thanks... sometimes the easiest solution is the one you think of last!!
Sign In or Register to comment.