Seperate world and add interactable grid layer
This commit is contained in:
@@ -28,12 +28,12 @@ load_tilemap_sheet :: proc(path: cstring, tile_width, tile_height: i32) -> Tilem
|
||||
}
|
||||
}
|
||||
|
||||
create_tile_grid :: proc(width, height: i32) -> [][]Tile {
|
||||
create_tile_grid :: proc(width, height: i32, fill_tile: Tile) -> [][]Tile {
|
||||
grid: [][]Tile = make([][]Tile, height)
|
||||
for y := 0; y < int(height); y += 1 {
|
||||
grid[y] = make([]Tile, width)
|
||||
for x := 0; x < int(width); x += 1 {
|
||||
grid[y][x] = ground_tile
|
||||
grid[y][x] = fill_tile
|
||||
}
|
||||
}
|
||||
return grid
|
||||
@@ -70,7 +70,7 @@ draw_tile_grid :: proc(sheet: ^TilemapSpritesheet, grid: [][]Tile, camera: ^rayl
|
||||
|
||||
pos := raylib.Vector2{f32(x) * tile_w, f32(y) * tile_h}
|
||||
|
||||
draw_tile(sheet, tile, pos, raylib.Color{0, 136, 200, 255})
|
||||
draw_tile(sheet, tile, pos, raylib.WHITE)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user