Make an actor change direction when it hits another..

zCharleszCharles Member Posts: 5
edited October 2012 in Working with GS (Mac)
Hello,
i am trying to get a small little ball to bounce around the screen randomly...
I just need to know what to do..
Do i need to make an invisible wall and change direction when it collides?
I just want this small little golf ball to bounce around the screen randomly..
May i please have a long detailed description?
Thanks,
Charles

Comments

  • boredaholicboredaholic Member Posts: 47
    edited October 2012
    Yes, you do need to make the "invisible" wall and make it change directions when it collides
  • boredaholicboredaholic Member Posts: 47
    edited October 2012
    the rule on it should have

    Change velocity:

    Direction: random(0,360) relative to: scene
    Speed: whatever speed, i used 75 on my code and it works fine.

    EDIT: Sorry i keep adding things and remembering things, this code should be on the actor, not the wall. and this code should be inside a rule that also has

    When all conditions are valid:
    actor receives event, overlaps or collides, with, actor of type, actor(invisible wall). then below this in the next section you need to add the change velocity code. Hope this helps
Sign In or Register to comment.