Animation based on where I touch the screen.

codematescodemates Member Posts: 112
edited November -1 in Working with GS (Mac)
Is it possible to animate a character with different movements based on where I touch the screen by using position or do I need to setup actors and place them where I want to touch and define each movements?

Thanks

Comments

  • AsymptoteellAsymptoteell Member Posts: 1,362
    Do you mean make the actor move toward the touch? Or what exactly did you have in mind?
  • codematescodemates Member Posts: 112
    I just want to have an actor perform diff animations on where I touch.

    For example diff moves when touching upper-left, bottom-left, lower-right and upper right will give me 4 different movements for main actor but I also have a touch rule to destroy spawning actors.

    Thanks
  • AsymptoteellAsymptoteell Member Posts: 1,362
    I would just put buttons there and make them invisible. When they're pressed, change a global attribute to 1. otherwise, change it to 0.
    In the actor, make it so when that global attribute is 1, do the desired animation. If you're confused, just say so, and I can explain more.
  • codematescodemates Member Posts: 112
    Asymptoteell said:
    I would just put buttons there and make them invisible. When they're pressed, change a global attribute to 1. otherwise, change it to 0.
    In the actor, make it so when that global attribute is 1, do the desired animation. If you're confused, just say so, and I can explain more.

    Ok thanks, I got it. I was just wondering if there was another way of doing it based on position.

    Thanks for your help!
  • RedlerTechRedlerTech Member Posts: 1,583
    thats easy you don't need to do all that hard work. Example: Rule - If touch.x > self.positionX, animate whatever. Meaning in english (lol) If touch is on the right side of that actor.
  • codematescodemates Member Posts: 112
    matthewredler said:
    thats easy you don't need to do all that hard work. Example: Rule - If touch.x > self.positionX, animate whatever. Meaning in english (lol) If touch is on the right side of that actor.

    Would you be able to do that with up and down on the right and up and down on the right (4 different animations)?

    Thanks
Sign In or Register to comment.