dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: simple pong game ball collision

  1. #1
    Member
    Join Date
    Oct 2006
    Location
    Seattle, WA
    Posts
    45

    simple pong game ball collision

    I am trying to write the simplest possible ball & paddle bounce game for a junior high class of mine.

    Is there a "feature" that allows the paddle or ball object to test for object collisions (similar to the border collision) or must this be hard coded by a test of the ball and paddle x&y coordinates?
    Jan Zumwalt - http://www.flash.neatinfo.com

  2. #2
    Senior Member kusco's Avatar
    Join Date
    Nov 2001
    Posts
    681
    There is a "collision element" that does all of the hard work for you.

    Just select your bat and ball, and the element automatically does the collision and deflection.

    This sounds like a good idea for a sample in the next release.
    Cheers,
    kusco
    (3DFA Support Team)

  3. #3
    Member
    Join Date
    Oct 2006
    Location
    Seattle, WA
    Posts
    45

    Basic pong game

    Thanks for the help...

    So this is what I came up with.

    It is deliberately simple. For example, it is possible for the ball to be bounced with very little x deflection. I did not want to give the kids any scripts.
    Attached Files Attached Files
    Jan Zumwalt - http://www.flash.neatinfo.com

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