go get -u github.com/oakmound/oak/...
On linux, for audio, see klangsynthese for audio installation requirements
This is an example of the most basic oak program:
oak.AddScene("firstScene",
// Initialization function
func(prevScene string, inData interface{}) {},
// Loop to continue or stop current scene
func()bool{return true},
// Exit to transition to next scene
func()(nextScene string, result *oak.SceneResult){return "firstScene", nil})
oak.Init("firstScene")
See the examples folder for longer demos.
The initial version of oak was made to support Oakmound Studio's game, Agent Blue and was developed in parallel. Oak supports Windows with no dependencies and Linux with limited audio dependencies. We hope that users will be able to make great pure Go games with oak and welcome improvements.
Because Oak wants to have as few dependencies as possible, Oak does not use OpenGL or GLFW. We're open to adding support for these in the future for performance gains, but we always want an alternative that requires zero or near-zero dependencies. (We are very sad about the linux audio dependency and are considering writing an audio driver just to get rid of it.)
- Window Rendering
- Windows and key events through shiny
- Logical frame rate distinct from Draw rate
- Image Management
render.Renderable
interface- TileSheet Batch Loading
- Manipulation
render.Modifiable
interface- Built in Shaping, Coloring, Shading, ...
- Some built ins via gift
- extensible Modification syntax
func(image.Image) *image.RGBA
- Copying
- Built in
Renderable
typesSprite
- Sheet
Animation
Sequence
,Compound
,Composite
- History-tracking
Reverting
- Primarily 2D
- Particle System
- Mouse Handling
- Click Collision
- MouseEnter / MouseExit reaction events
- Drag Handling
- Audio Support
- From klangsynthese
- Batch Loading
- Positional filters to pan and scale audio based on a listening position
- Collision
- Collision R-Tree from rtreego
- 2D Raycasting
- Collision Spaces
- Attachable to Objects
- Auto React to collisions through events
- OnHit bindings
func(s1,s2 *collision.Space)
- Start/Stop collision with targeted objects
- Physics System
- Vectors
- Attachable to Objects / Renderables
- Momentum
- Friction
- Force / Pushing
- Vectors
- Event Handler, Bus
- PubSub system
event.CID
canBind(fn,eventName)
and selectivelyTrigger(eventName)
eventsGlobalBind
andevent.Trigger
for entity-independent
- Timing utilities
- Smoothed draw rate, frame rate tracking
- FPS conversion to
time.Duration
- Manipulatable
time.Ticker
to readily change frame rate
- Shaping
- Shapes from
func(x float64) (y float64)
equations - Shapes from
func(x,y,w,h int) bool
containment - Convert shapes into:
- Containment checks
- Outlines
- 2D arrays
- Shapes from
- Custom Console Commands
- Logging
- Controlled by config files
- Filterable by string, debug level
... Pending! See examples or godoc!