How to determine an actor is moving up or moving down?
AlkaPP
Member, PRO Posts: 194
Hi all,
Let's say I have a ball... Hmm... no, just let's say I have an actor falling down. When it hit the ground, it move up and then fall down again. Just like it's bouncing.
My question is that how do I determine the stage (it's moving up or falling down) of the actor?
Thanks,
My Gamesalad Games On App Store:
Greedy Chubby: https://itunes.apple.com/us/app/greedy-chubby/id834371213?ls=1
Comments
@AlkaPP, you can check if its self.Motion.Linear.X or Y is positive or negative. That will tell you the direction.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
@Hopscotch, how can we know if it is positive or negative? Thanks
My Gamesalad Games On App Store:
Greedy Chubby: https://itunes.apple.com/us/app/greedy-chubby/id834371213?ls=1
@AlkaPP
Rule Attribute self.Motion.Linear.Y > 0
"actor is moving up"
Rule Attribute self.Motion.Linear.Y < 0
"actor is moving down"
Rule Attribute self.Motion.Linear.X > 0
"actor is moving right"
Rule Attribute self.Motion.Linear.X < 0
"actor is moving left"
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Use a display tex behaviour, or maybe make a rule = if self.Motion.Linear.Y is larger than 0 then . . . .