Guide to Game Maker Studio 2: Mastering Drag & Drop Collision Easily

Collision detection is a crucial element in game development—it's how game objects interact with each other. Game Maker Studio 2 (GMS2) offers several collision detection options and this documentation focuses on mastering the drag and drop collision system.

Getting Started

First and foremost, the user should understand what drag and drop collision means. Different from box and circle collision, which works with the global boundary of objects, the drag and drop collision in GMS2 works with the actual shape of the Sprites.

Sprite Properties

To begin, the user should create a sprite in the Sprite Editor. Once finished, click the ‘Edit Sprite’ button to open the Sprite Properties dialog. With the ‘Origin’ point set, click the ‘Collision Mask’ button in the Texture tab.

Creating Points

Hit the ‘Create Points’ button in the Collision MaskTab. By dragging the left mouse button, the user should now be able to create points and draw shapes around the image.

To create different shapes, the user should be familiar with the following tools:

  • Shift: For creating straight lines
  • Right Click: For closing the shape
  • Del: For removing points

Adding Precise Shapes

Once the user has created their shape, the next step is to add precision. Click the ‘Edit Points’ button and, with the right click, add points to specific nodes and manually drag them to reach the desired shape.

Finishing the Sprite’s Collision Mask

To finish the process, click the ‘Raster Mask’ button in the Collision Mask Tab and move the slider right to increase the precision. This will make the sprite's collision shape more accurate and detailed.

FAQ

What is drag and drop collision?

Drag and drop collision refers to when the collision depends on a shape or polygon rather than a simple boundary or circle. This type of collision is usually used to make a game more realistic.

How do I create a shape for collision in GMS2?

In GMS2, you can create collision shapes in the Sprite Properties dialog. Click the ‘Collision Mask’ button and the ‘Create Points’ button. You can then draw a shape around the sprite using the left mouse button.

What tools are available for collision shape creation?

The user should be familiar with the ‘Shift’ key for creating straight lines, the right click for closing the shape, and the ‘Del’ key for removing points.

How can I add precision to my collision shape?

Once the user has created their shape, the next step is to add precision. Click the ‘Edit Points’ button and, with the right click, add points to specific nodes and manually drag them to reach the desired shape.

How can I finish the sprite’s collision mask?

To finish the process, click the ‘Raster Mask’ button in the Collision Mask Tab and move the slider right to increase the precision. This will make the sprite's collision shape more accurate and detailed.

Other Resources

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to Lxadm.com.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.