Skip to content

Commit

Permalink
Set random seed on setup
Browse files Browse the repository at this point in the history
  • Loading branch information
tsujio committed Aug 28, 2021
1 parent 3d30f86 commit 6a32764
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,11 @@ func main() {
if os.Getenv("GAME_LOGGING") != "1" {
logging.Disable()
}
if seed, err := strconv.Atoi(os.Getenv("GAME_RAND_SEED")); err == nil {
rand.Seed(int64(seed))
} else {
rand.Seed(time.Now().Unix())
}

ebiten.SetWindowSize(screenWidth, screenHeight)
ebiten.SetWindowTitle("Maxwell's Demon")
Expand Down

0 comments on commit 6a32764

Please sign in to comment.