gas-station-sim/flags.go

35 lines
754 B
Go

//go:build !js || !wasm
// +build !js !wasm
package main
import (
"flag"
"code.rocketnine.space/tslocum/gas-station-sim/world"
)
func parseFlags() {
var (
skipIntro bool
skipName bool
skipTutorial bool
)
flag.BoolVar(&world.Fullscreen, "fullscreen", true, "run in fullscreen mode")
flag.BoolVar(&skipIntro, "skip-intro", false, "skip intro screen")
flag.BoolVar(&skipName, "skip-name", false, "skip name input screen")
flag.BoolVar(&skipTutorial, "skip-tutorial", false, "skip tutorial")
flag.Parse()
if skipIntro || skipName || skipTutorial {
world.StartGame()
if skipName || skipTutorial {
world.Name = world.NameInput
world.NameInput = ""
if skipTutorial {
world.TutorialIntroFinished = true
}
}
}
}