What attribute do I use to change image when walking a certain direction?
zefrof
Member Posts: 26
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
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
MH