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.Add("firstScene",
// 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})
oak.Init("firstScene")
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.
- 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.
- 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
typesSprite
- Primitive builders,
ColorBox
,Line
,Bezier
Sequence
for animationsSwitch
for conditionally displaying one other RenderableComposite
for displaying multiple Renderables as one- 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 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
- 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
- Swappable with custom implementations
- Default Implementation: 4 log levels, writes to file and stdout