Documentation
¶
Overview ¶
Package characters provides a set of tools to construct your chars made of parts and equipement
Index ¶
Constants ¶
const ( StdChestHeigh = 24 StdLegsHeigh = 16 StdWidth = 32 )
Std are the standart size, using which we calculate the proportions to redimensionate the equipment
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Body ¶
type Body struct {
Drawable Part `json:""`
HeadAnchor pixel.Vec `json:"head_anchor"`
ChestAnchor pixel.Vec `json:"chest_anchor"`
LegsAnchor pixel.Vec `json:"legs_anchor"`
}
Body of a character, contains the rest of the anchors of the wearables.
func LoadBodies ¶
LoadBodies gets a *bodies.json into a bodies array for a race.
func (*Body) SetVectors ¶
func (body *Body) SetVectors()
SetVectors creates the drawable vectors from the main proportions
type Character ¶
type Character struct {
// Basic info
Name string `json:"name"`
Nickname string `json:"nickname"`
Lastname string `json:"lastname"`
Race string `json:"race"`
Job string `json:"job"`
Age int16 `json:"age"`
// Stats, perks and etc.
Position pixel.Vec `json:"position"`
Speed float64 `json:"speed"`
// Apearence
Head Head `json:"head"`
Body Body `json:"body"`
Equipped []*Equipable `json:"equipement"`
}
Character is the basic individual unit in the game
type Equipable ¶
type Equipable struct {
// TODO: cuando se saquen los puntos de anclaje al constuir al personaje, se rellenan los puntos de renderables
Prority RenderPriority `json:"prority"`
Parts []Part `json:"renderables"`
}
Equipable has a type, color and uses the anchors to adjust perfectly to a character.
type Head ¶
type Head struct {
Drawable Part `json:"vectors"`
RoundTop bool `json:"round_top"`
Circular bool `json:"circular"`
}
Head of a character, contains the anchor for the helmet, and data about the head shape.
type RenderPriority ¶
type RenderPriority int
RenderPriority defines the order of drawing of an equipped object.
const ( Low RenderPriority = 1 + iota Middle High )
The priority of the rendering of the object within a character