game

package
v0.0.0-...-219ab8e Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAuthServerURL = "http://localhost:8080"
	DefaultAPIServerURL  = "http://localhost:9090"
)
View Source
const (
	DefaultScreenWidth  = 640
	DefaultScreenHeight = 480
)

Variables

This section is empty.

Functions

func NewGame

func NewGame(opts NewGameOptions) (ebiten.Game, error)

Types

type Game

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

Game implements ebiten.Game interface, which has Update, Draw and Layout methods.

func (*Game) Draw

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

func (*Game) Layout

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

func (*Game) SetScene

func (g *Game) SetScene(scene scenes.Scene) error

func (*Game) Update

func (g *Game) Update() error

type GameAPI

type GameAPI struct {
	URL string
}

type GameAuth

type GameAuth struct {
	URL          string
	Email        string
	Password     string
	IDToken      string
	IDTokenExp   time.Time
	RefreshToken string
}

type GameAutomation

type GameAutomation struct {
	Email    string
	Password string
}

type GameMode

type GameMode int
const (
	GameModeAuth GameMode = iota
	GameModePlay
	GameModeOver
	GameModeNetworkError
)

func (GameMode) String

func (m GameMode) String() string

type NewGameOptions

type NewGameOptions struct {
	Debug          bool
	AuthURL        string
	APIURL         string
	NetworkManager *network.NetworkManager
	GameAutomation *GameAutomation
}

Jump to

Keyboard shortcuts

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