gamejam

package
v0.0.0-...-814368e Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SmoothingNearest = TextureSmoothing(core.SmoothingNearest)
	SmoothingLinear  = TextureSmoothing(core.SmoothingLinear)
)

Variables

View Source
var ErrEventObserverNotInList = fmt.Errorf("Could not find item in list")
View Source
var ErrSceneNotInList = fmt.Errorf("Could not find item in list")
View Source
var ErrSomethingNotInList = fmt.Errorf("Could not find item in list")

Functions

This section is empty.

Types

type App

type App interface {
	Update()
	Render()
	Run() (err error)
}

type BaseApp

type BaseApp struct {
	WindowWidth  int
	WindowHeight int
	WindowTitle  string
	SceneManager SceneManager
	Resources    Resources
}

func (*BaseApp) Render

func (a *BaseApp) Render()

func (*BaseApp) Run

func (a *BaseApp) Run() (err error)

func (*BaseApp) Update

func (a *BaseApp) Update()

type BaseComponent

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

func (*BaseComponent) GetID

func (c *BaseComponent) GetID() ComponentID

func (*BaseComponent) SetScene

func (c *BaseComponent) SetScene(s Scene)

type BaseEventNotifier

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

func NewBaseEventNotifier

func NewBaseEventNotifier() *BaseEventNotifier

func (*BaseEventNotifier) AddObserver

func (n *BaseEventNotifier) AddObserver(obs EventObserver) (id EventObserverID)

func (*BaseEventNotifier) Delete

func (n *BaseEventNotifier) Delete()

func (*BaseEventNotifier) Notify

func (n *BaseEventNotifier) Notify(event Event)

func (*BaseEventNotifier) RemoveObserver

func (n *BaseEventNotifier) RemoveObserver(id EventObserverID) (err error)

type BaseResources

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

func NewBaseResources

func NewBaseResources() *BaseResources

func (*BaseResources) Delete

func (r *BaseResources) Delete()

func (*BaseResources) Get

func (r *BaseResources) Get(loader ResourceLoader) (res ResourceType, err error)

func (*BaseResources) Release

func (r *BaseResources) Release(key ResourceKey) (err error)

type BaseScene

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

func NewBaseScene

func NewBaseScene() *BaseScene

func (*BaseScene) AddComponent

func (s *BaseScene) AddComponent(c Component)

func (*BaseScene) Delete

func (s *BaseScene) Delete(r Resources)

func (*BaseScene) GetID

func (s *BaseScene) GetID() SceneID

func (*BaseScene) Load

func (s *BaseScene) Load(r Resources) (err error)

func (*BaseScene) Render

func (s *BaseScene) Render()

func (*BaseScene) SetID

func (s *BaseScene) SetID(id SceneID)

func (*BaseScene) Unload

func (s *BaseScene) Unload()

func (*BaseScene) Update

func (s *BaseScene) Update(mgr SceneManager)

type BaseSceneManager

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

func NewBaseSceneManager

func NewBaseSceneManager(scenes ...Scene) (m *BaseSceneManager)

func (*BaseSceneManager) AddScene

func (m *BaseSceneManager) AddScene(s Scene) (err error)

func (*BaseSceneManager) Delete

func (m *BaseSceneManager) Delete()

func (*BaseSceneManager) Head

func (m *BaseSceneManager) Head() *SceneNode

func (*BaseSceneManager) Load

func (m *BaseSceneManager) Load(r Resources) (err error)

func (*BaseSceneManager) OnSceneLoaded

func (m *BaseSceneManager) OnSceneLoaded(event SceneLoadedEvent)

func (*BaseSceneManager) OnSceneUnload

func (m *BaseSceneManager) OnSceneUnload(event SceneUnloadEvent)

func (*BaseSceneManager) Render

func (m *BaseSceneManager) Render()

func (*BaseSceneManager) Update

func (m *BaseSceneManager) Update()

type Component

type Component interface {
	GetID() ComponentID
	SetScene(s Scene)
	Delete()
}

type ComponentID

type ComponentID string

type Event

type Event interface {
}

type EventNotifier

type EventNotifier interface {
	AddObserver(obs EventObserver) (id EventObserverID)
	RemoveObserver(obs EventObserver) (err error)
	Notify(event Event)
	Delete()
}

type EventObserver

type EventObserver func(event Event)

type EventObserverID

type EventObserverID int

func BindSceneEventObserver

func BindSceneEventObserver(notifier EventNotifier, obs SceneEventObserver) (id EventObserverID)

type EventObserverList

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

A EventObserverList manages a list of EventObserverNode items.

func NewEventObserverList

func NewEventObserverList(items ...EventObserver) (l *EventObserverList)

func (*EventObserverList) Delete

func (l *EventObserverList) Delete()

Unlinks all EventObserver items from this EventObserverList.

func (*EventObserverList) Head

func (*EventObserverList) Prepend

func (l *EventObserverList) Prepend(item EventObserver) (id EventObserverListID)

func (*EventObserverList) Remove

func (l *EventObserverList) Remove(id EventObserverListID) (err error)

Attempts to remove `item` from the list. Returns ErrEventObserverNotInList if the ID did not exist in list.

type EventObserverListID

type EventObserverListID int

type EventObserverNode

