This commit is contained in:
Josh Deprez 2021-07-31 16:46:12 +10:00 committed by Josh Deprez
parent ec8daf7b79
commit 3f4da9f6bd

16
main.go
View file

@ -46,14 +46,14 @@ func main() {
} }
} }
tiles[3][5] = &engine.AnimatedTile{ tiles[4][5] = &engine.AnimatedTile{
AnimDef: []engine.TileAnimFrameDef{ AnimDef: []engine.TileAnimFrameDef{
{Tile: 0, DurationTicks: 16}, {Tile: 0, DurationTicks: 16},
{Tile: 1, DurationTicks: 16}, {Tile: 1, DurationTicks: 16},
{Tile: 2, DurationTicks: 16}, {Tile: 2, DurationTicks: 16},
}, },
} }
tiles[2][7] = &engine.AnimatedTile{ tiles[6][7] = &engine.AnimatedTile{
AnimDef: []engine.TileAnimFrameDef{ AnimDef: []engine.TileAnimFrameDef{
{Tile: 3, DurationTicks: 12}, {Tile: 3, DurationTicks: 12},
{Tile: 4, DurationTicks: 12}, {Tile: 4, DurationTicks: 12},
@ -62,18 +62,16 @@ func main() {
}, },
} }
tilemap := &engine.Tilemap{
Map: tiles,
Src: engine.ImageRef{Path: "assets/boxes.png"},
TileSize: 16,
}
game := &engine.Game{ game := &engine.Game{
ScreenHeight: screenHeight, ScreenHeight: screenHeight,
ScreenWidth: screenWidth, ScreenWidth: screenWidth,
Scene: &engine.Scene{ Scene: &engine.Scene{
Components: []interface{}{ Components: []interface{}{
tilemap, &engine.Tilemap{
Map: tiles,
Src: engine.ImageRef{Path: "assets/boxes.png"},
TileSize: 16,
},
engine.PerfDisplay{}, engine.PerfDisplay{},
}, },
}, },