Refactor the Tile to a full Atlas

This atlas is a set of chunks and supports resizing
This commit is contained in:
Marc Di Luzio 2020-06-07 18:08:34 +01:00
parent 8586bdabd7
commit ceca4eb7fa
6 changed files with 300 additions and 28 deletions

View file

@ -1,28 +0,0 @@
package game
// Tile represents a single tile on the map
type Tile struct {
// Kind represends the kind of tile this is
Kind int `json:"kind"`
}
const (
ChunkDimensions = 10
)
// Chunk represents a fixed square grid of tiles
type Chunk struct {
// Tiles represents the tiles within the chunk
Tiles [ChunkDimensions][ChunkDimensions]Tile `json:"tiles"`
}
const (
// Use a fixed map dimension for now
AtlasDimensions = 10
)
// Atlas represents a grid of Chunks
// TODO: Make this resizable
type Atlas struct {
Chunks [AtlasDimensions][AtlasDimensions]Chunk `json:"chunks"`
}