Guest User

Untitled

a guest
Dec 5th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var i, j, l, m, n, chunk, tile, bg, xx, yy, left, top;
  2. game = objGame;
  3.  
  4. mode = -1;
  5.  
  6. bottomLayer[ 0] = 10000;
  7. bottomLayer[ 1] = 9500;
  8. bottomLayer[ 2] = 9000;
  9. bottomLayers = 3;
  10.  
  11. topLayer[ 0] = -10000;
  12. topLayers = 1;
  13.  
  14. while( mode < 2) {
  15.     for( i = 0;i < room_width;i += 16) {
  16.         for( j = 0;j < room_height;j += 16) {
  17.             if (( i mod 256) == 0) && (( j mod 256) == 0) {
  18.                 surface_set_target( game.surface);
  19.                 chunk = instance_create( i, j, objChunk);
  20.                 chunk.depth = mode * 500;
  21.                 surface_set_target( chunk.surface);
  22.                 draw_clear_alpha( 0, 0);
  23.             }
  24.             switch( mode) {
  25.                 case -1:
  26.                     for( l = 0;l < bottomLayers;l += 1) {
  27.                         tile = tile_layer_find( bottomLayer[ l], i, j);
  28.                         if tile_exists( tile) {
  29.                             bg = tile_get_background( tile);
  30.                             xx = i mod 256;
  31.                             yy = j mod 256;
  32.                             left = tile_get_left( tile);
  33.                             top = tile_get_top( tile);
  34.                             draw_background_part( bg, left, top, 16, 16, xx, yy);
  35.                         }
  36.                     }
  37.                 break;
  38.                 case 1:
  39.                     for( l = 0;l < topLayers;l += 1) {
  40.                         tile = tile_layer_find( topLayer[ l], i, j);
  41.                         if tile_exists( tile) {
  42.                             bg = tile_get_background( tile);
  43.                             xx = i mod 256;
  44.                             yy = j mod 256;
  45.                             left = tile_get_left( tile);
  46.                             top = tile_get_top( tile);
  47.                             draw_background_part( bg, left, top, 16, 16, xx, yy);
  48.                         }
  49.                     }
  50.                 break;
  51.             }
  52.         }
  53.     }
  54.     mode += 2;
  55. }
  56. surface_set_target( game.surface);
  57. for( m = 0;m < bottomLayers;m += 1) {
  58.     tile_layer_hide( bottomLayer[ m]);
  59. }
  60. for( n = 0;n < topLayers;n += 1) {
  61.     tile_layer_hide( topLayer[ n]);
  62. }
Add Comment
Please, Sign In to add comment