Advice needed. Rustler test

stanimationstanimation Member Posts: 406
edited November -1 in Working with GS (Mac)
I put up a rough game test on the "Shared Projects" This gives you an idea of the problem i'm having. The rustler keep moving. I want him to stop once the ball hits him. I didnt add any of my unsuccessful rules to stop him to keep the confusion factor low. Also, if you change the game.Fire to false, the animation works better but the rustler pops back up. I think I have been looking at this too long cause I now this is an easy fix. Any suggestions??

http://gamesalad.com/game/play/30970

Comments

  • stanimationstanimation Member Posts: 406
    Any thoughts? I can't seem to get it to work.
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    could you use an attribute to control the rustlers movement, when the ball hits him it changes the movements attribute to false or 0, effectively stopping the rustler moving?
  • firemaplegamesfiremaplegames Member Posts: 3,211
    I just posted this in the other thread, but you just need to clamp the actor's linear velocity to 0

    when killed:
    self.Linear.X = 0
    self.Linear.Y = 0
  • stanimationstanimation Member Posts: 406
    I tried that. What I did was this: Created rule when actor collides with ball I added a change attribute. self.Motion.Linear.Velocity.X to 0. Same for Y. Doesn't seem to work. Also, What do you mean "posted in other thread"?
    Thanks!
  • firemaplegamesfiremaplegames Member Posts: 3,211
    hmmm.. ok i'll take a look at it later tonight.

    The other thread was the one you posted about spawned actors keep moving...
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Hey,

    So i opened your project.
    I see what is going wrong...

    You need to create a Boolean attribute in the Rustler called "killed".

    Then, you need to wrap your Move behavior in a Rule.
    (You can do this easily by selecting the Move Behavior, so it turns blue, the click Create Rule at the top. That will wrap it for you)

    The Rule needs to say this:

    When self.killed = FALSE
    Move

    In the Rule where you collide with the bullet, you need to add a Change Attribute which says:
    Change Attribute: self.killed To: TRUE

    Right now, The Move behavior is always on, that's why he always moves. You just need to make it conditional.

    Hope this helps!
    Joe
  • stanimationstanimation Member Posts: 406
    Nice. Thanks FM! I'll try it now.
Sign In or Register to comment.