graphics

package
v0.0.0-...-01660b7 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawNumber

func DrawNumber(bg *ebiten.Image, x, y, width float64, n int)

func Intersect

func Intersect(s *Sphere, e *Explosion) bool

Return true if a speger and explosion touch

Types

type Explosion

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

Our main object-popping entity

func NewExplosion

func NewExplosion(x, y int) *Explosion

Create a new explosion in a specific location. It will have a slightly randomised maximum radius.

func (*Explosion) Done

func (e *Explosion) Done() bool

Is the explosion done?

func (*Explosion) Draw

func (e *Explosion) Draw(t *ebiten.Image)

Draw an explosion on the screen

func (*Explosion) Step

func (e *Explosion) Step(w, h float64)

Increase an explosion

type Sphere

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

Basic game object, will essentially render as just a circle

func NewSphere

func NewSphere(w, h float64) *Sphere

Create a new sphere, in a random place, with random colours and a random direction of movement.

func TestSphere

func TestSphere(w, h float64, ix int) *Sphere

Create a test sphere

func (*Sphere) Draw

func (s *Sphere) Draw(t *ebiten.Image)

Render a sphere onto the game display

func (*Sphere) Explode

func (s *Sphere) Explode() *Explosion

Turn a sphere into an explosion.

func (*Sphere) Step

func (s *Sphere) Step(w, h float64)

Advance a sphere one step, bouncing against the borders if necessary.

Jump to

Keyboard shortcuts

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