Return to site

Gamemaker studio 2 tutorial for mac

broken image
broken image

In point 2 we pass the aforementioned instances_ds (along with other required parameters) to the actual collision check script. This list will hold the colliding instances found. In point 1 we create a instances_ds ( _ds stands for data structure as we’re creating a ds_list).

broken image

These scripts should be called from the move_platform_x and move_platform_y scripts. Return collision_rectangle_list(bbox_left, side_to_check, bbox_right, side_to_check, obj, false, true, instances_ds, false) Var side_to_check = ydir ? bbox_bottom + 1 : bbox_top - 1 Return collision_rectangle_list(side_to_check, bbox_top, side_to_check, bbox_bottom, obj, false, true, instances_ds, false) coll_y_list coll_y_list(ydir, instances_ds, obj) Var side_to_check = xdir ? bbox_right + 1 : bbox_left - 1 coll_x_list coll_x_list(xdir, instances_ds, obj) Sometimes being lazy helps you being organized. I made these scripts simply because I didn’t want to type all the bbox_* and collision parameters each time. The function will automatically fill the ds_list and return the number of instances found, just like the collision_rectangle_list. I know I will pass an xdir or a ydir, a ds_list reference and the object_index for which we’re checking the collision. I created a couple of utility scripts for the GMS2 collision_rectangle_list function.