Change image animation while flying around with touch controls
Rogue Anvil
Member, PRO Posts: 30
Am trying to get a little space shooter running. I'd like to change the animations rolling sideways when moving the finger left and right on the screen. Right now I am just moving the spaceship sprite around using constrain x and y:
I have a notion that one could simply try a rule saying something like if touch 1 x is > 1 (or < -1 if right) do changeimage, but it is not working... any ideas?
Comments
There are probably better ways to do this but here's what I came up with. The self.previousX attribute is type real. I start with an image of a rocket facing up. FYI, it's a Mac file but you should be able to open it on a PC. In case you can't, here are the rules that I added to the constrain behaviors you had:
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks, this works very well! ...am using animation instead of rotation, but your thinking solved my problem. Thank you
Hi @Rogue Anvil you can use the "Motion Linear Velocity" sign, and flip the image according to this
Correct me if I'm wrong but a constrained actor has no velocity.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Ups!, I not have idea if works with a constrained actor, he should check that!