Documentation ¶
Index ¶
- Constants
- func CheckPercent(percentage int) bool
- func ClearScreen()
- func CloseScreen()
- func Distance(x1, y1, x2, y2 int) float64
- func DrawBox(x1, y1, x2, y2 int)
- func EmitStr(x, y int, str string)
- func GetPercent() int
- func InitScreen() error
- func PollForEvents() chan tcell.Event
- func RandomInt(n int) int
- func ShowScreen()
- func Size() (int, int)
- type Game
- type QuadrantSummary
Constants ¶
View Source
const ( MinWidth = 80 MinHeight = 25 )
Minimum width/height of console
View Source
const ( EnterpriseMaxEnergy = 5000 EnterpriseMaxTorpedoes = 20 )
Constants related to player's ship
View Source
const ( Quadrant = iota GalaxyMap LongRangeSensors Quitting )
Constants for game UI state
Variables ¶
This section is empty.
Functions ¶
func CheckPercent ¶
CheckPercent returns true/false based on random number weighted by percentage
func PollForEvents ¶
func PollForEvents() chan tcell.Event
PollForEvents : Call this once, then check return channel for events periodically
Types ¶
type Game ¶
type Game interface { GetStartingKlingons() int GetRemainingKlingons() int KlingonDestroyed() GetStartingStarbases() int GetRemainingStarbases() int StarbaseDestroyed() GetStardate() float64 GetQuadrantSummary(x, y int) *QuadrantSummary SetGameState(state int) Draw() }
Game is the global object with all the overall game state
Click to show internal directories.
Click to hide internal directories.