1
votes

I have a simple stickman running animation in flash as3, and I can't even begin to figure out how to gather the coordinates of the end of each stick in the stickman at every frame. So I have the coordinates of each line, height and width of the corresponding symbol. Really not sure what to do here to get those end points.

Now I would like help knowing how to do the above, but this also made me curious of how professional programmers define hitboxes on animations; Do animators have some sort of hitbox tool? Do programmers just code the hitboxes and test them to perfection? That sounds like a really hard way to do it.

1

1 Answers

0
votes

Generally, the best way to use hitboxes is to detect collision between two objects. If I understand your question correctly, this would do what you need.

There are two different ways of doing this. If you are okay with a straight rectangular hit box, you can use hitTestObject. However, if you want the hitbox to be the same shape as the object in question, you can use hitTestPoint.

Dealing with lines, obviously, might mean that the second option would make the hitbox far too small to be practical. You can resolve this by drawing a fully transparent shape inside your object that defines your custom hit area, and then using hitTestPoint.

There is more specific information about hitboxes in this question and this question. For future questions, you will want to look for a similar question first, before asking a new one. Check out the rest of the rules here, and check the Help Center for more detailed rules.