can somebody help me with the code for hittest…and then explain what it all means
This is the basic line of code.
movieclip.hitTest(anothermovieclip, true)
In an if statement, this would check to see if the bounding box of movieclip is overlapping the bounding box of anothermovieclip. The parameter at the end can be changed between true and false.
If you’re wanting to check if a movieclip is colliding with a particular x,y co-ordinate, then it goes:
*
movieclip*.hitTest(_x, _y, true)
so in a if statement if goes:
if (movieclip.hitTest(_x, _y, true)) {
trace(“Hit!”);
}
N.B. hitTest only checks collision of the boudaries of a movieclip and not it’s individual shape. i.e. a circle movieclip will hitTest like a square. If you need something more advanced, better dust off your old trigonometry books.
Hope this helps.
thx it did help