;

PDA

Click to See Complete Forum and Search --> : Help me with hit tests


XareoX
08-25-2006, 11:24 PM
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?

XareoX
08-26-2006, 01:49 AM
doesnt matter i got a better 1

tmoore935
08-26-2006, 02:52 PM
Problem with hit test is that it can miss if between frames

blanius
08-26-2006, 03:31 PM
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.

XareoX
08-26-2006, 05:20 PM
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

tmoore935
08-26-2006, 06:50 PM
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.

XareoX
08-26-2006, 06:58 PM
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.