game

package
v0.0.0-...-c67ce8d Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2017 License: GPL-3.0 Imports: 5 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 {
	// contains filtered or unexported fields
}

func NewGame

func NewGame(states map[string]GameState) (*Game, error)

func (*Game) CurrentStateName

func (g *Game) CurrentStateName() string

func (*Game) PollAll

func (g *Game) PollAll()

func (*Game) PollEvent

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

func (*Game) Render

func (g *Game) Render(backBuffer draw.Image) 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) Terminate

func (g *Game) Terminate()

func (*Game) Timing

func (g *Game) Timing() (time.Duration, time.Duration, int)

func (*Game) Update

func (g *Game) Update() error

type GameControl

type GameControl interface {
	SwitchState(to string, args ...interface{}) error
	CurrentStateName() string
	Timing() (time.Duration, time.Duration, int)
	PollAll()
	PollEvent() platform.Event
	Terminate()
}

type GameState

type GameState interface {
	Name() string
	Enter(from GameState, args ...interface{}) error
	Exit(to GameState) error
	Update(gctl GameControl) error
	Render(backBuffer draw.Image) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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