clear batches at beginning of draw

This commit is contained in:
Zachary King 2019-02-04 20:18:08 -06:00
parent b53cad3147
commit 00780ad113
1 changed files with 4 additions and 0 deletions

View File

@ -61,6 +61,10 @@ func gameloop(win *pixelgl.Window, tilemap *tmx.Map) {
win.Clear(clearColor)
// Draw tiles
for _, batch := range batches {
batch.Clear()
}
for _, layer := range tilemap.Layers {
for tileIndex, tile := range layer.DecodedTiles {
ts := layer.Tileset