type EventObserverNode struct {
	EventObserver
	// contains filtered or unexported fields
}

A EventObserverNode represents a doubly-linked EventObserver.

func (*EventObserverNode) ID

func (*EventObserverNode) Next

func (n *EventObserverNode) Unlink() (next *EventObserverNode)

Unlinks the node from the current list. Returns the next node for convenience while iterating.

type GeometryType

type GeometryType struct {
	*render.Geometry
	// contains filtered or unexported fields
}

func (GeometryType) Key

func (t GeometryType) Key() ResourceKey

type ResourceKey

type ResourceKey string

type ResourceLoader

type ResourceLoader interface {
	Key() ResourceKey
	Load(resources Resources) (res ResourceType, err error)
}

type ResourceType

type ResourceType interface {
	Key() ResourceKey
	Delete()
}

type Resources

type Resources interface {
	Get(loader ResourceLoader) (res ResourceType, err error)
	Release(key ResourceKey) (err error)
	Delete()
}

type Scene

type Scene interface {
	AddComponent(c Component)
	Load(r Resources) (err error)
	Unload()
	SetID(id SceneID)
	GetID() SceneID
	Update(mgr SceneManager)
	Render()
	Delete(r Resources)
}

type SceneEventNotifier

type SceneEventNotifier struct {
	*BaseEventNotifier
}

func NewSceneEventNotifier

func NewSceneEventNotifier() *SceneEventNotifier

func (*SceneEventNotifier) NotifySceneLoaded

func (n *SceneEventNotifier) NotifySceneLoaded(scene Scene)

func (*SceneEventNotifier) NotifySceneUnload

func (n *SceneEventNotifier) NotifySceneUnload(scene Scene)

type SceneEventObserver

type SceneEventObserver interface {
	OnSceneLoaded(event SceneLoadedEvent)
	OnSceneUnload(event SceneUnloadEvent)
}

type SceneID

type SceneID int

type SceneList

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

A SceneList manages a list of SceneNode items.

func NewSceneList

func NewSceneList(items ...Scene) (l *SceneList)

func (*SceneList) Delete

func (l *SceneList) Delete()

Unlinks all Scene items from this SceneList.

func (*SceneList) Head

func (l *SceneList) Head() *SceneNode

func (*SceneList) Prepend

func (l *SceneList) Prepend(item Scene) (id SceneListID)

func (*SceneList) Remove

func (l *SceneList) Remove(id SceneListID) (err error)

Attempts to remove `item` from the list. Returns ErrSceneNotInList if the ID did not exist in list.

type SceneListID

type SceneListID int

type SceneLoadedEvent

type SceneLoadedEvent struct {
	Scene
}

Fired after the scene has finished loading all resources.

type SceneManager

type SceneManager interface {
	Load(r Resources) (err error)
	AddScene(s Scene) (err error)
	Head() *SceneNode
	Update()
	Render()
	Delete()
}

type SceneNode

type SceneNode struct {
	Scene
	// contains filtered or unexported fields
}

A SceneNode represents a doubly-linked Scene.

func (*SceneNode) ID

func (n *SceneNode) ID() SceneListID

func (*SceneNode) Next

func (n *SceneNode) Next() *SceneNode
func (n *SceneNode) Unlink() (next *SceneNode)

Unlinks the node from the current list. Returns the next node for convenience while iterating.

type SceneUnloadEvent

type SceneUnloadEvent struct {
	Scene
}

Fired before the scene starts unloading all resources.

type SheetType

type SheetType struct {
	*sprites.Sheet
	// contains filtered or unexported fields
}

func (SheetType) Key

func (t SheetType) Key() ResourceKey

type Something

type Something generic.Type

type SomethingList

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

A SomethingList manages a list of SomethingNode items.

func NewSomethingList

func NewSomethingList(items ...Something) (l *SomethingList)

func (*SomethingList) Delete

func (l *SomethingList) Delete()

Unlinks all Something items from this SomethingList.

func (*SomethingList) Head

func (l *SomethingList) Head() *SomethingNode

func (*SomethingList) Prepend

func (l *SomethingList) Prepend(item Something) (id SomethingListID)

func (*SomethingList) Remove

func (l *SomethingList) Remove(id SomethingListID) (err error)

Attempts to remove `item` from the list. Returns ErrSomethingNotInList if the ID did not exist in list.

type SomethingListID

type SomethingListID int

type SomethingNode

type SomethingNode struct {
	Something
	// contains filtered or unexported fields
}

A SomethingNode represents a doubly-linked Something.

func (*SomethingNode) ID

func (*SomethingNode) Next

func (n *SomethingNode) Next() *SomethingNode
func (n *SomethingNode) Unlink() (next *SomethingNode)

Unlinks the node from the current list. Returns the next node for convenience while iterating.

type TexturePackerSheetLoader

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

func NewTexturePackerSheetLoader

func NewTexturePackerSheetLoader(path string, smoothing TextureSmoothing) *TexturePackerSheetLoader

func (*TexturePackerSheetLoader) Key

func (*TexturePackerSheetLoader) Load

func (l *TexturePackerSheetLoader) Load(resources Resources) (res ResourceType, err error)

type TextureSmoothing

type TextureSmoothing core.TextureSmoothing

Jump to

Keyboard shortcuts

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