game

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: AGPL-3.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxDebug             = 2
	DefaultServerAddress = "wss://ws.bgammon.org"
)
View Source
const (
	AppName            = "boxcars"
	ShowServerSettings = false
)

Variables

View Source
var (
	SoundDie1, SoundDie2, SoundDie3                []byte
	SoundDice1, SoundDice2, SoundDice3, SoundDice4 []byte
	SoundMove1, SoundMove2, SoundMove3             []byte
	SoundJoinLeave                                 []byte
	SoundSay                                       []byte
)
View Source
var AppLanguage = "en"
View Source
var AutoEnableTouchInput bool
View Source
var (
	Debug int8
)

Functions

func DefaultLocale added in v1.1.1

func DefaultLocale() string

func LoadBytes added in v1.0.5

func LoadBytes(p string) []byte

func LoadLocale added in v1.1.1

func LoadLocale(forceLanguage *language.Tag) error

func LoadOGG added in v1.0.5

func LoadOGG(context *audio.Context, p string) *audio.Player

func LoadWAV added in v1.0.5

func LoadWAV(context *audio.Context, p string) *audio.Player

func NewBoard

func NewBoard() *board

func NewLobby

func NewLobby() *lobby

func NewTutorialWidget added in v1.2.1

func NewTutorialWidget() *tutorialWidget

func ReplayDir added in v1.2.1

func ReplayDir() string

func TabulaBoard added in v1.3.4

func TabulaBoard(g *bgammon.Game, b []int8) tabula.Board

Types

type BoardDraggedWidget added in v1.3.4

type BoardDraggedWidget struct {
	*etk.Box
}

func NewBoardDraggedWidget added in v1.3.4

func NewBoardDraggedWidget() *BoardDraggedWidget

func (*BoardDraggedWidget) Draw added in v1.3.4

func (w *BoardDraggedWidget) Draw(screen *ebiten.Image) error

type BoardMovingWidget added in v1.3.4

type BoardMovingWidget struct {
	*etk.Box
}

func NewBoardMovingWidget added in v1.3.4

func NewBoardMovingWidget() *BoardMovingWidget

func (*BoardMovingWidget) Draw added in v1.3.4

func (w *BoardMovingWidget) Draw(screen *ebiten.Image) error

type BoardWidget added in v1.1.0

type BoardWidget struct {
	*etk.Box
}

func NewBoardWidget added in v1.1.0

func NewBoardWidget() *BoardWidget

func (*BoardWidget) HandleMouse added in v1.1.0

func (bw *BoardWidget) HandleMouse(cursor image.Point, pressed bool, clicked bool) (handled bool, err error)

type ClickableText added in v1.1.2

type ClickableText struct {
	*etk.Text
	// contains filtered or unexported fields
}

func (*ClickableText) HandleMouse added in v1.1.2

func (t *ClickableText) HandleMouse(cursor image.Point, pressed bool, clicked bool) (handled bool, err error)

type Client

type Client struct {
	Address  string
	Username string
	Password string
	Events   chan interface{}
	Out      chan []byte
	// contains filtered or unexported fields
}

func (*Client) Connect

func (c *Client) Connect()

func (*Client) LoggedIn

func (c *Client) LoggedIn() bool

type DieButton added in v1.1.5

type DieButton struct {
	*etk.Button
	Value int8
}

func NewDieButton added in v1.1.5

func NewDieButton(value int8, onSelected func() error) *DieButton

func (*DieButton) Draw added in v1.1.5

func (b *DieButton) Draw(screen *ebiten.Image) error

type Game

type Game struct {
	ServerAddress string
	Email         string
	Username      string
	Password      string

	TV bool

	Client *Client

	Board *board

	LoadReplay []byte

	*sync.Mutex
	// contains filtered or unexported fields
}

func NewGame

func NewGame() *Game

func (*Game) Connect

func (g *Game) Connect()

func (*Game) ConnectLocal added in v1.1.6

func (g *Game) ConnectLocal(conn net.Conn)

func (*Game) Draw

func (g *Game) Draw(screen *ebiten.Image)

func (*Game) Exit

func (g *Game) Exit()

func (*Game) HandleReplay added in v1.2.0

func (g *Game) HandleReplay(replay []byte)

func (*Game) Layout

func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int)

func (*Game) Update

func (g *Game) Update() error

Update is called by Ebitengine only when user input occurs, or a frame is explicitly scheduled.

type Label added in v1.0.8

type Label struct {
	*etk.Text
	// contains filtered or unexported fields
}

func NewLabel added in v1.0.8

func NewLabel(c color.RGBA) *Label

func (*Label) Draw added in v1.0.8

func (l *Label) Draw(screen *ebiten.Image) error

func (*Label) SetActive added in v1.0.8

func (l *Label) SetActive(active bool)

func (*Label) SetRect added in v1.0.8

func (l *Label) SetRect(r image.Rectangle)

func (*Label) SetText added in v1.0.8

func (l *Label) SetText(t string)

type SoundEffect added in v1.0.5

type SoundEffect int

type Sprite

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

type Sprites

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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