Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyArgsToShape(shape Shape, args map[string]interface{})
- func ApplyChipmunkBodyProperties(shape *chipmunk.Shape, body *chipmunk.Body, args map[string]interface{})
- func ApplyChipmunkShapeProperties(shape *chipmunk.Shape, args map[string]interface{})
- func ArgAsChipmunkFloat(arg interface{}) (vect.Float, bool)
- func ArgAsChipmunkVector(arg interface{}) (vect.Vect, bool)
- func ArgAsColor(arg interface{}) (sf.Color, bool)
- func ArgAsFloat32(arg interface{}) (float32, bool)
- func ArgAsVector2f(arg interface{}) (sf.Vector2f, bool)
- func CircleColliderFromColliderPrefab(args map[string]interface{}) (*chipmunk.Body, error)
- func ColliderFromColliderPrefab(c ColliderPrefab) (*chipmunk.Body, error)
- func NewScreenWidth(width uint)
- type Address
- type BaseComponent
- type BasicMailBox
- func (box *BasicMailBox) GetAddress() Address
- func (box *BasicMailBox) GetOffice() *PostOffice
- func (box *BasicMailBox) PostMessage(msg Message)
- func (box *BasicMailBox) RecieveMessage(msg Message)
- func (box *BasicMailBox) Remove()
- func (box *BasicMailBox) SetAddress(a Address)
- func (box *BasicMailBox) SetOffice(office *PostOffice)
- type CircleShape
- type ColliderPrefab
- type Component
- type ComponentGenerator
- type ComponentPrefab
- type ConvexShape
- type Entity
- func (e *Entity) AddChild(child *Entity)
- func (e *Entity) AddComponent(comp Component)
- func (e *Entity) Awake()
- func (e *Entity) RecalculateScale()
- func (e *Entity) RemoveChild(child *Entity)
- func (e *Entity) Sleep()
- func (e *Entity) Start()
- func (e *Entity) Stop()
- func (e *Entity) Update(dur time.Duration)
- type EntityPrefab
- type Game
- func (g *Game) ChangeScene(name string)
- func (g *Game) GetCurrentScene() *Scene
- func (g *Game) GetScene(name string) (*Scene, bool)
- func (g *Game) GetSize() Vector
- func (g *Game) GetWindow() *Window
- func (g *Game) Init()
- func (g *Game) LoadSceneFromFile(path string) (*Scene, error)
- func (g *Game) ProcessArguments()
- func (g *Game) Run()
- type GameConfig
- type InputCollection
- func (collection *InputCollection) ActivateSet(set *KeyboardSet)
- func (collection *InputCollection) DeactivateSet(set *KeyboardSet)
- func (collection *InputCollection) DeactivateSets()
- func (collection *InputCollection) InstallKeyboardSet(set *KeyboardSet)
- func (collection *InputCollection) KeyPressed(code sf.KeyCode)
- func (collection *InputCollection) KeyReleased(code sf.KeyCode)
- func (collection *InputCollection) RecieveMessage(msg Message)
- func (collection *InputCollection) UninstallKeyboardSet(set *KeyboardSet)
- type KeyCommand
- type KeyboardHandler
- func (handler *KeyboardHandler) ClearKeyPressedCommand(code sf.KeyCode)
- func (handler *KeyboardHandler) ClearKeyReleasedCommand(code sf.KeyCode)
- func (handler *KeyboardHandler) RegisterKeyPressedCommand(code sf.KeyCode, cmd KeyCommand)
- func (handler *KeyboardHandler) RegisterKeyReleasedCommand(code sf.KeyCode, cmd KeyCommand)
- type KeyboardSet
- type MailBox
- type Message
- type MessageType
- type PhysicsEngine
- func (engine *PhysicsEngine) AddEntities(list []*Entity)
- func (engine *PhysicsEngine) AddEntity(e *Entity)
- func (engine *PhysicsEngine) ChangeScene(s *Scene)
- func (engine *PhysicsEngine) GetSpace() *chipmunk.Space
- func (engine *PhysicsEngine) RecieveMessage(msg Message)
- func (engine *PhysicsEngine) SetDebug(debug bool)
- type PhysicsEngineConfig
- type PostOffice
- func (office *PostOffice) Add(box MailBox)
- func (office *PostOffice) Broadcast(msg Message)
- func (office *PostOffice) IsSubscribed(sender Address, reciever Address, msg MessageType) bool
- func (office *PostOffice) RecieveMessage(sender Address, msg Message)
- func (office *PostOffice) Remove(box Address)
- func (office *PostOffice) Subscribe(sender Address, reciever Address, msg MessageType)
- func (office *PostOffice) UnSubscribe(sender Address, reciever Address, msg MessageType)
- type RectangleShape
- type Scene
- func (s *Scene) AddEntity(e *Entity)
- func (s *Scene) Draw(target sf.RenderTarget, renderStates sf.RenderStates)
- func (s *Scene) GetEntities() []*Entity
- func (s *Scene) GetEntityByName(name string) (*Entity, bool)
- func (s *Scene) RecalculateScale()
- func (s *Scene) RecieveMessage(msg Message)
- func (s *Scene) SetZIndex(name string, index int)
- type SceneDef
- type SceneDefEntity
- type Shape
- type Sprite
- type Text
- type Transformer
- func CircleShapeFromArguments(args map[string]interface{}) (Transformer, error)
- func ConvexShapeFromArguments(args map[string]interface{}) (Transformer, error)
- func RectangleShapeFromArguments(args map[string]interface{}) (Transformer, error)
- func SpriteFromArguments(args map[string]interface{}) (Transformer, error)
- func TextFromArguments(args map[string]interface{}) (Transformer, error)
- func TransformerFromTranformerPrefab(t TransformerPrefab) (Transformer, error)
- type TransformerPrefab
- type Vector
- type Window
- type WindowConfig
Constants ¶
const ( //DefaultPrefabsFolderName : prefabs DefaultPrefabsFolderName = "prefabs" //DefaultResourcesFolderName : resources DefaultResourcesFolderName = "resources" //DefaultScenesFolderName : scenes DefaultScenesFolderName = "scenes" )
const ( //SpriteName : Name of Transformer SpriteName = "Sprite" //CircleShapeName : Name of Transformer CircleShapeName = "CircleShape" //ConvexShapeName : Name of Transformer ConvexShapeName = "ConvexShape" //RectangleShapeName : Name of Transformer RectangleShapeName = "RectangleShape" //TextName : Name of Transformer TextName = "Text" )
const ( //DefaultGameWidth : Width in Pixels of Game Window DefaultGameWidth = 800 //DefaultGameHeight : Height in Pixels of Game Window DefaultGameHeight = 600 //DefaultTitle : Title of Game Window DefaultTitle = "Gold Engine" )
const (
//CircleColliderName : Name of Circle Collider
CircleColliderName = "CircleShape"
)
const KeyPressedMSG = MessageType("KeyPressed")
KeyPressedMSG : KeyWasReleased
const KeyReleasedMSG = MessageType("KeyReleased")
KeyReleasedMSG : KeyWasPressed
const RootNodeName = "ROOT"
RootNodeName : Default Name for The rootnode of all scenes
const SceneAddedEntityMSG = MessageType("SceneAddedEntity")
SceneAddedEntityMSG : Added Entity to scene. Sends pointer to entity
const SceneChangedMSG = MessageType("SceneChanged")
SceneChangedMSG : Game has changed scene
const SceneLoadedMSG = MessageType("SceneLoaded")
SceneLoadedMSG : Scene Was loaded returns pointer to scene
Variables ¶
var ColliderGenerators = map[string]func(args map[string]interface{}) (*chipmunk.Body, error){ CircleColliderName: CircleColliderFromColliderPrefab, }
ColliderGenerators : map to generators for bodies
var ComponentRegister = componentRegister{ // contains filtered or unexported fields }
ComponentRegister : map of generators for a componentName
var ErrComponentAlreadyRegistered = errors.New("A Component With That Name Was Already Registered")
ErrComponentAlreadyRegistered : Cannot register a ComponentGenerator because the name is already registered
var PrefabRegister = prefabRegister{ // contains filtered or unexported fields }
PrefabRegister : Has all the EntityPrefab
var TranformerGenerators = map[string]func(args map[string]interface{}) (Transformer, error){ SpriteName: SpriteFromArguments, CircleShapeName: CircleShapeFromArguments, ConvexShapeName: ConvexShapeFromArguments, RectangleShapeName: RectangleShapeFromArguments, TextName: TextFromArguments, }
TranformerGenerators : map to create Generators
var ZeroVector = Vector{X: 0, Y: 0}
ZeroVector : Vector initialized to zero
Functions ¶
func ApplyArgsToShape ¶
ApplyArgsToShape : Sets Properties like OutlineThickness
func ApplyChipmunkBodyProperties ¶
func ApplyChipmunkBodyProperties(shape *chipmunk.Shape, body *chipmunk.Body, args map[string]interface{})
ApplyChipmunkBodyProperties : Sets common chipmunk body properties
func ApplyChipmunkShapeProperties ¶
ApplyChipmunkShapeProperties : Sets common chipmunk shape properties
func ArgAsChipmunkFloat ¶
ArgAsChipmunkFloat : Converts an interface from a JSON Parser to a chipmunk Float
func ArgAsChipmunkVector ¶
ArgAsChipmunkVector : Converts an interface from a JSON Parser to a chipmunk
func ArgAsColor ¶
ArgAsColor Converts an interface from a JSON Parser to a Color
func ArgAsFloat32 ¶
ArgAsFloat32 Converts an interface from a JSON Parser to a float32
func ArgAsVector2f ¶
ArgAsVector2f Converts an interface from a JSON Parser to a Vector2f
func CircleColliderFromColliderPrefab ¶
CircleColliderFromColliderPrefab : Creates a body shape
func ColliderFromColliderPrefab ¶
func ColliderFromColliderPrefab(c ColliderPrefab) (*chipmunk.Body, error)
ColliderFromColliderPrefab : Returns a Collider from ColliderPrefab
Types ¶
type BaseComponent ¶
type BaseComponent struct {
// contains filtered or unexported fields
}
BaseComponent : Struct implementing all Component Properties. Allows the user to overload whatever methods they'd like
func (*BaseComponent) Awake ¶
func (b *BaseComponent) Awake()
Awake : Called After Start and after sleep
func (*BaseComponent) GetEntity ¶
func (b *BaseComponent) GetEntity() *Entity
GetEntity : What Entity this component acts on
func (*BaseComponent) SetEntity ¶
func (b *BaseComponent) SetEntity(e *Entity)
SetEntity : What Entity this component should acts on
func (*BaseComponent) Stop ¶
func (b *BaseComponent) Stop()
Stop : Called When an entity is going to be destroyed Once called Awake and Update are never called again
func (*BaseComponent) Update ¶
func (b *BaseComponent) Update(duration time.Duration)
Update : Do something given the time that's passed since last
type BasicMailBox ¶
type BasicMailBox struct {
// contains filtered or unexported fields
}
BasicMailBox : Struct that accepts and recieves messages
func (*BasicMailBox) GetAddress ¶
func (box *BasicMailBox) GetAddress() Address
GetAddress : Gets the Address of Mailbox
func (*BasicMailBox) GetOffice ¶
func (box *BasicMailBox) GetOffice() *PostOffice
GetOffice : Returns the mailbox office
func (*BasicMailBox) PostMessage ¶
func (box *BasicMailBox) PostMessage(msg Message)
PostMessage : Send Out a Message
func (*BasicMailBox) RecieveMessage ¶
func (box *BasicMailBox) RecieveMessage(msg Message)
RecieveMessage : Recieve a Message. Should Override
func (*BasicMailBox) Remove ¶
func (box *BasicMailBox) Remove()
Remove : mailbox removes itself from its office
func (*BasicMailBox) SetAddress ¶
func (box *BasicMailBox) SetAddress(a Address)
SetAddress : Sets the Address of Mailbox
func (*BasicMailBox) SetOffice ¶
func (box *BasicMailBox) SetOffice(office *PostOffice)
SetOffice : Sets this Boxes Office
type ColliderPrefab ¶
ColliderPrefab : Generates a Collider (chipmunk body) from configuration
type Component ¶
type Component interface { Awake() Start() Stop() Update(time.Duration) Sleep() SetEntity(e *Entity) GetEntity() *Entity }
Component : Grants an entity an ability
func ComponentFromComponentPrefab ¶
func ComponentFromComponentPrefab(c ComponentPrefab) Component
ComponentFromComponentPrefab : Returns a Component from a ComponentPrefab
type ComponentGenerator ¶
ComponentGenerator : Function that takes the minimum arguments required to create a component
type ComponentPrefab ¶
ComponentPrefab : Generates a Component with the Given name from the Arguments
type Entity ¶
type Entity struct { Name string KeyboardSet *KeyboardSet Transfrom Transformer Collider *chipmunk.Body // contains filtered or unexported fields }
Entity : Entity
func EntityFromEntityPrefab ¶
func EntityFromEntityPrefab(prefab EntityPrefab) *Entity
EntityFromEntityPrefab : Returns Entity from Entity Prefab
func EntityFromSceneDefEntity ¶
func EntityFromSceneDefEntity(def SceneDefEntity) (*Entity, error)
EntityFromSceneDefEntity : Creates an Entity from a scene definition entity
func (*Entity) AddComponent ¶
AddComponent : Associates a component with a given entity
func (*Entity) RecalculateScale ¶
func (e *Entity) RecalculateScale()
RecalculateScale : Changes the size of sfml and chipmunk objects
func (*Entity) RemoveChild ¶
RemoveChild : Removes Child Enttiy
type EntityPrefab ¶
type EntityPrefab struct { Name string Components []ComponentPrefab Transformer TransformerPrefab Collider ColliderPrefab }
EntityPrefab : Information Required to Create an Entity from JSON Prefab
type Game ¶
type Game struct { PostOffice *PostOffice PrefabsFolderName string ResourcesFolderName string ScenesFolderName string //Composed Structs BasicMailBox //TODO : Use this for RPC // contains filtered or unexported fields }
Game : Controls Actual Game
var GlobalGame *Game
GlobalGame : Currently running game
func NewGame ¶
func NewGame(config GameConfig, wc WindowConfig, pc PhysicsEngineConfig) *Game
NewGame : Returns an app.
func (*Game) GetCurrentScene ¶
GetCurrentScene : Get the current rendered scene
func (*Game) LoadSceneFromFile ¶
LoadSceneFromFile : Gets Scene from File
func (*Game) ProcessArguments ¶
func (g *Game) ProcessArguments()
ProcessArguments : Handles CommandLine Arguments
type GameConfig ¶
type GameConfig struct { Name string LogFile io.Writer PrefabsFolderName string ResourcesFolderName string ScenesFolderName string Debug bool }
GameConfig : Adjust Paramaters for an App
Defaults ¶
Name: App:NoName LogFile: os.Stdout
type InputCollection ¶
type InputCollection struct { BasicMailBox // contains filtered or unexported fields }
InputCollection : Collection of Sets handling Mouse and Keyboard Input. Used to emulate keyboard input.
func GenInputCollection ¶
func GenInputCollection() *InputCollection
GenInputCollection : Convienece function for making an InputCollection
func (*InputCollection) ActivateSet ¶
func (collection *InputCollection) ActivateSet(set *KeyboardSet)
ActivateSet : KeyboardSet will recive input
func (*InputCollection) DeactivateSet ¶
func (collection *InputCollection) DeactivateSet(set *KeyboardSet)
DeactivateSet : KeyboardSet will nolong recieve input
func (*InputCollection) DeactivateSets ¶
func (collection *InputCollection) DeactivateSets()
DeactivateSets : All sets will no longer recive input
func (*InputCollection) InstallKeyboardSet ¶
func (collection *InputCollection) InstallKeyboardSet(set *KeyboardSet)
InstallKeyboardSet : Add set to collection
func (*InputCollection) KeyPressed ¶
func (collection *InputCollection) KeyPressed(code sf.KeyCode)
KeyPressed : Puts KeyPressed
func (*InputCollection) KeyReleased ¶
func (collection *InputCollection) KeyReleased(code sf.KeyCode)
KeyReleased : Puts KeyReleased
func (*InputCollection) RecieveMessage ¶
func (collection *InputCollection) RecieveMessage(msg Message)
RecieveMessage : Fuffils the MailBox Requirement
func (*InputCollection) UninstallKeyboardSet ¶
func (collection *InputCollection) UninstallKeyboardSet(set *KeyboardSet)
UninstallKeyboardSet : Remove set from collection
type KeyCommand ¶
type KeyCommand func()
KeyCommand : Function called when a button is pressed or released
type KeyboardHandler ¶
type KeyboardHandler struct { KeyPressedCommands map[sf.KeyCode]KeyCommand KeyReleasedCommands map[sf.KeyCode]KeyCommand // contains filtered or unexported fields }
KeyboardHandler : functions to call whe na key is pressed and released
func GenInputHandler ¶
func GenInputHandler() *KeyboardHandler
GenInputHandler : Creates a Handler for commands
func (*KeyboardHandler) ClearKeyPressedCommand ¶
func (handler *KeyboardHandler) ClearKeyPressedCommand(code sf.KeyCode)
ClearKeyPressedCommand : Clear function ofr this key
func (*KeyboardHandler) ClearKeyReleasedCommand ¶
func (handler *KeyboardHandler) ClearKeyReleasedCommand(code sf.KeyCode)
ClearKeyReleasedCommand : Clear function for this key
func (*KeyboardHandler) RegisterKeyPressedCommand ¶
func (handler *KeyboardHandler) RegisterKeyPressedCommand(code sf.KeyCode, cmd KeyCommand)
RegisterKeyPressedCommand : call htis function when a key si pressed
func (*KeyboardHandler) RegisterKeyReleasedCommand ¶
func (handler *KeyboardHandler) RegisterKeyReleasedCommand(code sf.KeyCode, cmd KeyCommand)
RegisterKeyReleasedCommand : call this function when a key is released
type KeyboardSet ¶
type KeyboardSet struct {
// contains filtered or unexported fields
}
KeyboardSet : Set of KeyboardHandlers. Technically only need 1 but it's usefull for grouping
func (*KeyboardSet) AddHandler ¶
func (set *KeyboardSet) AddHandler(handler *KeyboardHandler)
AddHandler : adds a Handler to a keyboardSet
func (*KeyboardSet) KeyPressed ¶
func (set *KeyboardSet) KeyPressed(code sf.KeyCode)
KeyPressed : Says a key should be pressed
func (*KeyboardSet) KeyReleased ¶
func (set *KeyboardSet) KeyReleased(code sf.KeyCode)
KeyReleased : Says a key should be released
func (*KeyboardSet) RemoveHandler ¶
func (set *KeyboardSet) RemoveHandler(handler *KeyboardHandler)
RemoveHandler : remove a KeybaordHandler from a keyboardSet
type MailBox ¶
type MailBox interface { PostMessage(msg Message) RecieveMessage(msg Message) Remove() SetOffice(office *PostOffice) GetOffice() *PostOffice GetAddress() Address SetAddress(Address) }
MailBox : Interface for accepting and recieve message
type Message ¶
type Message struct { Message MessageType Content interface{} }
Message : Contains two fields, MessageType and the pointer to the object you are dealing with. Used for RPC.
type PhysicsEngine ¶
type PhysicsEngine struct { BasicMailBox // contains filtered or unexported fields }
PhysicsEngine : Wrapper around chipmunk engine
func (*PhysicsEngine) AddEntities ¶
func (engine *PhysicsEngine) AddEntities(list []*Entity)
AddEntities : Convienece function to add a bunch of entities
func (*PhysicsEngine) AddEntity ¶
func (engine *PhysicsEngine) AddEntity(e *Entity)
AddEntity : Add Entity to phsics space
func (*PhysicsEngine) ChangeScene ¶
func (engine *PhysicsEngine) ChangeScene(s *Scene)
ChangeScene : Changes the Current Scene
func (*PhysicsEngine) GetSpace ¶
func (engine *PhysicsEngine) GetSpace() *chipmunk.Space
GetSpace : Get chipmunk space
func (*PhysicsEngine) RecieveMessage ¶
func (engine *PhysicsEngine) RecieveMessage(msg Message)
RecieveMessage : RecieveMessage function for Physics Engine
func (*PhysicsEngine) SetDebug ¶
func (engine *PhysicsEngine) SetDebug(debug bool)
SetDebug : Sets Debug mode of Physics Engine
type PhysicsEngineConfig ¶
PhysicsEngineConfig : Configuration for the Physics Engine
type PostOffice ¶
type PostOffice struct {
// contains filtered or unexported fields
}
PostOffice : Manages MailBoxs
func (*PostOffice) Add ¶
func (office *PostOffice) Add(box MailBox)
Add : Adds a MailBox to this office
func (*PostOffice) Broadcast ¶
func (office *PostOffice) Broadcast(msg Message)
Broadcast : Send a message to every box
func (*PostOffice) IsSubscribed ¶
func (office *PostOffice) IsSubscribed(sender Address, reciever Address, msg MessageType) bool
IsSubscribed : See if a given mailbox is the subscriber for a message on another
func (*PostOffice) RecieveMessage ¶
func (office *PostOffice) RecieveMessage(sender Address, msg Message)
RecieveMessage : Called whenever a MailBox post. Sends this Message out to Subscribed MailBoxs
func (*PostOffice) Remove ¶
func (office *PostOffice) Remove(box Address)
Remove : PostOffice will never send this MailBox another message
func (*PostOffice) Subscribe ¶
func (office *PostOffice) Subscribe(sender Address, reciever Address, msg MessageType)
Subscribe : Tells a MailBox to Listen to a specific message from this mailbox
func (*PostOffice) UnSubscribe ¶
func (office *PostOffice) UnSubscribe(sender Address, reciever Address, msg MessageType)
UnSubscribe : Removes Subscriber for a given message and MailBox
type RectangleShape ¶
type RectangleShape sf.RectangleShape
RectangleShape : Wrapper around sfml Object
type Scene ¶
type Scene struct { Name string Awake func() Start func() Update func(time.Duration) BasicMailBox // contains filtered or unexported fields }
Scene : Everything that is being rendered
func SceneFromSceneDef ¶
SceneFromSceneDef : Creates a new scene given a definition
func (*Scene) Draw ¶
func (s *Scene) Draw(target sf.RenderTarget, renderStates sf.RenderStates)
Draw : Draws the scene to a render target
func (*Scene) GetEntities ¶
GetEntities : Gets all entities in scene
func (*Scene) GetEntityByName ¶
GetEntityByName : Returns an entity in the scene with that name
func (*Scene) RecalculateScale ¶
func (s *Scene) RecalculateScale()
RecalculateScale : Changes the of every entity
func (*Scene) RecieveMessage ¶
RecieveMessage : Handles Message
type SceneDef ¶
type SceneDef struct { Name string Entities []SceneDefEntity }
SceneDef : Informaiton to Create a scene from a JSON Template
type SceneDefEntity ¶
type SceneDefEntity struct { Name string Parent string Prefab string TransformArguments map[string]interface{} Position Vector Scale Vector Rotation float32 }
SceneDefEntity : Defines an Entity within the scene
type Shape ¶
type Shape interface { GetOrigin() sf.Vector2f SetOrigin(sf.Vector2f) GetOutlineThickness() float32 SetOutlineThickness(float32) GetOutlineColor() sf.Color SetOutlineColor(sf.Color) GetFillColor() sf.Color SetFillColor(sf.Color) }
Shape : Group of Functions all Shapes have
type Transformer ¶
type Transformer interface { sf.Drawer sf.Transformer }
Transformer : Wrapper arround sfml Transformer
func CircleShapeFromArguments ¶
func CircleShapeFromArguments(args map[string]interface{}) (Transformer, error)
CircleShapeFromArguments : Generates CircleShape from Arguments field of Prefab
func ConvexShapeFromArguments ¶
func ConvexShapeFromArguments(args map[string]interface{}) (Transformer, error)
ConvexShapeFromArguments : Generates ConvexShape from Arguments field of Prefab
func RectangleShapeFromArguments ¶
func RectangleShapeFromArguments(args map[string]interface{}) (Transformer, error)
RectangleShapeFromArguments : Generates RectangleShape from Arguments field of Prefab
func SpriteFromArguments ¶
func SpriteFromArguments(args map[string]interface{}) (Transformer, error)
SpriteFromArguments : Generates sprite from Arguments field of Prefab TODO : Get Texture
func TextFromArguments ¶
func TextFromArguments(args map[string]interface{}) (Transformer, error)
TextFromArguments : Generates Text from Arguments field of Prefab TODO : Get fonts
func TransformerFromTranformerPrefab ¶
func TransformerFromTranformerPrefab(t TransformerPrefab) (Transformer, error)
TransformerFromTranformerPrefab : Returns Transformer from Transform Prefab
type TransformerPrefab ¶
TransformerPrefab : Info to create a Transformer from JSON Prefab
type Vector ¶
type Vector struct {
X, Y float32
}
Vector : A 1x1 Vector reprecents a square whose width is 1 100th of the screen
func ArgAsVector ¶
ArgAsVector Converts an interface from a JSON Parser to a Vector2f
func ChipmunkFloatToVector ¶
ChipmunkFloatToVector : New float
func ChipmunkVectorToVector ¶
ChipmunkVectorToVector : New Vector
func Vector2fToVector ¶
Vector2fToVector : Converts a Vector2f to a Vector
func Vector2uToVector ¶
Vector2uToVector : Converts a Vector2u to a Vector
func (*Vector) ToChipmunk ¶
ToChipmunk : Converts a Vector to an sfml vector
type Window ¶
type Window struct { Ticker *time.Ticker ClearColor sf.Color BasicMailBox // contains filtered or unexported fields }
Window : Wrapper around a SFML RenderWindow Handles input and drawing scenes
func (*Window) ChangeScene ¶
ChangeScene : Changes current scene
func (*Window) GetInputCollection ¶
func (w *Window) GetInputCollection() *InputCollection
GetInputCollection : Retruns the InputCollection for this scene
func (*Window) RecieveMessage ¶
RecieveMessage : Messages This Window should Recieve