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

21
main.go
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 boxesFile, err := assets.Open("assets/boxes.png")
func() { if err != nil {
boxesFile, err := assets.Open("assets/boxes.png") log.Fatalf("Couldn't open asset: %v", err)
if err != nil { }
log.Fatalf("Couldn't open asset: %v", err) boxesPNG, _, err := image.Decode(boxesFile)
} if err != nil {
defer boxesFile.Close() log.Fatalf("Couldn't decode asset: %v", err)
boxesPNG, _, err = image.Decode(boxesFile) }
if err != nil { boxesFile.Close()
log.Fatalf("Couldn't decode asset: %v", err)
}
}()
tiles := &engine.Tilemap{ tiles := &engine.Tilemap{
Map: [][]int{ Map: [][]int{