fishfightback/flags.go

35 lines
840 B
Go
Raw Permalink Normal View History

2022-06-11 08:46:36 +00:00
//go:build !js || !wasm
// +build !js !wasm
package main
import (
"flag"
"code.rocketnine.space/tslocum/fishfightback/world"
"github.com/hajimehoshi/ebiten/v2"
)
func parseFlags() {
var (
fullscreen bool
noSplash bool
)
flag.BoolVar(&fullscreen, "fullscreen", false, "run in fullscreen mode")
2022-06-13 03:05:43 +00:00
flag.BoolVar(&world.World.StartMuted, "mute", false, "mute music")
2022-06-12 23:08:33 +00:00
flag.Int64Var(&world.World.ForceSeed, "seed", 0, "seed for random level generation")
2022-06-11 08:46:36 +00:00
flag.BoolVar(&noSplash, "no-splash", false, "skip splash screen")
2022-06-11 22:41:44 +00:00
flag.BoolVar(&world.World.GodMode, "god", false, "enable god mode")
2022-06-11 08:46:36 +00:00
flag.IntVar(&world.World.Debug, "debug", 0, "print debug information")
flag.Parse()
if fullscreen {
ebiten.SetFullscreen(true)
}
if noSplash || world.World.Debug > 0 {
world.StartGame()
//world.World.MessageVisible = false
}
}