game

package
v0.0.0-...-095eb94 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bus

type Bus struct {
	Start []string
	Backs []pb.Poker
	My    []pb.Poker
	Your  []pb.Poker
	// contains filtered or unexported fields
}

func NewBus

func NewBus() *Bus

func (*Bus) Close

func (p *Bus) Close()

func (*Bus) Keys

func (p *Bus) Keys() map[ebiten.Key]func()

func (*Bus) Layout

func (p *Bus) Layout() (int, int)

func (*Bus) Pop

func (p *Bus) Pop(scene pb.Scene)

func (*Bus) Read

func (p *Bus) Read(msg *pb.Msg)

func (*Bus) Scene

func (p *Bus) Scene() pb.Scene

func (*Bus) Scenes

func (p *Bus) Scenes() []pb.Scene

func (*Bus) SetReader

func (p *Bus) SetReader(reader nets.Reader)

func (*Bus) To

func (p *Bus) To(scene pb.Scene)

type DesktopScene

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

func NewDesktop

func NewDesktop(bus *Bus, script *Script) *DesktopScene

func (*DesktopScene) Draw

func (p *DesktopScene) Draw(screen *ebiten.Image)

func (*DesktopScene) Keys

func (p *DesktopScene) Keys() map[ebiten.Key]func()

func (*DesktopScene) Update

func (p *DesktopScene) Update() error

type HelpScene

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

func NewHelp

func NewHelp(bus *Bus) *HelpScene

nolint: gomnd

func (*HelpScene) Draw

func (p *HelpScene) Draw(screen *ebiten.Image)

func (*HelpScene) Keys

func (p *HelpScene) Keys() map[ebiten.Key]func()

func (*HelpScene) Update

func (p *HelpScene) Update() error

type Image

type Image struct {
	Poker pb.Poker
	X     float64
	Y     float64
}

type List

type List struct {
	Back bool
	// contains filtered or unexported fields
}

func NewList

func NewList(left, top, width, height int) *List

func (*List) Click

func (p *List) Click(pox, poy int, pokers []pb.Poker) pb.Poker

func (*List) Images

func (p *List) Images(pokers []pb.Poker) []*Image

type Poker

type Poker struct {
	Bus *Bus
	// contains filtered or unexported fields
}

func NewPoker

func NewPoker(bus *Bus, script *Script, start *StartScene, desktop *DesktopScene, help *HelpScene) *Poker

func (*Poker) Draw

func (p *Poker) Draw(screen *ebiten.Image)

func (*Poker) Layout

func (p *Poker) Layout(_, _ int) (int, int)

func (*Poker) Update

func (p *Poker) Update() error

type Scene

type Scene interface {
	Update() error
	Draw(*ebiten.Image)
	Keys() map[ebiten.Key]func()
}

type Script

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

func NewScript

func NewScript(bus *Bus) *Script

func (*Script) Read

func (p *Script) Read(msg *pb.Msg)

nolint: cyclop

func (*Script) Take

func (p *Script) Take(poker pb.Poker)

type StartScene

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

func NewStart

func NewStart(bus *Bus) *StartScene

nolint: gomnd

func (*StartScene) Draw

func (p *StartScene) Draw(screen *ebiten.Image)

func (*StartScene) Keys

func (p *StartScene) Keys() map[ebiten.Key]func()

func (*StartScene) Update

func (p *StartScene) Update() error

Jump to

Keyboard shortcuts

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