| 1 |
function scr_clover_defragmentscr_clover_defragmentfunction scr_clover_defragment()
{
if (live_call())
return global.live_result;
var width = sprite_get_width(sprite_index);
var height = sprite_get_height(sprite_index);
i_inc = width / 20;
j_inc = 2;
var x_left = x - sprite_xoffset;
var y_top = (y + sprite_yoffset) - sprite_height;
for (var j = 0; j < height; j += j_inc)
{
part = instance_create(x_left, y_top + j, obj_piece_clover);
with (part)
{
target_x = other.x;
target_y = other.y;
left = 0;
top = j;
self.width = width;
self.height = other.j_inc;
sprite_index = other.sprite_index;alarm[0]
if (j == 0)
event_perform(ev_alarm, 0);
}
}
} () |
| 2 |
{ |
| 3 |
if (live_call()) |
| 4 |
return global.live_result; |
| 5 |
var width = sprite_get_width(sprite_index); |
| 6 |
var height = sprite_get_height(sprite_index); |
| 7 |
i_inc = width / 20; |
| 8 |
j_inc = 2; |
| 9 |
var x_left = x - sprite_xoffset; |
| 10 |
var y_top = (y + sprite_yoffset) - sprite_height; |
| 11 |
for (var j = 0; j < height; j += j_inc) |
| 12 |
{ |
| 13 |
part = instance_create(x_left, y_top + j, obj_piece_clover); |
| 14 |
with (part) |
| 15 |
{ |
| 16 |
target_x = other.x; |
| 17 |
target_y = other.y; |
| 18 |
left = 0; |
| 19 |
top = j; |
| 20 |
self.width = width; |
| 21 |
self.height = other.j_inc; |
| 22 |
sprite_index = other.sprite_index; |
| 23 |
alarm[0] |
| 24 |
if (j == 0) |
| 25 |
event_perform(ev_alarm, 0); |
| 26 |
} |
| 27 |
} |
| 28 |
} |