Documentation
¶
Index ¶
Constants ¶
View Source
const (
DefaultAperture = 3
)
Variables ¶
View Source
var ( TitleStyle = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("10")) ViewStyle = lipgloss.NewStyle().MarginTop(1).MarginBottom(1) ViewportStyle = lipgloss.NewStyle().Border(lipgloss.RoundedBorder()).BorderForeground(lipgloss.Color("236")) GameOverStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("9")) )
Functions ¶
Types ¶
type Model ¶
type Model struct {
// Keys holds key bindings.
Keys KeyMap
// Obstacles is a data structure containing obstacles.
Obstacles Obstacles
// Cursor is the location of the cursor.
Cursor Location
// Score is the number of obstacles avoided.
Score int
// Help contains the Bubble Tea help model.
Help help.Model
// Viewport is the size of the game area.
Viewport Location
// Over is true when the player has lost.
Over bool
// Pressed is used to lock the cursor from moving until the next tick.
Pressed bool
// Layouted tracks whether the initial layout has been performed.
Layouted bool
}
type Obstacle ¶
type Obstacle struct {
// Aperture is the size of the opening in the obstacle.
// Must be odd. Even values will be rounded up to the next odd value.
Aperture int
*Location
}
func NewObstacle ¶
Click to show internal directories.
Click to hide internal directories.