diff --git a/objects/obj_collect/Other_4.gml b/objects/obj_collect/Other_4.gml new file mode 100644 index 00000000..52c1854c --- /dev/null +++ b/objects/obj_collect/Other_4.gml @@ -0,0 +1,2 @@ +if (ds_list_find_index(global.ds_collect, id) != -1) + instance_destroy() diff --git a/objects/obj_destroyable/Other_4.gml b/objects/obj_destroyable/Other_4.gml new file mode 100644 index 00000000..8777db7d --- /dev/null +++ b/objects/obj_destroyable/Other_4.gml @@ -0,0 +1,4 @@ +if ds_list_find_index(global.ds_destroyables, id) != -1 { + instance_destroy(); + exit; +} diff --git a/objects/par_enemy/Destroy_0.gml b/objects/par_enemy/Destroy_0.gml index 9bfc988d..6847019c 100644 --- a/objects/par_enemy/Destroy_0.gml +++ b/objects/par_enemy/Destroy_0.gml @@ -1,5 +1,6 @@ if (ds_list_find_index(global.ds_dead_enemies, id) == -1) { + ds_list_add(global.ds_dead_enemies, id) with (instance_create(x, y, obj_enemycorpse)) sprite_index = other.sprs.dead @@ -13,4 +14,3 @@ if (ds_list_find_index(global.ds_dead_enemies, id) == -1) shake_camera() } -ds_list_add(global.ds_dead_enemies, id) diff --git a/scripts/generic_functions_util/generic_functions_util.gml b/scripts/generic_functions_util/generic_functions_util.gml index 1d31a474..67b3bb77 100644 --- a/scripts/generic_functions_util/generic_functions_util.gml +++ b/scripts/generic_functions_util/generic_functions_util.gml @@ -124,7 +124,9 @@ function set_globals() timer: 0, font: font_add_sprite_ext(spr_tv_c_font, "0123456789", true, 2) } - + + global.ds_collect = ds_list_create() + global.ds_destroyables = ds_list_create() global.ds_dead_enemies = ds_list_create() global.ds_broken_destroyables = ds_list_create() global.ds_secrets = ds_list_create()