Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitlather/3c114cee9359264977250f10ee0f7fdc to your computer and use it in GitHub Desktop.
Save bitlather/3c114cee9359264977250f10ee0f7fdc to your computer and use it in GitHub Desktop.

For my comment on https://nikles.it/2020/gamemaker-tutorial/better-moving-platforms/

    ds_list_add(
        instances_that_have_moved_with_previous_xy_list ,
        instance_to_move                                ,
        instance_to_move.x                              ,
        instance_to_move.y                              );

reset_instance_with_xy_list_position():

/// @param instances_with_previous_xy_list
var instances_with_previous_xy_list = argument0;

var size = ds_list_size(instances_with_previous_xy_list);

for (var i = 0; i < size; i += 3) {

    var instance = instances_with_previous_xy_list[| i + 0];
    var X        = instances_with_previous_xy_list[| i + 1];
    var Y        = instances_with_previous_xy_list[| i + 2];

    instance.x = X;
    instance.y = Y;

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment