component

package
v0.0.0-...-7fee067 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinate

type Coordinate struct {
	// x and y represents coordinates on the screen
	X float64
	Y float64
}

func (Coordinate) Add

func (c Coordinate) Add(other Coordinate) Coordinate

func (Coordinate) GetDirection

func (c Coordinate) GetDirection(other Coordinate) float64

func (Coordinate) GetDistance

func (c Coordinate) GetDistance(other Coordinate) float64

func (*Coordinate) SetCoordinate

func (c *Coordinate) SetCoordinate(newCoord Coordinate)

func (Coordinate) String

func (c Coordinate) String() string

func (Coordinate) Subtract

func (c Coordinate) Subtract(other Coordinate) Coordinate

func (Coordinate) TranslateXY

func (c Coordinate) TranslateXY(offset Coordinate, pixelSize float64) (float64, float64)

type PixelSize

type PixelSize float64

type Position

type Position struct {
	X, Y float64
}

type Rotation

type Rotation float64

func (Rotation) Cos

func (r Rotation) Cos() float64

func (Rotation) Rad

func (r Rotation) Rad() float64

func (Rotation) Sin

func (r Rotation) Sin() float64

type Size

type Size struct {
	Width, Height float64
}

type UUID

type UUID uuid.UUID

func NewUUID

func NewUUID() UUID

type Velocity

type Velocity struct {
	VX float64
	VY float64
}

func (*Velocity) ClampVelocity

func (v *Velocity) ClampVelocity(limit float64)

func (*Velocity) DiminishVelocity

func (v *Velocity) DiminishVelocity(friction float64)

type Width

type Width float64

Jump to

Keyboard shortcuts

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