What attribute do I use to change image when walking a certain direction?

zefrofzefrof Member Posts: 26
edited August 2012 in Working with GS (Mac)
Say an actor is moving up on the scene, I want it to change to a picture of the back of said actor. If the actor is moving down you'd see an image of the front of the actor. What attribute should I use? I tried using linear velocity x and y but they didn't seem to work.

Comments

  • zefrofzefrof Member Posts: 26
    No ideas? Ok if I figure it out i'll post again.
  • MotherHooseMotherHoose Member Posts: 2,456
    @zefrof

    gameAttribute: direction … index type
    buttons to change direction (one up/one down or whatever)

    (example for up)
    Rule: when
    Event: touch is pressed
    -changeAttribute: game.direction To: 1 for up … 2 for down; etc.

    on playerActor:
    Rule: when
    Attribute: game.direction = 1
    -changeAttribute: self.Image To: back view
    -do the motion for Y (positive)
    Otherwise:
    -changeAttribute: self.Image To: front view
    -do the motion for Y (negative)

    you could use a boolean type: false for down/true for up
    but, using an index type allows for right/left movement with image/motion changes

    image MH
Sign In or Register to comment.