game

package
v0.0.0-...-b36fbdc Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CanvasWidth  = 800
	CanvasHeight = 800
)
View Source
const (
	StateNormal = iota
	StateGameOver
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity interface {
	Draw(ctx js.Value)
	Update(mouseX int, mouseY int, mpf float64)
}

type Game

type Game struct {
	WindowWidth  int
	WindowHeight int

	Entities *[]Entity
	State    int

	Score int
	// contains filtered or unexported fields
}

func NewGame

func NewGame() Game

func (*Game) RunMainLoop

func (g *Game) RunMainLoop()

func (*Game) SetRestartFunc

func (g *Game) SetRestartFunc(function func())

Jump to

Keyboard shortcuts

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