Game Development Reference
In-Depth Information
Collision masks
GameMaker handles its collisions based on collision masks. A collision mask is a shape
that is used to detect collisions with other objects. This can be anything from a simple
square or circle shape to using the actual sprite as a mask.
GameMaker checks to see whether any point on a collision mask is overlapping another
collision mask of a different object; if it is, GameMaker will perform a collision event for
that situation.
A collision mask does not need to perfectly outline a sprite. The more basic a collision
mask is, the faster the collision check can be performed, which in turn will optimize your
game. Complicated collision masks can often cause problems when it comes to platform
games or any other game that relies heavily on collisions. For a character animation, it is
often best to have a simple rectangle collision mask that mostly covers the character anima-
tion. In most cases, a player will not notice the difference.
Editing a collision mask
To edit a collision mask, start by opening the sprite properties for the sprite you wish to
edit. Here, we can see a section of the options labeled Collision Checking :
Search WWH ::




Custom Search