Some help with Animation Stop/Start Please!

JCFordJCFord Member Posts: 785
edited November -1 in Working with GS (Mac)
I have setup an Enemy that chases the main player and this works fine. I now want to have the enemy animate when its moving, but stop animating when it stops moving because its hit an obsticle, but everything I try the enemy keeps on animating even when its stationery.

The guide in wiki for animation stop/start doesn't seem to work here as this is not controlled by key commands but a constant chase action.

Thanks
JF

Comments

  • stanimationstanimation Member Posts: 406
    Have you tried using attributes?
  • iDeveloperziDeveloperz Member Posts: 1,169
    You will have to make an attribute Where if a rule takes place attribute -1 to stop it moving and a different rule that takes place it make the attribute +1 to make it move again. something like that
  • JCFordJCFord Member Posts: 785
    Thats the bit I'm having trouble with, how to tell it if moving animate and if not moving do not animate!
  • iDeveloperziDeveloperz Member Posts: 1,169
    Why does it move? And how do you make it stop whats the purpose etc?
  • JCFordJCFord Member Posts: 785
    Just emailed you the file.
  • iDeveloperziDeveloperz Member Posts: 1,169
    ok ill sort it now. =)
  • JCFordJCFord Member Posts: 785
    Thanks iDeveloperz - Normally I can sort these issues out.

    It seems so simple:
    A chasing enemy - animate when moving and stop animation when not moving!

    But this ones got me!
  • iDeveloperziDeveloperz Member Posts: 1,169
    Can i make just a small app for you to look at and send it to you. Then maybe you could work it out. Its just that on the one you sent me it wont add a scene =/
  • JoshKahaneJoshKahane Member Posts: 470
    This seems fairly simple, something I have had to over come as well in the past. You want it to stop animating when it hits a wall right?

    - Make a Game attribute called something like StopAnimatingEnemy
    - Make rule saying only animate the enemy if this attribute is false
    - Make second rule saying if collides with wall change attribute to true

    This way it will stop animating when it hits the wall. Sorry if I misunderstood. But hope its helps.
  • JoshKahaneJoshKahane Member Posts: 470
    Wow, I really skimmed over that post fast, completely mis read it sorry.

    Do similar to what I said above, just different situation.

    Make rule so if Motion.Linear.X > 0 animate (moving right animation).
    Same again with X but < 0 (animate left).

    Then with Y. Same principle, up and down.
  • iDeveloperziDeveloperz Member Posts: 1,169
    Done it just sent you the email.

    Sorry if it doesn't work. or if its not doing what you expected. Im new to this kinda thing =/. But I got it to stop animating when it touches the wall.
  • JCFordJCFord Member Posts: 785
    Just want to say a BIG thank you to iDeveloperz for his help, and also to Kahanejosh for advice. Thanks Guys I'll give it a try.
  • TheMonkey300xTheMonkey300x Member Posts: 2
    how did you get it to chase the main player
Sign In or Register to comment.