A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: how can I make a ball that my character shoots to the wall bounce?

  1. #1

    how can I make a ball that my character shoots to the wall bounce?

    how can I make a ball that my character shoots to the wall bounce?

  2. #2
    Senior Member
    Join Date
    Mar 2001
    Location
    Location : Location
    Posts
    131
    Do a hit test for the wall, when it hits reverse the velocities ....
    this[MCr.i + 'm_not_ok']._lyric = "you sing the words but you don't know what they mean";

  3. #3
    When in doubt ask Eager Beaver's Avatar
    Join Date
    Feb 2007
    Location
    Planet Earth
    Posts
    911
    Please see the atached FLA (F8).
    Attached Files Attached Files
    <signature removed by admin>

  4. #4
    how could I reverse the velocities?

    could you please output the file as flash mx 2004?
    thanks.
    Last edited by shedokan; 04-18-2008 at 10:27 PM.

  5. #5
    When in doubt ask Eager Beaver's Avatar
    Join Date
    Feb 2007
    Location
    Planet Earth
    Posts
    911
    You can see the attached file saved in MX2004.
    Attached Files Attached Files
    <signature removed by admin>

  6. #6
    thanks!
    but there is only one problem.
    when I shoot my ballit moves a lot each frame.
    is there a way to specify how much it will move each frame?
    here's my code:
    Code:
    xspeed *= friction;
    yspeed *= friction;
    _y += yspeed;
    _x += xspeed;
    and each time I shoot the ball I add the direction of my char * 20

  7. #7
    When in doubt ask Eager Beaver's Avatar
    Join Date
    Feb 2007
    Location
    Planet Earth
    Posts
    911
    Please post your FLA, to find out how it is different from mine.
    <signature removed by admin>

  8. #8
    it's attached to this post.
    Attached Files Attached Files

  9. #9
    When in doubt ask Eager Beaver's Avatar
    Join Date
    Feb 2007
    Location
    Planet Earth
    Posts
    911
    In my Fla, I have directly used Newton’s laws of motion.
    My Fla has only one ball, which is thrown by the user.
    When it hits boundaries it bounces back, with a reduced velocity, due to the elastic property of the boundary. Your Fla is altogether different. I am sorry, I am not able to find out why it is not working, as you wanted.
    <signature removed by admin>

  10. #10
    ok, thanks anyway.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center