-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
63 lines (53 loc) · 2.06 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package main
import (
"fmt"
"github.com/kscarlett/muzsh/colours"
"github.com/kscarlett/muzsh/command"
"github.com/kscarlett/muzsh/game"
"github.com/kscarlett/muzsh/session"
)
func main() {
initGame()
var intent, target string
printBanner()
fmt.Fprintf(colours.StdOut, "The %s are approaching!\n",
colours.Zombie("zombie hordes"))
fmt.Fprintf(colours.StdOut, "Tell me, stranger, what is your %s?\n",
colours.Variable("name"))
session.Data.Player.Name = game.GetInput()
fmt.Fprintf(colours.StdOut, "Okay %s, we need to get out of here now.\n",
colours.Variable(session.Data.Player.Name))
for intent, target = game.GetCommand(); intent != "quit"; intent, target = game.GetCommand() {
command.HandleCommand(intent, target)
}
}
func initGame() {
game.SetupInput()
command.PremapAll()
if session.ExistingSave("muzsh.sav") {
s, err := session.Load("muzsh.sav")
if err != nil {
panic(err)
}
session.Data = s
} else {
session.Data = session.New()
}
}
func printBanner() {
fmt.Fprintf(colours.StdOut,
"\n\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n\n\t%s\n\t%s\n\n",
colours.ZombieEx(" Welcome to "),
colours.Zombie("@@@@@@@@@@ @@@ @@@ @@@@@@@@ @@@@@@ @@@ @@@"),
colours.Zombie("@@@@@@@@@@@ @@@ @@@ @@@@@@@@ @@@@@@@ @@@ @@@"),
colours.Zombie("@@! @@! @@! @@! @@@ @@! !@@ @@! @@@"),
colours.Zombie("!@! !@! !@! !@! @!@ !@! !@! !@! @!@"),
colours.Zombie("@!! !!@ @!@ @!@ !@! @!! !!@@!! @!@!@!@!"),
colours.Zombie("!@! ! !@! !@! !!! !!! !!@!!! !!!@!!!!"),
colours.Zombie("!!: !!: !!: !!! !!: !:! !!: !!!"),
colours.Zombie(":!: :!: :!: !:! :!: !:! :!: !:!"),
colours.Zombie("::: :: ::::: :: :: :::: :::: :: :: :::"),
colours.Zombie(" : : : : : : :: : : :: : : : : :"),
colours.Zombie("[¬º-°]¬ [¬°-º]¬ [¬º-°]¬ [¬°-°]¬ [¬°-º]¬ [¬º-°]¬"),
colours.ZombieEx("muzsh.kscarlett.com Kellen Scarlett, 2018"))
}