Advertisement
Ulabael

oGridForLineOfSight

Sep 23rd, 2022
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. var width = room_width div CellWidth;
  2. var height = room_height div CellHeight
  3. global.grid = ds_grid_create(width, height);
  4.  
  5. var lay_id_ground = layer_get_id("GroundTiles");
  6. var map_id_ground = layer_tilemap_get_id(lay_id_ground);
  7. var lay_id_shadows = layer_get_id("ShadowTiles");
  8. var map_id_shadows = layer_tilemap_get_id(lay_id_shadows);
  9.  
  10. for (var yy = 0; yy < height; ++yy) {
  11. for (var xx = 0; xx < width; ++xx) {
  12. ds_grid_set(global.grid, xx, yy, 1);
  13. tilemap_set(map_id_ground, 1, xx, yy);
  14. tilemap_set(map_id_shadows, 1, xx, yy);
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement