Game Development Reference
In-Depth Information
Figure 2-5. Setting the Mask Properties for the main character
Firstly, it only takes a horizontal overlap of one pixel to support Fishpod standing on
top of a platform (see Figure 2-4). If the bounding box extended right to the end of
Fishpod's flippers, then he could support himself with the very tip of his flipper in a
very unrealistic way. With the smaller bounding box, he needs at least a whole flipper
in contact with a platform to stand on it.
Secondly, there is nothing more annoying in a game than when an enemy or hazard
kills you when there are clearly no overlapping pixels. If we used the larger, default
bounding box, then collisions could potentially occur when there was actually no
actual overlap between the sprites (see Figure 2-6). Using a smaller bounding box that
remains within the center of the sprite helps to prevent this happening and makes for
a less frustrating playing experience.
Figure 2-6. With precise collision disabled and a full-size bounding box, the player would be killed by this
pansy, even though they do not appear to have touched
Search WWH ::




Custom Search