game

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2025 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SoundSelect soundEffect = iota
	SoundFire
	SoundHit
	SoundDestroy
)
View Source
const (
	InputLeftForward bitfield = 1 << iota
	InputLeftBackward
	InputRightForward
	InputRightBackward
	InputTurretLeft
	InputTurretRight
	InputFire
)
View Source
const (
	ObjectTree objectType = iota
	ObjectTreeDestroyed
	ObjectSnowman
	ObjectSnowmanDestroyed
	ObjectHouse
)
View Source
const (
	SnowSize = 1024
)

Variables

View Source
var (
	TreadMarkImage = ebiten.NewImage(3, 3)
	RoundImage     = ebiten.NewImage(4, 4)
	IndicatorImage = ebiten.NewImage(75, 75)

	CooldownImage = ebiten.NewImage(cooldownWidth, cooldownHeight)
	ObjectImages  = make([]*ebiten.Image, len(objectNames))
)
View Source
var SnowImage = loadImage("asset/image/snow.png")
View Source
var (
	Sounds [][]byte
)

Functions

func LoadBytes

func LoadBytes(p string) []byte

Types

type Game

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

func NewGame

func NewGame(allTanks bool, godMode bool, debug int) *Game

func (*Game) Draw

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

func (*Game) Layout

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

func (*Game) Update

func (g *Game) Update() error

type Simulation

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

func NewSimulation

func NewSimulation(seed int64, allTanks bool, godMode bool) *Simulation

func (*Simulation) AddPlayer

func (s *Simulation) AddPlayer(player int, team int, state *playerState) error

func (*Simulation) Clear

func (s *Simulation) Clear(frame int) error

func (*Simulation) Rewind

func (s *Simulation) Rewind(frame int) error

func (*Simulation) SetInput

func (s *Simulation) SetInput(player int, input bitfield) error

func (*Simulation) State

func (s *Simulation) State() (map[int]*playerState, []*roundState, map[int]int, []*objectState)

func (*Simulation) Tick

func (s *Simulation) Tick() error

Jump to

Keyboard shortcuts

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