Documentation
¶
Index ¶
- Variables
- type AAB
- type Circle
- type Direction
- type Polygon
- type Position
- type PreviousPosition
- type Rotation
- type Scale
- type Shape
- func NewDoubleRamp(width, height float64, topWidthRatio float64) Shape
- func NewPolygon(localVertices []vector.Two) Shape
- func NewRectangle(width, height float64) Shape
- func NewSingleRamp(width, height float64, leftToRight bool) Shape
- func NewTrapezoidPlatform(width, height float64, slopeRatio float64) Shape
- func NewTriangularPlatform(width, height float64) Shape
- type Skin
Constants ¶
This section is empty.
Variables ¶
var Components = components{ Position: warehouse.FactoryNewComponent[Position](), PreviousPosition: warehouse.FactoryNewComponent[Position](), Rotation: warehouse.FactoryNewComponent[Rotation](), Scale: warehouse.FactoryNewComponent[Scale](), Shape: warehouse.FactoryNewComponent[Shape](), Direction: warehouse.FactoryNewComponent[Direction](), }
Functions ¶
This section is empty.
Types ¶
type Direction ¶
type Direction struct {
// contains filtered or unexported fields
}
func NewDirectionLeft ¶
func NewDirectionLeft() Direction
func NewDirectionRight ¶
func NewDirectionRight() Direction
type Position ¶
Position represents a 2D point in space
func NewPosition ¶
NewPosition creates a new Position at the specified coordinates
type PreviousPosition ¶
PreviousPosition stores the previous position for continuous collision detection
type Rotation ¶
type Rotation float64
Rotation represents an angle in radians
type Shape ¶
Shape represents a geometric shape with local and world bounds, polygon definition, and skin
func NewDoubleRamp ¶
NewDoubleRamp creates a two-sided ramp (trapezoid with slopes on both sides) width: total width of the ramp height: height of the ramp topWidthRatio: width of the flat section on top (as a ratio of total width, 0-1) Note: In this engine, lower Y values are higher in the world (y=0 is top of screen)
func NewPolygon ¶
NewPolygon creates a new shape from a set of local vertices
func NewRectangle ¶
NewRectangle creates a rectangular shape with specified width and height
func NewSingleRamp ¶
NewSingleRamp creates a triangular ramp shape with specified dimensions When leftToRight is true, the ramp ascends from left to right
func NewTrapezoidPlatform ¶
NewTrapezoidPlatform creates a trapezoid shape with a flat top of the specified width, angled sides, and a narrower bottom. The slopeRatio controls how much narrower the bottom is This is useful for creating one-way platforms with more gradual angled sides
func NewTriangularPlatform ¶
NewTriangularPlatform creates a triangular shape with a flat top of the specified width and angled sides meeting at a point at the specified height below the top This is useful for one-way platforms where you want to prevent side collisions