game

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Game

type Game struct {
	Players []component.Player
	Winner  int
}

func NewGame

func NewGame() (*Game, error)

func (*Game) AdvanceFrame

func (g *Game) AdvanceFrame(inputs []InputBits, disconnectFlags int)

func (*Game) Checksum

func (g *Game) Checksum() int

func (*Game) Draw

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

func (*Game) Exit

func (g *Game) Exit()

func (*Game) InitNetworking

func (g *Game) InitNetworking(localPort int, numPlayers int, players []ggpo.Player, numSpectators int)

func (*Game) Layout

func (g *Game) Layout(_, _ int) (screenWidth, screenHeight int)

func (*Game) ReadInputsP1

func (g *Game) ReadInputsP1() InputBits

func (*Game) ReadInputsP2

func (g *Game) ReadInputsP2() InputBits

func (*Game) RunFrame

func (g *Game) RunFrame()

func (*Game) RunHeadless

func (g *Game) RunHeadless() error

RunHeadless runs the game without using the display. Game.Draw is never called.

func (*Game) RunLocalFrame

func (g *Game) RunLocalFrame()

func (*Game) String

func (g *Game) String() string

func (*Game) Update

func (g *Game) Update() error

func (*Game) UpdateByInputs

func (g *Game) UpdateByInputs(inputs []InputBits)

type GameSession

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

func NewGameSession

func NewGameSession() *GameSession

func (*GameSession) AdvanceFrame

func (g *GameSession) AdvanceFrame(flags int)

func (*GameSession) LoadGameState

func (g *GameSession) LoadGameState(stateID int)

func (*GameSession) LogGameState

func (g *GameSession) LogGameState(fileName string, buffer []byte, len int)

func (*GameSession) OnEvent

func (g *GameSession) OnEvent(info *ggpo.Event)

func (*GameSession) SaveGameState

func (g *GameSession) SaveGameState(stateID int) int

func (*GameSession) SetBackend

func (g *GameSession) SetBackend(backend ggpo.Backend)

type Input

type Input struct {
	ButtonMap int
}

func NewInput

func NewInput() Input

func (Input) String

func (i Input) String() string

type InputBits

type InputBits int

type InputButton

type InputButton int
const (
	ButtonLeft InputButton = iota + 1
	ButtonRight
	ButtonDown
	ButtonUp
	ButtonPunch
	ButtonKick
	ButtonBlock
	ButtonTaunt
	ButtonStart
)

Jump to

Keyboard shortcuts

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