game

package
v0.0.0-...-b739bb2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 8 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(pos Vector, rotation float64) *Bullet

func (*Bullet) Collider

func (b *Bullet) Collider() Rect

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) AddBullet

func (g *Game) AddBullet(b *Bullet)

func (*Game) Draw

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

func (*Game) Layout

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

func (*Game) Reset

func (g *Game) Reset()

func (*Game) Update

func (g *Game) Update() error

type Meteor

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

func NewMeteor

func NewMeteor(baseVelocity float64) *Meteor

func (*Meteor) Collider

func (m *Meteor) Collider() Rect

func (*Meteor) Draw

func (m *Meteor) Draw(screen *ebiten.Image)

func (*Meteor) Update

func (m *Meteor) Update()

type Player

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

func NewPlayer

func NewPlayer(game *Game) *Player

func (*Player) Collider

func (p *Player) Collider() Rect

func (*Player) Draw

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

func (*Player) Update

func (p *Player) Update()

type Rect

type Rect struct {
	X      float64
	Y      float64
	Width  float64
	Height float64
}

func NewRect

func NewRect(x, y, width, height float64) Rect

func (Rect) Intersects

func (r Rect) Intersects(other Rect) bool

func (Rect) MaxX

func (r Rect) MaxX() float64

func (Rect) MaxY

func (r Rect) MaxY() float64

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
}

func (Vector) Normalize

func (v Vector) Normalize() Vector

Jump to

Keyboard shortcuts

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