From debba32aa2d8bb90cfb8aff16aac45e31e77ea71 Mon Sep 17 00:00:00 2001 From: Starstreak Date: Wed, 6 Aug 2025 00:00:33 +0000 Subject: [PATCH] Updated menu --- main.go | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index a6baa8d..62a94b3 100644 --- a/main.go +++ b/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() }