fwk

package
v0.0.0-...-48559a4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2015 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

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 NewBaseGame(width, height int, title string) BaseGame

func (*BaseGame) GetCollisionDetector

func (g *BaseGame) GetCollisionDetector() CollisionDetector

func (*BaseGame) GetScene

func (g *BaseGame) GetScene() *Scene

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

func (*BaseGame) Start

func (g *BaseGame) Start()

type BoundingBox

type BoundingBox struct {
	Left, Right, Top, Bottom gl.Float
}

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 Color

type Color struct {
	R, G, B, A gl.Float
}

type Drawable

type Drawable interface {
	Draw(ratio float64)
}

type Font

type Font struct {
	// contains filtered or unexported fields
}

func NewFont

func NewFont(fontfile string, param ...FontParam) (font *Font, err error)

func (*Font) PrintLines

func (f *Font) PrintLines(text []string) draw.Image

type FontConfig

type FontConfig struct {
	Dpi     float64
	Size    float64
	Spacing float64
}

type FontParam

type FontParam func(config *FontConfig)

func FontDpi

func FontDpi(dpi float64) FontParam

func FontSize

func FontSize(size float64) FontParam

func FontSpacing

func FontSpacing(spacing float64) FontParam

type Game

type Game interface {
	Start()
}

type GameSceneBuilder

type GameSceneBuilder interface {
	BuildGameScene()
}

type GameUpdateHandler

type GameUpdateHandler interface {
	Update(duration time.Duration) bool
}

type KeyEventHandler

type KeyEventHandler interface {
	OnKeyEvent(key glfw.Key, scancode int, action glfw.Action, mods glfw.ModifierKey)
}

type Named

type Named interface {
	GetName() string
}

type NamedDrawable

type NamedDrawable interface {
	Drawable
	Named
}

type Node

type Node struct {
	Parent *Node
	// contains filtered or unexported fields
}

func NewNode

func NewNode(parent *Node, name string, position Vector) *Node

func (*Node) AddDrawable

func (n *Node) AddDrawable(d NamedDrawable) (rs *Node)

func (*Node) Draw

func (n *Node) Draw(ratio float64)

func (*Node) GetName

func (n *Node) GetName() string

func (*Node) GetPosition

func (n *Node) GetPosition() *Vector

func (*Node) Move

func (n *Node) Move(trans *Vector)

func (*Node) Rotate

func (n *Node) Rotate(deg float32, up Vector)

type Rectangle

type Rectangle struct {
	Width  gl.Float
	Height gl.Float
	Color  Color
	Name   string
}

func (*Rectangle) Draw

func (r *Rectangle) Draw(ratio float64)

func (*Rectangle) GetName

func (r *Rectangle) GetName() string

type Scene

type Scene struct {
	Width, Height gl.Sizei
	// contains filtered or unexported fields
}

func (*Scene) Destroy

func (*Scene) Destroy()

func (*Scene) Draw

func (s *Scene) Draw(ratio float64)

func (*Scene) GetRoot

func (s *Scene) GetRoot() *Node

func (*Scene) Init

func (s *Scene) Init() (err error)

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()

type Timer

type Timer struct {
	// contains filtered or unexported fields
}

func NewTimer

func NewTimer() Timer

func (Timer) Delta

func (t Timer) Delta() time.Duration

type Vector

type Vector struct {
	X, Y, Z gl.Float
}

func (*Vector) Add

func (v *Vector) Add(p *Vector) *Vector

func (Vector) Addition

func (v Vector) Addition(p *Vector) *Vector

func (Vector) Clamp

func (v Vector) Clamp(min, max Vector) (p Vector)

func (*Vector) Dot

func (v *Vector) Dot(p *Vector) float64

func (*Vector) Length

func (v *Vector) Length() float64

func (*Vector) Mult

func (v *Vector) Mult(sc gl.Float) *Vector

func (*Vector) Multiplication

func (v *Vector) Multiplication(sc gl.Float) *Vector

func (Vector) Normalization

func (v Vector) Normalization() *Vector

func (*Vector) Normalize

func (v *Vector) Normalize() *Vector

func (*Vector) Substract

func (v *Vector) Substract(p *Vector) *Vector

func (Vector) Substraction

func (v Vector) Substraction(p *Vector) *Vector

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL