A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Help me with hit tests

  1. #1
    Banned XareoX's Avatar
    Join Date
    Aug 2006
    Posts
    462

    Help me with hit tests

    if u have seen some ove my games u will relise my hit tests are a bit off any 1 know a better action script code for hit tests?

  2. #2
    Banned XareoX's Avatar
    Join Date
    Aug 2006
    Posts
    462
    doesnt matter i got a better 1

  3. #3
    Relaxing tmoore935's Avatar
    Join Date
    Oct 2001
    Location
    colorado, usa
    Posts
    1,713
    Problem with hit test is that it can miss if between frames
    Any programming language is at its best before it is implemented and used.

  4. #4
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    You can use a distance test, this works really well for round objects. I seem to remember reading a method using invisible boxes to define the hit area. Basically use invisible boxes and use hittest on the boxes rather than the visible object.

    http://www.bretlanius.com/flash/bounce.html uses this method.

  5. #5
    Banned XareoX's Avatar
    Join Date
    Aug 2006
    Posts
    462
    can u make me something with it to show a ball with 4 walls around it and the walls cant go passed the walls because the walls are keeping the ball in and you move the balls with the arrow keys i should understand it better cos i dont understand that script like that with all the text box's. and ty for helping me

  6. #6
    Relaxing tmoore935's Avatar
    Join Date
    Oct 2001
    Location
    colorado, usa
    Posts
    1,713
    Quote Originally Posted by XareoX
    can u make me something with it to show a ball with 4 walls around it and the walls cant go passed the walls because the walls are keeping the ball in and you move the balls with the arrow keys i should understand it better cos i dont understand that script like that with all the text box's. and ty for helping me
    I posted the wrong zip file but I do this with text boxes to help understand were my coding is in error. In colin Moock's on page 526 he explains this. You will have to explain better what you want though unless someone else understands.
    Any programming language is at its best before it is implemented and used.

  7. #7
    Banned XareoX's Avatar
    Join Date
    Aug 2006
    Posts
    462
    Ok i fixed my wall hit tests up but because of the script on the platform it stuffed that up but i fixed that there is only 1 more problem now and than is with objects like the bodys and health on my game there is a script that deletes the objects when u touch them or if a trap thouchs you it takes health of you but the problem with those it u can be 1cm away from the trap/items and they get deleted i want them 2 get deleted when u touch em.

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