Boxes for a game
A game asks two questions of a character: what strikes, and what can be struck. The Hit workspace answers with boxes on the bones, which follow the character as it moves and are active always or on parts of its animations.
Draw a box
- Open the tab Hit of the bar, beside Rig and Pack, and select the bone that carries the box, in the tree or on the canvas.
- Take the Box tool (B), choose its kind in the line under the bar: Hit, what strikes (red), Hurt, what can be struck (blue), Push, what others cannot walk through (amber). Drag on the canvas: a rectangle, carried by the bone from then on.
- The Corners tool (V) chooses a box with a click and moves its corners with a drag; a box is any shape of three corners or more. Delete takes the chosen box away.
When it is active
A box drawn in Setup mode, or one that is not a hit, is active always, like the hurtbox of a body. A hitbox drawn in Animate mode is active from the clock for a tenth of a second. In the panel of the chosen box, each range says its animation, its start and its end, with a strip over the animation and the clock on it; + Range at the clock, Starts here and Ends here set them from the clock, and Events makes the runtime tell when it starts and when it ends. On the canvas, in Animate mode, the boxes active at the clock are full, the others faint.
Numbers for the game
+ Number gives the box a number by name, which the game reads: damage, knockback, frames of stun, whatever it counts. Each change is one undo.
In the files and in a game
The boxes are kept in hit.json, a file of their own beside rig.json
(its format), written only when there are some. pantin check
says a box whose bone or animation is gone. A game asks pantin_runtime::hit which boxes are
active at a time, where they are in the world, the events between two times, and whether two boxes
overlap.