A pure Go game engine
Clone or download
Latest commit f488a3a Feb 7, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
alg Package doc correction for intgeom Feb 7, 2018
audio Specify struct field for NotFound Feb 2, 2018
collision Package doc updating Feb 7, 2018
dlog Convert debug levels to uppercase before trying to match them Jan 31, 2018
entities Document ShiftLogicPos Feb 7, 2018
event Decisions on 2.0 todos Jan 21, 2018
examples Spell checking Feb 7, 2018
fileutil Fileutil tests (that don't test wd joining) Sep 22, 2017
key Add a package comment to key Jan 22, 2018
mouse Have mouse events use floatgeom.Point2 Feb 7, 2018
oakerr Update documentation, rename oakerr.NotLoaded to oakerr.NotFound Feb 1, 2018
physics All slides populated Oct 18, 2017
render gofmt -s Feb 7, 2018
scene gofmt -s Feb 7, 2018
shape gofmt -s Feb 7, 2018
timing DRY in dynamic ticker loop Feb 5, 2018
.gitignore Initial commit Jul 15, 2017
.travis.yml Try 2 at coverage Aug 7, 2017
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md Jul 17, 2017
LICENSE Merge Jul 16, 2017
README.md Update README.md Feb 7, 2018
config.go Set internal builtin commands boolean from SetupConfig Jan 16, 2018
config_test.go Add a config variable to enable built in commands Jan 16, 2018
controller.go gofmt -s Feb 7, 2018
cover.sh Add ray to coverage tests Jan 27, 2018
debugConsole.go Add dlog.ErrorCheck uses, otherwise tweak error handling slightly Jan 16, 2018
debugConsole_test.go Remove the 'c' convention for commands in the debug console and un-bl… Jan 14, 2018
default.config add x and y to the default config file Jan 14, 2018
doc.go Report card updates Jul 18, 2017
drawLoop.go Haven't seen a fault panic in months, so we can presumably take out s… Jan 16, 2018
drawLoop_test.go Add a draw loop benchmark Jan 16, 2018
driver.go Add GetLogLevel to dlog SetLogger assignments Jan 16, 2018
fullScreen.go Require that fullscreen / move return errors Jan 16, 2018
init.go Add dlog.ErrorCheck uses, otherwise tweak error handling slightly Jan 16, 2018
inputLoop.go Have mouse events use floatgeom.Point2 Feb 7, 2018
keyBindings.go Report card fixes Aug 29, 2017
keyBindings_test.go Using toml for keybindings Aug 21, 2017
keyStore.go Removed keyholdLoop Sep 7, 2017
keyStore_test.go Removed keyholdLoop Sep 7, 2017
lang.go Doc changes Jan 15, 2018
lang_test.go 68 percent coverage for oak itself, but need to remove oak from travi… Aug 8, 2017
lifecycle.go Adds an explicit quit function Jan 16, 2018
loading.go Added BatchLoad, GestureSupport, and DisableKeyHold options to the co… Jul 31, 2017
logic.go event has significantly more extensible syntax, and oak as a package … Sep 19, 2017
rng.go 20% oak coverage, added Vector.Sub(), mouse.Event.ToVector() Aug 1, 2017
rng_test.go 20% oak coverage, added Vector.Sub(), mouse.Event.ToVector() Aug 1, 2017
scene.go Instead of panicking because the user set a conflicting "loading" sce… Jan 16, 2018
sceneLoop.go Add dlog.ErrorCheck uses, otherwise tweak error handling slightly Jan 16, 2018
scene_test.go Finished scene overhaul pre tests Aug 31, 2017
screenFilter.go Refactoring of mod to prioritize filters over mods Sep 21, 2017
screenshot.go Adds oak.ScreenShot to save the contents of the window as an image Dec 24, 2017
shake.go Have screen shaking start at the current viewport position Dec 24, 2017
viewport.go Moved key constants and event constants to constant strings Nov 1, 2017
viewport_test.go Linting fixes Sep 19, 2017



A pure Go game engine

GoDoc Go Report Card Build Status Code Coverage


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:

    // Initialization function
    func(prevScene string, inData interface{}) {}, 
    // Loop to continue or stop the current scene
    func() bool {return true}, 
    // Exit to transition to the next scene
    func() (nextScene string, result *scene.Result) {return "firstScene", nil}) 

See the examples folder for longer demos, godoc for reference documentation, and the wiki for more guided feature sets, tutorials and walkthroughs.


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 don't own a machine to check with, but hypothetically it supports OSX as well. 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 non-Go 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.)


For talk about the engine or help, that is not significant enough to be an Issue or PR, see the #oak channel on the gophers slack.


  1. Window Rendering
    • Windows and key events forked from shiny
    • Logical frame rate distinct from Draw rate
    • Fullscreen, Window Positioning support
    • Auto-scaling for screen size changes, holding aspect ratio as desired.
  2. Image Management
    • render.Renderable interface
    • Sprite Sheet Batch Loading at startup
    • Manipulation
      • render.Modifiable interface
      • Built in Transformations and Filters
      • Some built-ins via gift
      • Extensible Modification syntax func(image.Image) *image.RGBA
    • Built in Renderable types
      • Sprite
      • Primitive builders, ColorBox, Line, Bezier
      • Sequence for animations
      • Switch for conditionally displaying one other Renderable
      • Composite for displaying multiple Renderables as one
      • History-tracking Reverting
    • Primarily 2D
  3. Particle System
  4. Mouse Handling
    • Click Collision
    • MouseEnter / MouseExit reaction events
    • Drag Handling
  5. Audio Support
    • From klangsynthese
    • Batch Loading
    • Positional filters to pan and scale audio based on a listening position
  6. Collision
    • Collision R-Tree forked 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
  7. Physics System
    • Vectors
      • Attachable to Objects / Renderables
      • Momentum
      • Friction
      • Force / Pushing
  8. Event Handler, Bus
    • PubSub system
    • event.CID can Bind(fn,eventName) and selectively Trigger(eventName) events
    • GlobalBind and event.Trigger for entity-independent
  9. Timing utilities
    • Smoothed draw rate, frame rate tracking
    • FPS conversion to time.Duration
    • Manipulatable time.Ticker to readily change frame rate
  10. 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
  11. Custom Console Commands
  12. Logging
    • Swappable with custom implementations
    • Default Implementation: 4 log levels, writes to file and stdout