Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

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
You can’t perform that action at this time.