Documentation
¶
Index ¶
- Variables
- func RunUI()
- type AISelectionScreen
- type AppState
- type DualAISelectionScreen
- type EndScreen
- type Game
- type GameScreen
- type HomeScreen
- type MoveRecord
- type ResultScreen
- type Screen
- type StartScreen
- type UI
- func (ui *UI) EndGame()
- func (ui *UI) NewGame()
- func (s *UI) StartAIVsAIGame(ai1Version, ai2Version int)
- func (s *UI) StartGame(player1, player2 string)
- func (s *UI) StartPlayerVsAIGame(aiVersion int)
- func (s *UI) SwitchToAISelectionScreen()
- func (s *UI) SwitchToDualAISelectionScreen()
- func (s *UI) SwitchToHomeScreen()
Constants ¶
This section is empty.
Variables ¶
var ( ColorBackground = color.RGBA{28, 28, 30, 255} ColorGrid = color.RGBA{70, 70, 70, 255} ColorWhite = color.RGBA{230, 230, 230, 255} ColorBlack = color.RGBA{20, 20, 20, 255} ColorValid = color.RGBA{100, 200, 100, 128} ColorLabelText = color.RGBA{200, 200, 200, 255} ColorLastMove = color.RGBA{255, 200, 50, 255} // Bright orange/yellow highlight for last move )
Game colors
Functions ¶
Types ¶
type AISelectionScreen ¶
type AISelectionScreen struct {
// contains filtered or unexported fields
}
AISelectionScreen represents the screen for selecting an AI opponent
func NewAISelectionScreen ¶
func NewAISelectionScreen(ui *UI) *AISelectionScreen
NewAISelectionScreen creates a new AI selection screen
func (*AISelectionScreen) Draw ¶
func (s *AISelectionScreen) Draw(screen *ebiten.Image)
Draw renders the AI selection screen
func (*AISelectionScreen) Layout ¶
func (s *AISelectionScreen) Layout(outsideWidth, outsideHeight int) (int, int)
Layout implements the Screen interface
func (*AISelectionScreen) Update ¶
func (s *AISelectionScreen) Update() error
Update handles input on the AI selection screen
type DualAISelectionScreen ¶
type DualAISelectionScreen struct {
// contains filtered or unexported fields
}
DualAISelectionScreen represents the screen for selecting two AI players
func NewDualAISelectionScreen ¶
func NewDualAISelectionScreen(ui *UI) *DualAISelectionScreen
NewDualAISelectionScreen creates a new dual AI selection screen
func (*DualAISelectionScreen) Draw ¶
func (s *DualAISelectionScreen) Draw(screen *ebiten.Image)
Draw renders the dual AI selection screen
func (*DualAISelectionScreen) Layout ¶
func (s *DualAISelectionScreen) Layout(outsideWidth, outsideHeight int) (int, int)
Layout implements the Screen interface
func (*DualAISelectionScreen) Update ¶
func (s *DualAISelectionScreen) Update() error
Update handles input on the dual AI selection screen
type EndScreen ¶
type EndScreen struct {
// contains filtered or unexported fields
}
EndScreen represents the game over screen
type Game ¶
type Game struct {
// contains filtered or unexported fields
}
Game implements ebiten.Game interface
type GameScreen ¶
type GameScreen struct {
// contains filtered or unexported fields
}
GameScreen manages the main game UI
func (*GameScreen) AddMoveToHistory ¶
AddMoveToHistory adds a move to the history table
func (*GameScreen) Draw ¶
func (s *GameScreen) Draw(screen *ebiten.Image)
Draw renders the game screen
type HomeScreen ¶
type HomeScreen struct {
// contains filtered or unexported fields
}
HomeScreen represents the home/entry screen of the application
func (*HomeScreen) Draw ¶
func (s *HomeScreen) Draw(screen *ebiten.Image)
Draw renders the home screen
func (*HomeScreen) Layout ¶
func (s *HomeScreen) Layout(outsideWidth, outsideHeight int) (int, int)
Layout implements the Screen interface
func (*HomeScreen) Update ¶
func (s *HomeScreen) Update() error
Update handles input on the home screen
type MoveRecord ¶
MoveRecord represents a single move made by a player
type ResultScreen ¶
type ResultScreen struct {
// contains filtered or unexported fields
}
ResultScreen shows the game results
func NewResultScreen ¶
func NewResultScreen(ui *UI) *ResultScreen
NewResultScreen creates a new result screen
func (*ResultScreen) Draw ¶
func (s *ResultScreen) Draw(screen *ebiten.Image)
Draw renders the result screen
func (*ResultScreen) Layout ¶
func (s *ResultScreen) Layout(outsideWidth, outsideHeight int) (int, int)
Layout implements ebiten.Game
func (*ResultScreen) Update ¶
func (s *ResultScreen) Update() error
Update handles input on the result screen
type Screen ¶
type Screen interface {
Update() error
Draw(screen *ebiten.Image)
Layout(outsideWidth, outsideHeight int) (int, int)
}
Screen interface for different game screens
type StartScreen ¶
type StartScreen struct {
// contains filtered or unexported fields
}
StartScreen represents the game's start screen
func NewStartScreen ¶
func NewStartScreen(ui *UI) *StartScreen
NewStartScreen creates a new start screen
func (*StartScreen) Draw ¶
func (s *StartScreen) Draw(screen *ebiten.Image)
Draw renders the start screen
func (*StartScreen) Layout ¶
func (s *StartScreen) Layout(outsideWidth, outsideHeight int) (int, int)
Layout implements ebiten.Game
func (*StartScreen) Update ¶
func (s *StartScreen) Update() error
Update handles input for the start screen
type UI ¶
type UI struct {
// contains filtered or unexported fields
}
UI manages the game UI
func (*UI) StartAIVsAIGame ¶
StartAIVsAIGame starts a game with two AI players
func (*UI) StartPlayerVsAIGame ¶
StartPlayerVsAIGame starts a game with a human player against the selected AI
func (*UI) SwitchToAISelectionScreen ¶
func (s *UI) SwitchToAISelectionScreen()
SwitchToAISelectionScreen switches to the AI selection screen
func (*UI) SwitchToDualAISelectionScreen ¶
func (s *UI) SwitchToDualAISelectionScreen()
SwitchToDualAISelectionScreen switches to the dual AI selection screen
func (*UI) SwitchToHomeScreen ¶
func (s *UI) SwitchToHomeScreen()
SwitchToHomeScreen switches to the home screen