| 1 |
var scroll_speed_current = ceil(scroll_speed); |
| 2 |
var num = tile_get_count(); |
| 3 |
for (var i = 0; i < num; i++) |
| 4 |
{ |
| 5 |
var tile = tile_get_id(i); |
| 6 |
var tile_y = tile_get_y(tile); |
| 7 |
var tile_x = tile_get_x(tile); |
| 8 |
var tile_width = tile_get_width(tile); |
| 9 |
var tile_shift; |
| 10 |
switch (tile_get_depth(tile)) |
| 11 |
{ |
| 12 |
case 1000000: |
| 13 |
tile_shift = scroll_speed; |
| 14 |
break; |
| 15 |
} |
| 16 |
tile_set_position(tile, tile_x + tile_shift, tile_y); |
| 17 |
tile_x = tile_get_x(tile); |
| 18 |
if (scroll_speed < 0) |
| 19 |
{ |
| 20 |
if (tile_x <= -20) |
| 21 |
tile_set_position(tile, room_width, tile_y); |
| 22 |
} |
| 23 |
else if (tile_x >= room_width) |
| 24 |
{ |
| 25 |
tile_set_position(tile, -20, tile_y); |
| 26 |
} |
| 27 |
} |
| 28 |
if ((scroll_speed < 0 && wall_x > -sprite_get_width(spr_gemwall)) || (scroll_speed > 0 && wall_x < sprite_get_width(spr_gemwall))) |
| 29 |
wall_x += (scroll_speed * 0.5); |
| 30 |
else |
| 31 |
wall_x = 0; |