package main import ( "log" "os" "os/signal" "syscall" "code.rocketnine.space/tslocum/commandeuropa/game" "code.rocketnine.space/tslocum/commandeuropa/world" "github.com/hajimehoshi/ebiten/v2" ) func main() { ebiten.SetWindowTitle("Command Europa") ebiten.SetWindowResizingMode(ebiten.WindowResizingModeEnabled) ebiten.SetWindowSize(int(world.ScreenWidth), int(world.ScreenHeight)) ebiten.SetFullscreen(true) ebiten.SetWindowClosingHandled(true) ebiten.SetFPSMode(ebiten.FPSModeVsyncOn) ebiten.SetTPS(world.TPS) ebiten.SetRunnableOnUnfocused(true) ebiten.SetCursorShape(ebiten.CursorShapeCrosshair) parseFlags() g, err := game.NewGame() if err != nil { log.Fatal(err) } sigc := make(chan os.Signal, 1) signal.Notify(sigc, syscall.SIGINT, syscall.SIGTERM) go func() { <-sigc g.Exit() }() err = ebiten.RunGame(g) if err != nil { log.Fatal(err) } }