game

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollisionMessageParts

type CollisionMessageParts struct {
	Prefix string // "You were hit by "
	VulnID string // The vulnerability ID (may contain hyperlink)
	Suffix string // " (High, CVSS 7.5). Game over!"
}

CollisionMessageParts contains the parts of the collision message for proper rendering

func FormatCollisionMessageParts

func FormatCollisionMessageParts(obs *obstacle) CollisionMessageParts

FormatCollisionMessageParts splits the collision message into parts for proper rendering

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model represents the main game state and handles all game logic for the Scanfrog terminal game.

func NewModel

func NewModel(vulnSource grype.VulnerabilitySource) *Model

NewModel creates a new game model with the specified vulnerability source.

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the game model and returns commands to load vulnerabilities and set up the terminal.

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update processes incoming messages and updates the game state accordingly.

func (Model) View

func (m Model) View() string

View renders the current game state as a string for display.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL