game

package
v0.0.0-...-526c457 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigVersion = 0
View Source
const VersionString = "0.0.1"

Variables

View Source
var Authors = []string{
	"Andreas T Jonsson",
}

Functions

func Start

func Start(cfg *Config, arch *resource.Archive)

Types

type Config

type Config struct {
	ConfigVersion int
	Fullscreen,
	Widescreen,
	WC2Input bool

	Debug struct {
		Race,
		Map string
	}
}

type Game

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

func NewGame

func NewGame(cfg *Config, rend platform.Renderer, player platform.AudioPlayer, res resource.Resources) (*Game, error)

func (*Game) PollAll

func (g *Game) PollAll()

func (*Game) PollEvent

func (g *Game) PollEvent() platform.Event

func (*Game) Render

func (g *Game) Render() error

func (*Game) Running

func (g *Game) Running() bool

func (*Game) Shutdown

func (g *Game) Shutdown()

func (*Game) SwitchState

func (g *Game) SwitchState(to string, args ...interface{}) error

func (*Game) Update

func (g *Game) Update() error

type GameState

type GameState interface {
	Name() string
	Enter(from GameState, args ...interface{}) error
	Exit(to GameState) error
	Update() error
	Render() error
}

func NewMenuState

func NewMenuState(g *Game) GameState

func NewPlayState

func NewPlayState(g *Game) GameState

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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