Documentation ¶
Index ¶
- type BaseGame
- func (g *BaseGame) GetCollisionDetector() CollisionDetector
- func (g *BaseGame) GetScene() *Scene
- func (g *BaseGame) SetGameSceneBuilder(handler GameSceneBuilder)
- func (g *BaseGame) SetGameUpdateHandler(handler GameUpdateHandler)
- func (g *BaseGame) SetKeyEventHandler(handler KeyEventHandler)
- func (g *BaseGame) Start()
- type BoundingBox
- type BoundingSphere
- type BoundingVolume
- type Collidable
- type CollisionDetector
- type CollisionHandler
- type CollisionObject
- type Color
- type Drawable
- type Font
- type FontConfig
- type FontParam
- type Game
- type GameSceneBuilder
- type GameUpdateHandler
- type KeyEventHandler
- type Named
- type NamedDrawable
- type Node
- type Rectangle
- type Scene
- type SimpleCollisionDetector
- type Timer
- type Vector
- func (v *Vector) Add(p *Vector) *Vector
- func (v Vector) Addition(p *Vector) *Vector
- func (v Vector) Clamp(min, max Vector) (p Vector)
- func (v *Vector) Dot(p *Vector) float64
- func (v *Vector) Length() float64
- func (v *Vector) Mult(sc gl.Float) *Vector
- func (v *Vector) Multiplication(sc gl.Float) *Vector
- func (v Vector) Normalization() *Vector
- func (v *Vector) Normalize() *Vector
- func (v *Vector) Substract(p *Vector) *Vector
- func (v Vector) Substraction(p *Vector) *Vector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseGame ¶
type BaseGame struct {
// contains filtered or unexported fields
}
func NewBaseGame ¶
func (*BaseGame) GetCollisionDetector ¶
func (g *BaseGame) GetCollisionDetector() CollisionDetector
func (*BaseGame) SetGameSceneBuilder ¶
func (g *BaseGame) SetGameSceneBuilder(handler GameSceneBuilder)
func (*BaseGame) SetGameUpdateHandler ¶
func (g *BaseGame) SetGameUpdateHandler(handler GameUpdateHandler)
Handler to update the game logic
func (*BaseGame) SetKeyEventHandler ¶
func (g *BaseGame) SetKeyEventHandler(handler KeyEventHandler)
Handler to handle key events
type BoundingBox ¶
func (*BoundingBox) CollidesWith ¶
func (v *BoundingBox) CollidesWith(other BoundingVolume) bool
func (*BoundingBox) GetNearestTo ¶
func (v *BoundingBox) GetNearestTo(p *Vector) *Vector
type BoundingSphere ¶
type BoundingSphere struct {
// contains filtered or unexported fields
}
func (*BoundingSphere) CollidesWith ¶
func (v *BoundingSphere) CollidesWith(other BoundingVolume) (collides bool)
func (*BoundingSphere) GetNearestTo ¶
func (v *BoundingSphere) GetNearestTo(p *Vector) *Vector
type BoundingVolume ¶
type BoundingVolume interface { CollidesWith(other BoundingVolume) bool GetNearestTo(p *Vector) *Vector }
type Collidable ¶
type Collidable interface { Named GetBoundingVolumes() []BoundingVolume }
type CollisionDetector ¶
type CollisionDetector interface { Check() AddCollidable(c Collidable) AddCollisionHandler(h CollisionHandler) }
type CollisionHandler ¶
type CollisionHandler interface {
HandleCollision(one, two CollisionObject)
}
type CollisionObject ¶
type CollisionObject struct {
// contains filtered or unexported fields
}
func (CollisionObject) GetBoundingVolume ¶
func (c CollisionObject) GetBoundingVolume() BoundingVolume
func (CollisionObject) GetObject ¶
func (c CollisionObject) GetObject() Collidable
type FontConfig ¶
type GameSceneBuilder ¶
type GameSceneBuilder interface {
BuildGameScene()
}
type GameUpdateHandler ¶
type KeyEventHandler ¶
type NamedDrawable ¶
type Node ¶
type Node struct { Parent *Node // contains filtered or unexported fields }
func (*Node) AddDrawable ¶
func (n *Node) AddDrawable(d NamedDrawable) (rs *Node)
func (*Node) GetPosition ¶
type SimpleCollisionDetector ¶
type SimpleCollisionDetector struct {
// contains filtered or unexported fields
}
func NewSimpleCollisionDetector ¶
func NewSimpleCollisionDetector() *SimpleCollisionDetector
func (*SimpleCollisionDetector) AddCollidable ¶
func (n *SimpleCollisionDetector) AddCollidable(c Collidable)
func (*SimpleCollisionDetector) AddCollisionHandler ¶
func (n *SimpleCollisionDetector) AddCollisionHandler(h CollisionHandler)
func (*SimpleCollisionDetector) Check ¶
func (n *SimpleCollisionDetector) Check()
Click to show internal directories.
Click to hide internal directories.