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 (
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"bufio"
|
||||
_ "embed"
|
||||
|
|
@ -16,6 +17,12 @@ var menu string
|
|||
//go:embed officers.txt
|
||||
var officers string
|
||||
|
||||
var stats string
|
||||
|
||||
var condoms = 10
|
||||
|
||||
var money = 1000
|
||||
|
||||
var border = lipgloss.NewStyle().
|
||||
BorderStyle(lipgloss.NormalBorder()).
|
||||
BorderForeground(lipgloss.Color("63"))
|
||||
|
|
@ -34,8 +41,14 @@ func MashEnterKey() {
|
|||
}
|
||||
|
||||
func CheckStats() {
|
||||
fmt.Println(border.Render("PLAYER STATS"))
|
||||
fmt.Println("Condoms:", condoms)
|
||||
stats = "Condoms: " + strconv.Itoa(condoms) + "\n" + "Money: $" + strconv.Itoa(money) // builds the stats paragraph for the main screen
|
||||
}
|
||||
|
||||
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() {
|
||||
|
|
@ -45,9 +58,6 @@ func main() {
|
|||
|
||||
fmt.Println(officerStyle.Render(officers))
|
||||
MashEnterKey()
|
||||
|
||||
ClearScreen()
|
||||
|
||||
fmt.Println(lipgloss.JoinHorizontal(lipgloss.Bottom, border.Render(menu), statsStyle.Render(menu)))
|
||||
|
||||
MainScreen()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue