1 | function scr_enemy_defragment |
2 | { |
3 | var width = sprite_get_width(sprite_index) |
4 | var height = sprite_get_height(sprite_index) |
5 | i_inc = width / 20 |
6 | j_inc = 2 |
7 | for (var i = 0; i < width; i += i_inc) |
8 | { |
9 | for (var j = spr_collisionbox; j < height; j += j_inc) |
10 | { |
11 | part = instance_create((bbox_left + i), (bbox_top + j), obj_piece) |
12 | with (part) |
13 | { |
14 | left = i |
15 | top = j |
16 | width = other.i_inc |
17 | height = other.j_inc |
18 | sprite_index = other.sprite_index |
19 | alarm[0] |
20 | } |
21 | } |
22 | } |
23 | } |