types

package
v0.0.0-...-5353c27 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canvas

type Canvas struct {
	Pos    Vector
	Center Vector
	Width  float64
	Height float64
	Color  color.Color
	Image  *ebiten.Image
	Screen *ebiten.Image
}

func NewCanvas

func NewCanvas(originPoint Vector, canvasWidth, canvasHeight float64) Canvas

func (*Canvas) Draw

func (c *Canvas) Draw(screen *ebiten.Image)

func (*Canvas) Fill

func (c *Canvas) Fill()

type Line

type Line struct {
	Start, End Vector
}

type Object

type Object struct {
	Pos, Dir Vector
	Velocity float64
	Image    *ebiten.Image
	Canvas   *Canvas
}

type Vector

type Vector struct {
	X, Y float64
}

func Intersect

func Intersect(line1, line2 Line) (Vector, error)

func (*Vector) Add

func (v *Vector) Add(other Vector)

func (*Vector) InvertX

func (v *Vector) InvertX()

func (*Vector) InvertY

func (v *Vector) InvertY()

func (*Vector) Multiply

func (v *Vector) Multiply(scalar float64)

func (*Vector) Norm

func (v *Vector) Norm() float64

func (*Vector) Normalize

func (v *Vector) Normalize()

func (*Vector) Randomize

func (v *Vector) Randomize()

Jump to

Keyboard shortcuts

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