game

package
v0.0.0-...-22d1e04 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeTitle modeType = 1 << iota // 0x01
	ModeGame                       // 0x02
	ModeOver  modeType = 255       // 0xff
)

Variables

View Source
var (
	Score int
)

Functions

This section is empty.

Types

type Game

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

Game implements ebiten.Game interface.

var WolfpackApp *Game

func NewGame

func NewGame() *Game

NewGame creates a single instance of the game

func (*Game) Draw

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

Draw draws the game screen. Draw is called every frame (typically 1/60[s] for 60Hz display).

func (*Game) Layout

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

Layout takes the outside size (e.g., the window size) and returns the (logical) screen size. If you don't have to adjust the screen size with the outside size, just return a fixed size.

func (*Game) Update

func (g *Game) Update() error

Update proceeds the game state. Update is called every tick (1/60 [s] by default).

Jump to

Keyboard shortcuts

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