|
-
movieclips that repel each other?
Hello to you. I'm looking for some help with a problem. Say i have 2 movieclips on the stage, each movieclip is a ball that bounces around. When the balls come into contact they touch and bounce off in the opposite direction.
What I'm looking for is for the balls to repel each other, just like magnets repel each other.
Any help would be great.
-
-
depending on your 'bouncing' code (lots of ways to achieve that) it would be pretty much the same than when the balls hit your bounds: revert the direction.
For example if "ball1._x+=speed" it would become "ball1._x-=speed"
Posting your original code could help you get more info.
gparis
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|