components

package
v0.0.0-...-f4671c2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const GridCellHeight = 32
View Source
const GridCellWidth = 32

Variables

This section is empty.

Functions

func HasOverlap

func HasOverlap(aPos *Position, aHitbox *Hitbox, bPos *Position, bHitbox *Hitbox) bool

Types

type Camera

type Camera struct{}

type Gravity

type Gravity struct {
	Acceleration     float64
	TerminalVelocity float64
}

func NewGravity

func NewGravity() Gravity

type Hitbox

type Hitbox struct {
	Width  float64
	Height float64

	AllowJumpThrough bool
	AllowFallThrough bool
}

type Position

type Position struct {
	X float64
	Y float64

	CellX int
	CellY int
}

func NewGridPosition

func NewGridPosition(x, y int, cellX, cellY int) Position

type Sprite

type Sprite struct {
	Image image.Image
	Layer SpriteLayer

	FlipX bool
}

func NewPlaceholderSprite

func NewPlaceholderSprite(width, height int, layer SpriteLayer, label string, colour color.Color) Sprite

type SpriteLayer

type SpriteLayer int
const (
	SpriteLayerBackground SpriteLayer = iota
	SpriteLayerForeground
)

type Velocity

type Velocity struct {
	X float64
	Y float64

	OnGround bool
}

Jump to

Keyboard shortcuts

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