
Return collision_point(x, bbox_bottom + 1, oSlope, true, true) Return collision_rectangle(bbox_left, bbox_bottom + 1, bbox_right, bbox_bottom + 1, oWall, false, true) return the colliding slope instance or noone if none return instance_id of the colliding instance or noone if none found In the future, it will signal us even when the player is standing on a jump-though platform. It relies on two other scripts to return the colliding instance below (or noone if none found). It’s a simple script but you can already tell it’s doing a lot of things for us. return instance_id of the colliding ground object or noone if not colliding For this reason we code a on_ground script like this one. Because of that, we need a way to tell if an object is on the ground be it on an oWall or a oSlope. You need to know how to behave based on the answer to this question so it’s essential to get this script right. This question needs answering in a lot of different contexts. Coding the Engine Is the object on the ground? This new system lets the objects go a little “inside” the slopes and it doesn’t look that weird anymore. In the next articles we’ll build upon this and add enemies, hazards and other engine features. Starting from basic movement and collision code with slopes, we’ll build up the player object with rudimentary state machines. other neat features such as smooth sub-pixel movement.It’s mainly for low resolution games but it can be tweaked to either simulate fluid, hi-res movement or to accomodate optimized collision code for hi-res games. In this series, we’ll see how to code a platformer engine in GameMaker Studio 2. From there you could refactor and clean the code a bit to suit your taste, I guess. Unfortunately I’m unable to update the series for the foreseeable future, but downloading and importing the final project inside the new IDE should trigger the conversion. It doesn’t take advantage of functions, chained accessors, structs and other new features of GML/GMS2.3+ IDE.

The following article is for pre 2.3 versions of GameMaker Studio 2. Some adjustments required for GameMaker Studio 2.3
