package main

import (
	"log"
	"mountain/internal/game"
	"os"

	"github.com/hajimehoshi/ebiten/v2"
)

func main() {
	// Sätt upp loggning till fil
	f, err := os.OpenFile("game.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
	if err != nil {
		log.Fatalf("Kunde inte skapa logfil: %v", err)
	}
	defer f.Close()
	log.SetOutput(f)

	log.Println("--- Spelet startar ---")

	ebiten.SetWindowSize(800, 600)
	ebiten.SetWindowTitle("Regin: Mountain of Treasures")

	g := game.NewGame()
	if err := ebiten.RunGame(g); err != nil {
		log.Fatal(err)
	}
}
