game

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: AGPL-3.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultServerAddress = "tcp://bgammon.org:1337"
	OptimizeDraw         = true
	OptimizeSetRect      = true
	AutoEnableTouchInput = false
	ShowServerSettings   = false
	APPNAME              = "boxcars"
)
View Source
const MaxDebug = 1

Variables

View Source
var (
	SoundDie1, SoundDie2, SoundDie3                []byte
	SoundDice1, SoundDice2, SoundDice3, SoundDice4 []byte
	SoundMove1, SoundMove2, SoundMove3             []byte
	SoundJoinLeave                                 []byte
	SoundSay                                       []byte
)
View Source
var (
	Debug int
)

Functions

func LoadBytes added in v1.0.5

func LoadBytes(p string) []byte

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

Types

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 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 Game

type Game struct {
	ServerAddress string
	Username      string
	Password      string

	Watch bool
	TV    bool

	Client *Client

	Board *board

	TouchInput bool
	// contains filtered or unexported fields
}

func NewGame

func NewGame() *Game

func (*Game) Connect

func (g *Game) Connect()

func (*Game) Draw

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

func (*Game) EnableTouchInput added in v1.0.8

func (g *Game) EnableTouchInput()

func (*Game) Exit

func (g *Game) Exit()

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