Updated menu
This commit is contained in:
parent
2092213b97
commit
debba32aa2
1 changed files with 16 additions and 6 deletions
22
main.go
22
main.go
|
|
@ -3,6 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
"bufio"
|
"bufio"
|
||||||
_ "embed"
|
_ "embed"
|
||||||
|
|
@ -16,6 +17,12 @@ var menu string
|
||||||
//go:embed officers.txt
|
//go:embed officers.txt
|
||||||
var officers string
|
var officers string
|
||||||
|
|
||||||
|
var stats string
|
||||||
|
|
||||||
|
var condoms = 10
|
||||||
|
|
||||||
|
var money = 1000
|
||||||
|
|
||||||
var border = lipgloss.NewStyle().
|
var border = lipgloss.NewStyle().
|
||||||
BorderStyle(lipgloss.NormalBorder()).
|
BorderStyle(lipgloss.NormalBorder()).
|
||||||
BorderForeground(lipgloss.Color("63"))
|
BorderForeground(lipgloss.Color("63"))
|
||||||
|
|
@ -34,8 +41,14 @@ func MashEnterKey() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func CheckStats() {
|
func CheckStats() {
|
||||||
fmt.Println(border.Render("PLAYER STATS"))
|
stats = "Condoms: " + strconv.Itoa(condoms) + "\n" + "Money: $" + strconv.Itoa(money) // builds the stats paragraph for the main screen
|
||||||
fmt.Println("Condoms:", condoms)
|
}
|
||||||
|
|
||||||
|
func MainScreen() {
|
||||||
|
CheckStats()
|
||||||
|
fmt.Println(border.Render("OPP Wars - Organized Crime Edition"))
|
||||||
|
fmt.Println(lipgloss.JoinHorizontal(lipgloss.Bottom, border.Render(menu), statsStyle.Render(stats))) // makes a horizontal display joining two paras
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
@ -45,9 +58,6 @@ func main() {
|
||||||
|
|
||||||
fmt.Println(officerStyle.Render(officers))
|
fmt.Println(officerStyle.Render(officers))
|
||||||
MashEnterKey()
|
MashEnterKey()
|
||||||
|
|
||||||
ClearScreen()
|
ClearScreen()
|
||||||
|
MainScreen()
|
||||||
fmt.Println(lipgloss.JoinHorizontal(lipgloss.Bottom, border.Render(menu), statsStyle.Render(menu)))
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue