game

package
v0.0.0-...-1151b5d Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bullet

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

func NewBullet

func NewBullet(sprite *ebiten.Image, pos Vector, rotation, speed float64) *Bullet

func (*Bullet) Draw

func (b *Bullet) Draw(screen *ebiten.Image)

func (*Bullet) Update

func (b *Bullet) Update()

type Game

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

func NewGame

func NewGame() *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 Player

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

func NewPlayer

func NewPlayer(game *Game) *Player

func (*Player) Draw

func (p *Player) Draw(screen *ebiten.Image)

func (*Player) Update

func (p *Player) Update()

type Playfield

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

func NewPlayfield

func NewPlayfield(game *Game) *Playfield

func (*Playfield) Draw

func (p *Playfield) Draw(screen *ebiten.Image)

func (*Playfield) Update

func (p *Playfield) Update()

type Tank

type Tank struct {
	BodySprite   *ebiten.Image
	BarrelSprite *ebiten.Image
}

func NewTank

func NewTank(game *Game, bodySprite, barrelSprite *ebiten.Image) *Tank

func (*Tank) Draw

func (p *Tank) Draw(screen *ebiten.Image, pos Vector, rotation float64)

type Tile

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

type Timer

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

func NewTimer

func NewTimer(d time.Duration) *Timer

func (*Timer) IsReady

func (t *Timer) IsReady() bool

func (*Timer) Reset

func (t *Timer) Reset()

func (*Timer) Update

func (t *Timer) Update()

type Vector

type Vector struct {
	X float64
	Y float64
}

Jump to

Keyboard shortcuts

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