A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: hitTest on multiple targets

  1. #1
    3d flash dude
    Join Date
    Jan 2004
    Location
    Toronto, Canada
    Posts
    44

    hitTest on multiple targets

    Hey Guys,
    I’m trying to setup a MC that has a hitTest that is triggered by multiple targets. Like how do you game developers do this. Like in a shooting game, the bullet will not hit only one target every time. It’s different all the time. So how would you know on a wide range of targets?
    Thanks,


    Najam D.


    UPDATE++++++++++++++++++++++++++++++++++++++++++++ ++++++++
    Best Work Around
    Quote Originally Posted by HeraldofWoe
    I think that this will get you on the right track.

    (And it specifically addresses your problem Pitchdog)
    ++++++++++++++++++++++++++++++++++++++++++++++++++ ++
    Last edited by najamd; 02-08-2006 at 08:21 AM. Reason: Best solution to problem

  2. #2
    Senior Member pitchdog's Avatar
    Join Date
    Sep 2002
    Location
    Rochester, NY
    Posts
    128
    One way is create the hittest code on one MC, and then use duplicateMovieClip to duplicate the targets. So, if you have an asteroid game you just build 1 asteroid w/ the hittest code.

    I do not know how to make a global hit test. For example, if any MC hits another MC. I'm digging around for that now.

  3. #3
    Senior Member pitchdog's Avatar
    Join Date
    Sep 2002
    Location
    Rochester, NY
    Posts
    128

    space ice

    Here's a game I made that uses the hittest function. It's not global, but it works. I'd like to find something that makes the "spaceice" / asteroids detect each other w/o running scripts on each one that looks for every asteroid. It gets too slow.

    There should be something that detects any MC hit, and then you can figure out what it is hitting. I'm working on it but could use a hand.
    Attached Files Attached Files
    Last edited by pitchdog; 02-07-2006 at 09:36 PM.

  4. #4
    Linux Fanboy HeraldofWoe's Avatar
    Join Date
    Oct 2005
    Posts
    142
    I think that this will get you on the right track.

    (And it specifically addresses your problem Pitchdog)

  5. #5
    3d flash dude
    Join Date
    Jan 2004
    Location
    Toronto, Canada
    Posts
    44
    Quote Originally Posted by HeraldofWoe
    I think that this will get you on the right track.

    (And it specifically addresses your problem Pitchdog)
    Thanks guys!.. I was trying to avoid using lots of loops but this tutorial has a pretty clean looking one so im thinking of using that...
    Thanks again,


    Najam D.

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