Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cells_x = 75
- cells_y = 75
- global.grid = ds_grid_create(cells_x, cells_y)
- global.grid_array = []
- room_width = cells_x * CellWidth
- room_height = cells_y * CellHeight
- // Список тайлов, которые мы будем отрисовывать
- enum Tile
- {
- air,
- ground,
- stone1,
- metal,
- coal
- }
- // Объекты, которые будем отрисовывать
- global.TileObjects = [noone, oDirt, oRock, oMetal, oCoal]
- enum Shadows
- {
- none,
- ground,
- stone1,
- stone2,
- stone3,
- stone4,
- stone5,
- metal,
- coal
- }
- var lay_id_blocks = layer_get_id("BlockLayer");
- var map_id_blocks = layer_tilemap_get_id(lay_id_blocks);
- var lay_id_shadows = layer_get_id("ShadowLayer");
- var map_id_shadows = layer_tilemap_get_id(lay_id_shadows);
- for (var _y = 0; _y < cells_y; ++_y)
- {
- for (var _x = 0; _x < cells_x; ++_x)
- {
- ds_grid_set(global.grid, _x, _y, 0) // 0 - это стоимость клетки. Ноль - значит непроходима.
- tilemap_set(map_id_blocks, Tile.ground, _x, _y)
- tilemap_set(map_id_shadows, 47, _x, _y)
- // Х, Y, клетка земли, клетка тени
- array_push(global.grid_array, [_x, _y, Tile.ground, 47])
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement