two animated tiles! ah ah ah

This commit is contained in:
Josh Deprez 2021-07-30 16:11:01 +10:00 committed by Josh Deprez
parent d597481d8c
commit 058afc189c

17
main.go
View file

@ -60,13 +60,14 @@ func main() {
{Tile: 0, DurationTicks: 15}, {Tile: 0, DurationTicks: 15},
{Tile: 1, DurationTicks: 15}, {Tile: 1, DurationTicks: 15},
{Tile: 2, DurationTicks: 15}, {Tile: 2, DurationTicks: 15},
},
}
tiles[2][7] = &engine.AnimatedTile{
AnimDef: []engine.TileAnimFrameDef{
{Tile: 3, DurationTicks: 15}, {Tile: 3, DurationTicks: 15},
{Tile: 4, DurationTicks: 15}, {Tile: 4, DurationTicks: 15},
{Tile: 5, DurationTicks: 15}, {Tile: 5, DurationTicks: 15},
{Tile: 6, DurationTicks: 15}, {Tile: 6, DurationTicks: 15},
{Tile: 7, DurationTicks: 15},
{Tile: 8, DurationTicks: 15},
{Tile: 9, DurationTicks: 15},
}, },
} }
@ -76,16 +77,14 @@ func main() {
TileSize: 16, TileSize: 16,
} }
components := []interface{}{
tilemap,
engine.PerfDisplay{},
}
game := &engine.Game{ game := &engine.Game{
ScreenHeight: screenHeight, ScreenHeight: screenHeight,
ScreenWidth: screenWidth, ScreenWidth: screenWidth,
Scene: &engine.Scene{ Scene: &engine.Scene{
Components: components, Components: []interface{}{
tilemap,
engine.PerfDisplay{},
},
}, },
} }
game.Scene.SetNeedsSort() game.Scene.SetNeedsSort()