Documentation ¶
Overview ¶
Package characters provides a set of tools to construct your chars made of parts and equipement
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Body ¶
type Body struct { Kid bool `json:"kid"` Vectors Renderable `json:"vectors"` HeadAnchor pixel.Vec `json:"head_anchor"` LeftHandAnchor pixel.Vec `json:"left_hand_anchor"` RightHandAnchor pixel.Vec `json:"right_hand_anchor"` ChestAnchors Renderable `json:"armor_anchors"` PantsAnchors Renderable `json:"pants_anchors"` HelmetAnchor pixel.Vec `json:"helmet_anchor"` ShoulderAnchors Renderable `json:"shoulder_anchors"` }
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.
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"` Equiped []*Equipable `json:"equipement"` SkinColor pixel.RGBA `json:"skin_color"` HeadColor pixel.RGBA `json:"head_color"` }
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"` Renderables []Renderable `json:"renderables"` PrimaryColor pixel.RGBA `json:"primary_color"` SecondaryColor pixel.RGBA `json:"secondary_color"` }
Equipable has a type, color and uses the anchors to adjust perfectly to a character.
type Head ¶
type Head struct { Vectors Renderable `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 equiped object.
const ( Low RenderPriority = 1 + iota High )
The priority of the rendering of the object within a character
type Renderable ¶
Renderable is a set of vectors which we can render indo a poligon reading it from json.