O'Reilly logo

GameMaker Game Programming with GML by Matthew DeLucas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with Collision events

Collision events are triggered when one object collides with another. These events can be added to any object. When adding a Collision event in the Choose the Event to Add dialog window, a list of all the currently available object resources will appear. The newly created event will then be triggered when the object being modified collides with any instance of that object.

Updating the Create event of obj_vlad

Before writing scripts to handle collision, the addition of an instanced variable is required. This should be added to the script in the Create event of obj_vlad as follows:

// Tolerance for how many pixels below a platform the character can still be moved to the top.
step_threshold = 16;

This newly created variable, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required