Exemple #1
0
func setMode(m mode) {
	fourierIsVisible = false
	fallIsVisible = false
	radarIsVisible = false
	scoreIsVisible = false
	dividerCount = 0
	switch m {
	case modeSplash:
		teletype.PrintUpper(title + "\n")
		teletype.PrintUpper(edition + "\n")
		teletype.PrintUpper("By Arch D. Robison\n")
		var err error
		records, err = vanity.ReadFromFile()
		if err != nil {
			if devConfig {
				teletype.Print(err.Error())
			}
		}
	case modeName:
		teletype.Reset()
		teletype.PrintUpper(grammar.GenerateWithNumber(rune('H'), universe.NKill()) + "\n")
		teletype.PrintUpper("Please enter your name:\n")
		teletype.DisplayCursor(true)
	case modeTraining, modeGame:
		universe.BeginGame(m == modeTraining)
		// Temporarily set NLiveMax to 0.  End of boot sequence will set it to 1.
		universe.SetNLiveMax(0)
		startBootSequence()
	case modeVanity:
		teletype.Reset()
		teletype.DisplayCursor(false)
		teletype.PrintUpper("Supreme Freqs\n\nScore Player\n")
		for _, r := range records {
			teletype.PrintUpper(fmt.Sprintf("%5d %s\n", r.Score, r.Name))
		}
	}
	currentMode = m
	setMenus(m)
}
Exemple #2
0
func startBootSequence() {
	bootSequenceIndex = 0
	bootSequenceFrac = 0
	teletype.DisplayCursor(false)
	teletype.Reset()
}