Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function map_generate(tilemap, tilemapProperties)
- for i = 1, tilemapProperties.rows do
- tilemap[i] = {}
- for j = 1, tilemapProperties.columns do
- if i == 1 then
- if j == 1 then
- tilemap[i][j] = 1
- elseif j == tilemapProperties.columns then
- tilemap[i][j] = 3
- else
- tilemap[i][j] = 2
- end
- elseif i == tilemapProperties.rows then
- if j == 1 then
- tilemap[i][j] = 7
- elseif j == tilemapProperties.columns then
- tilemap[i][j] = 5
- else
- tilemap[i][j] = 6
- end
- else
- if j == 1 then
- tilemap[i][j] = 8
- elseif j == tilemapProperties.columns then
- tilemap[i][j] = 4
- else
- tilemap[i][j] = 0
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement