Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

I'm wanting to make an object bounce off an object yet it bounces in unwanted direction.

New Here ,
Sep 11, 2017 Sep 11, 2017

Screen Shot 2017-09-12 at 11.28.09 am.png

I want to make the ball that I have named ball_mc bounce off the posts and bars. I want the ball_mc to bounce off the leftpost_mc in a left direction, the ball_mc bounce off rightpost_mc in a right direction, and the ball_mc bounce off the bar_mc in an upward direction. I can't seem to figure this out and the ball bounces in directions that don't make sense to me. Can someone troubleshoot this for me.

This is what I've got so far.

Screen Shot 2017-09-12 at 11.31.40 am.png

Is this completely wrong?

TOPICS
ActionScript
242
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 11, 2017 Sep 11, 2017
LATEST

yes.

it's not clear what xDirection is doing but it probably should be -1 if it hits the left post and +1 if it hits the right.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines