entity

package
v0.0.0-...-ef779ba Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollisionDetected

func CollisionDetected(a Collider, b Collider) bool

func NewAsteroidBelt

func NewAsteroidBelt(n int, seq *internal.Sequence, player *Player, screenBounds *geometry.Dimension) map[int]*Asteroid

Types

type Alien

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

func NewAlien

func NewAlien(level int, position *geometry.Vector, playerPosition func() *geometry.Vector, screenBounds *geometry.Dimension) *Alien

func (*Alien) Bullets

func (a *Alien) Bullets(callback func(bullet *Bullet))

func (*Alien) Draw

func (a *Alien) Draw(screen *ebiten.Image)

func (*Alien) HandleMovement

func (a *Alien) HandleMovement()

func (*Alien) HandleShooting

func (a *Alien) HandleShooting()

func (*Alien) IsAlive

func (a *Alien) IsAlive() bool

func (*Alien) IsDying

func (a *Alien) IsDying() bool

func (*Alien) Kill

func (a *Alien) Kill()

func (*Alien) Position

func (a *Alien) Position() *geometry.Vector

func (*Alien) ShootingJitter

func (a *Alien) ShootingJitter() float64

func (*Alien) Size

func (a *Alien) Size() float64

func (*Alien) SpinOutOfControl

func (a *Alien) SpinOutOfControl()

func (*Alien) Update

func (a *Alien) Update() error

func (*Alien) Value

func (a *Alien) Value() int

type Asteroid

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

func NewAsteroid

func NewAsteroid(size int, position *geometry.Vector, screenBounds *geometry.Dimension) *Asteroid

func (*Asteroid) Draw

func (a *Asteroid) Draw(screen *ebiten.Image)

func (*Asteroid) Explode

func (a *Asteroid) Explode() []*Asteroid

func (*Asteroid) IsExploded

func (a *Asteroid) IsExploded() bool

func (*Asteroid) Position

func (a *Asteroid) Position() *geometry.Vector

func (*Asteroid) Size

func (a *Asteroid) Size() float64

func (*Asteroid) Update

func (a *Asteroid) Update() error

func (*Asteroid) Value

func (a *Asteroid) Value() int

type Bullet

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

func NewBullet

func NewBullet(screenBounds *geometry.Dimension, position *geometry.Vector, direction float64, size int) *Bullet

func (*Bullet) CollisionDetected

func (b *Bullet) CollisionDetected(collider Collider) bool

func (*Bullet) Draw

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

func (*Bullet) IsExpired

func (b *Bullet) IsExpired() bool

func (*Bullet) Position

func (b *Bullet) Position() *geometry.Vector

func (*Bullet) Size

func (b *Bullet) Size() float64

func (*Bullet) Update

func (b *Bullet) Update() error

type Collider

type Collider interface {
	Position() *geometry.Vector
	Size() float64
}

type Level

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

func NewLevel

func NewLevel(screenBounds *geometry.Dimension) *Level

func (*Level) Current

func (l *Level) Current() int

func (*Level) Draw

func (l *Level) Draw(screen *ebiten.Image)

func (*Level) IsExpired

func (l *Level) IsExpired() bool

func (*Level) Next

func (l *Level) Next()

func (*Level) Reset

func (l *Level) Reset(level int)

func (*Level) Update

func (l *Level) Update() error

type Player

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

func NewPlayer

func NewPlayer(screenBounds *geometry.Dimension) *Player

func (*Player) Bullets

func (p *Player) Bullets(callback func(bullet *Bullet))

func (*Player) CannotDie

func (p *Player) CannotDie() bool

func (*Player) Draw

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

func (*Player) HandleMovement

func (p *Player) HandleMovement()

func (*Player) HandleShooting

func (p *Player) HandleShooting()

func (*Player) IsAlive

func (p *Player) IsAlive() bool

func (*Player) IsDying

func (p *Player) IsDying() bool

func (*Player) Kill

func (p *Player) Kill()

func (*Player) NotNear

func (p *Player) NotNear() *geometry.Vector

func (*Player) Position

func (p *Player) Position() *geometry.Vector

func (*Player) Prepare

func (p *Player) Prepare()

func (*Player) ShootingJitter

func (p *Player) ShootingJitter() float64

func (*Player) Size

func (p *Player) Size() float64

func (*Player) SpinOutOfControl

func (p *Player) SpinOutOfControl()

func (*Player) ToggleGodMode

func (p *Player) ToggleGodMode()

func (*Player) Update

func (p *Player) Update() error

func (*Player) UpdateScore

func (p *Player) UpdateScore(value int)

Jump to

Keyboard shortcuts

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