Documentation
¶
Index ¶
Constants ¶
View Source
const ( CollisionWorld common.CollisionGroup = 1 << iota CollisionPlayer CollisionEntity )
Variables ¶
View Source
var CharacterAnimations = []*common.Animation{ {Name: action.AnimationMoveUp, Frames: []int{9, 10, 11}, Loop: true}, {Name: action.AnimationMoveDown, Frames: []int{0, 1, 2}, Loop: true}, {Name: action.AnimationMoveLeft, Frames: []int{3, 4, 5}, Loop: true}, {Name: action.AnimationMoveRight, Frames: []int{6, 7, 8}, Loop: true}, {Name: action.AnimationStopUp, Frames: []int{10}, Loop: true}, {Name: action.AnimationStopDown, Frames: []int{1}, Loop: true}, {Name: action.AnimationStopLeft, Frames: []int{4}, Loop: true}, {Name: action.AnimationStopRight, Frames: []int{7}, Loop: true}, }
CharacterAnimations delcares default Character Animations.
Functions ¶
This section is empty.
Types ¶
type Character ¶ added in v0.5.0
type Character struct {
ecs.BasicEntity
common.AnimationComponent
common.CollisionComponent
common.RenderComponent
common.SpaceComponent
action.ActionComponent
control.ControlComponent
speed.SpeedComponent
}
Character entity is a game character.
func NewCharacter ¶ added in v0.5.0
func NewCharacter(o NewCharacterOptions) (p *Character, err error)
NewCharacter constructs a new Character entity and returns it along with any errors encountered.
type NewCharacterOptions ¶ added in v0.5.0
type NewCharacterOptions struct {
Position engo.Point
SpritesheetURL string
CellWidth, CellHeight int
CollisionGroup common.CollisionGroup
AnimationRate float32
StartZIndex float32
}
NewCharacterOptions provides control options when calling NewCharacter.
type Object ¶
type Object struct {
ecs.BasicEntity
common.CollisionComponent
common.SpaceComponent
}
An Object within the game world.
type Shadow ¶ added in v0.5.0
type Shadow struct {
ecs.BasicEntity
common.RenderComponent
common.SpaceFace
}
Shadow entity is an entity shadow.
func NewCharacterShadow ¶ added in v0.5.0
type Tile ¶
type Tile struct {
ecs.BasicEntity
common.AnimationComponent
common.RenderComponent
common.SpaceComponent
}
A Tile entity stores the contents of a single tile of the game map.
type Tilemap ¶
type Tilemap struct {
Level *common.Level
// Tiles contains all tiles from the map.
Tiles []*Tile
// Objects contains all objects from the map.
Objects []*Object
// Points contains objects of type Point.
Points map[string]*Object
// Spawns contains objects of type Spawn.
Spawns map[string]*Object
}
A Tilemap entity stores the data for a single Tiled map.
func NewTilemap ¶
NewTilemap constructs a new Tilemap from the provided file url.
func (Tilemap) AddTilesToWorld ¶
AddTilesToWorld adds each Tile entity to the given world.
Click to show internal directories.
Click to hide internal directories.