This commit is contained in:
Josh Deprez 2021-07-29 14:19:47 +10:00 committed by Josh Deprez
parent 3fab8dbe7a
commit 2bb2635120

View file

@ -19,18 +19,15 @@ func main() {
ebiten.SetWindowSize(screenWidth*2, screenHeight*2) ebiten.SetWindowSize(screenWidth*2, screenHeight*2)
ebiten.SetWindowTitle("TODO") ebiten.SetWindowTitle("TODO")
var boxesPNG image.Image
func() {
boxesFile, err := assets.Open("assets/boxes.png") boxesFile, err := assets.Open("assets/boxes.png")
if err != nil { if err != nil {
log.Fatalf("Couldn't open asset: %v", err) log.Fatalf("Couldn't open asset: %v", err)
} }
defer boxesFile.Close() boxesPNG, _, err := image.Decode(boxesFile)
boxesPNG, _, err = image.Decode(boxesFile)
if err != nil { if err != nil {
log.Fatalf("Couldn't decode asset: %v", err) log.Fatalf("Couldn't decode asset: %v", err)
} }
}() boxesFile.Close()
tiles := &engine.Tilemap{ tiles := &engine.Tilemap{
Map: [][]int{ Map: [][]int{