Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var i, j, l, m, n, chunk, tile, bg, xx, yy, left, top;
- game = objGame;
- mode = -1;
- bottomLayer[ 0] = 10000;
- bottomLayer[ 1] = 9500;
- bottomLayer[ 2] = 9000;
- bottomLayers = 3;
- topLayer[ 0] = -10000;
- topLayers = 1;
- while( mode < 2) {
- for( i = 0;i < room_width;i += 16) {
- for( j = 0;j < room_height;j += 16) {
- if (( i mod 256) == 0) && (( j mod 256) == 0) {
- surface_set_target( game.surface);
- chunk = instance_create( i, j, objChunk);
- chunk.depth = mode * 500;
- surface_set_target( chunk.surface);
- draw_clear_alpha( 0, 0);
- }
- switch( mode) {
- case -1:
- for( l = 0;l < bottomLayers;l += 1) {
- tile = tile_layer_find( bottomLayer[ l], i, j);
- if tile_exists( tile) {
- bg = tile_get_background( tile);
- xx = i mod 256;
- yy = j mod 256;
- left = tile_get_left( tile);
- top = tile_get_top( tile);
- draw_background_part( bg, left, top, 16, 16, xx, yy);
- }
- }
- break;
- case 1:
- for( l = 0;l < topLayers;l += 1) {
- tile = tile_layer_find( topLayer[ l], i, j);
- if tile_exists( tile) {
- bg = tile_get_background( tile);
- xx = i mod 256;
- yy = j mod 256;
- left = tile_get_left( tile);
- top = tile_get_top( tile);
- draw_background_part( bg, left, top, 16, 16, xx, yy);
- }
- }
- break;
- }
- }
- }
- mode += 2;
- }
- surface_set_target( game.surface);
- for( m = 0;m < bottomLayers;m += 1) {
- tile_layer_hide( bottomLayer[ m]);
- }
- for( n = 0;n < topLayers;n += 1) {
- tile_layer_hide( topLayer[ n]);
- }
Add Comment
Please, Sign In to add comment