1 |
spawn_count = 4 |
2 |
spawn_point_x = [40, 60, 190, 320, 450, 580, 600] |
3 |
spawn_point_y = [300, 440, 440, 440, 440, 440, 300] |
4 |
spawn_point_angle = [0, 90, 90, 90, 90, 90, 180] |
5 |
coordinate_list = ds_list_create() |
6 |
for (var i = 0; i < array_length(spawn_point_x); i++) |
7 |
ds_list_add(coordinate_list, i) |
8 |
while (ds_list_size(coordinate_list) > spawn_count) |
9 |
{ |
10 |
ds_list_shuffle(coordinate_list) |
11 |
ds_list_delete(coordinate_list, 0) |
12 |
} |
13 |
for (i = 0; i < ds_list_size(coordinate_list); i++) |
14 |
{ |
15 |
var cur_val = ds_list_find_value(coordinate_list, i) |
16 |
var warning = instance_create_depth(spawn_point_x[cur_val], spawn_point_y[cur_val], -100, obj_flowey_battle_gray_fly_trap_warning) |
17 |
if (i == 0) |
18 |
warning.can_play_sound = true |
19 |
warning.direction = spawn_point_angle[cur_val] |
20 |
warning.image_angle = spawn_point_angle[cur_val] |
21 |
} |
22 |
ds_list_clear(coordinate_list) |
23 |
instance_destroy() |