Documentation ¶
Overview ¶
Package engine provides function for render and world object manipulations
Index ¶
Constants ¶
const ( CenterAlign = iota TopAlign BottomAlign )
Sprite alignment
Variables ¶
var Map [][]int
Map structure
var Sprites []*Sprite
Sprites information
var TileTextures = map[int][][]uint32{}
TileTextures - Texture sets for tile values
var TimeElapsed float64
TimeElapsed is elapsed time in seconds since previous frame. Could be used to stabilize time-dependent operations like moving or animations
Functions ¶
func IntersectsWithMap ¶
IntersectsWithMap returns intersect status and tile value
func StrafePlayerH ¶
func StrafePlayerH(dDist float64)
StrafePlayerH moves player horizontally (left, right) by a given dist (related to it's angle)
func StrafePlayerV ¶
func StrafePlayerV(dDist float64)
StrafePlayerV moves player vertically (forward, backward) by a given dist (related to it's angle)
func TurnPlayer ¶
func TurnPlayer(dAngle float64)
TurnPlayer turns player around by a given angle (minus is left, plus is right)
Types ¶
type Camera ¶
func (*Camera) StrafePlayerH ¶
StrafePlayerH moves player horizontally (left, right) by a given dist (related to it's angle)
func (*Camera) StrafePlayerV ¶
StrafePlayerV moves player vertically (forward, backward) by a given dist (related to it's angle)
func (*Camera) TurnPlayer ¶
TurnPlayer turns player around by a given angle (minus is left, plus is right)
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader is used to initialize game objects and scenes
func (Loader) ConvertImageToTexture ¶
ConvertImageToTexture converts actual image file to engine texture object
type Vector ¶
type Vector struct {
X, Y float64
}
Vector represents 2d vector
func (*Vector) NewFromAngle ¶
NewFromAngle returns a unit vector for a given angle (relative to positive X-axis)
func (*Vector) NewRotated ¶
NewRotated creates a new rotated vector