A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: HitTest Problem

  1. #1
    Junior Member
    Join Date
    Sep 2004
    Posts
    10

    HitTest Problem

    can someone please show me how to make a understandable hit test involving five cars...
    and post the FLA doc here so i can have a look, the tutorials in FLASHKIT are not wat i want.

    i want it so the cars cant hit each other and if they do they bounce back...

  2. #2
    Flashkit Veteran joejoe2288's Avatar
    Join Date
    Apr 2004
    Location
    Hickville, Oregon
    Posts
    2,554
    Well, this shouldn't be in the newbies sections, it would invovle a lot of actionscripting
    So tired of all the fighting....

    http://joejoe2288.kawanda.net

  3. #3
    Who, What, Why ... ? Fraggs's Avatar
    Join Date
    Jul 2003
    Location
    Flashland .. where else ?
    Posts
    786
    Wouldn't take that much AS, you could make a simplified versino using squares or cirlces with simple hit tests.

    If you don't want to do it Joe, then I will give it a go instead.

    Regards,

  4. #4
    Flashkit Veteran joejoe2288's Avatar
    Join Date
    Apr 2004
    Location
    Hickville, Oregon
    Posts
    2,554
    K I wanna see how many lines of code you can limit it to, then I might give it a stab if I think I can beat it(probably not)
    So tired of all the fighting....

    http://joejoe2288.kawanda.net

  5. #5
    Who, What, Why ... ? Fraggs's Avatar
    Join Date
    Jul 2003
    Location
    Flashland .. where else ?
    Posts
    786
    I got an example done. Its a rough as they come but it does the job. There wasn't alot of coding for the hitTest part, but I put in some boundry stuff aswell which racked up the amount of lines. I'm gonna try and smoothen it out a little, until then though, heres what I came up with.

    Several different coloured balls are floating inside a box which acts as a boundry. They all float off in their own directions. If one of the balls hits another, they reverse direction.

    I`m going to see if I can make the reversal a little smoother though.

    See what you can do to decrease the number of code lines of you want.

    Hope this helps whoever.

    Regards,
    Attached Files Attached Files

  6. #6
    Junior Member
    Join Date
    Sep 2004
    Posts
    10
    thanks for all your help im gona have to try and encorperate it into my game.. its gona be hard...

  7. #7
    Junior Member
    Join Date
    Sep 2004
    Posts
    10
    actually i have come accross another problem.........
    instead of having the balls move on their own
    how do i make them be conrolled by the user like a car, using the arrows

    thanks for all your help.....

  8. #8
    Who, What, Why ... ? Fraggs's Avatar
    Join Date
    Jul 2003
    Location
    Flashland .. where else ?
    Posts
    786
    THIS tutorial should be what your looking for, or at least set you in the right direction.

    If you get stuck let us know.

    Regards,

  9. #9
    Junior Member
    Join Date
    Sep 2004
    Posts
    10
    and how do i encorperate the hit test into these characters

  10. #10
    Who, What, Why ... ? Fraggs's Avatar
    Join Date
    Jul 2003
    Location
    Flashland .. where else ?
    Posts
    786
    The code for the hitTest is place in the actions panel of the clip you wish to animate.

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