A pure Go game engine

Overview

Oak

A pure Go game engine

GoDoc Go Report Card Code Coverage Mentioned in Awesome Go

Table of Contents

  1. Installation

  2. Motivation

  3. Features

  4. Support

  5. Quick Start

  6. Implementation and Examples

  7. Finished Games


Installation

go get -u github.com/oakmound/oak/v2/...

Or in GOPATH mode (not using go modules):

go get -u github.com/oakmound/oak/...

Motivation

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.

Features

  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
  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 covering common use cases
      • Sprite, Sequence, Switch, Composite
      • Primitive builders, ColorBox, Line, Bezier
      • History-tracking Reverting
    • Primarily 2D
  3. Particle System
    • Click to see gif captured in examples/particle-demo

      particles!

  4. Mouse Handling
    • Click Collision
    • MouseEnter / MouseExit reaction events
    • Drag Handling
  5. Joystick Support
    • Click to see gif captured in examples/joystick-viz

      particles!

  6. Audio Support
    • Positional filters to pan and scale audio based on a listening position
  7. 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
  8. 2D Physics System
    • Vectors
      • Attachable to Objects / Renderables
      • Friction
  9. Event Handler, Bus
    • PubSub system: event.CID can Bind(fn,eventName) and Trigger(eventName) events
  10. Shaping
    • 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

Support

For discussions not significant enough to be an Issue or PR, see the #oak channel on the gophers slack.

Quick Start

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.

Implementation and Examples

Platformer

Platformer

Build up to having a simple platforming game by doing the following: Setup a character, get it to move, set basic gravity, get it to jump, make it only jump on solid ground, put it all together.

char := entities.NewMoving(100, 100, 16, 32,
	render.NewColorBox(16, 32, color.RGBA{255, 0, 0, 255}),
nil, 0, 0)
char.Bind(func(id int, nothing interface{}) int {
	char := event.GetEntity(id).(*entities.Moving)

	// Move left and right with A and D
	if oak.IsDown(key.A) {
		char.Delta.SetX(-char.Speed.X())
	} else if oak.IsDown(key.D) {
		char.Delta.SetX(char.Speed.X())
	} else {
		char.Delta.SetX(0)
	}
	oldX, oldY := char.GetPos()
    char.ShiftPos(char.Delta.X(), char.Delta.Y())
	return 0
}, event.Enter)

Top Down Shooter

Learn to use the collision library and make short term shots that collide with the entites marked with collision labels.

Shoota

Radar

Often times you might want to create a minimap or a radar for a game, check out this example for a barebones implementation

Radar

Slideshow

A different way to use the oak engine.

Slideshow

Examples of Finished Games

Agent Blue

AgentBlue

Fantastic Doctor

Fantastic Overview

Fantastic Overview 2

Jeremy The Clam

Clammy

Comments
  • keys autorepeat when held.

    keys autorepeat when held.

    So I have some code like this:

    if k, d := oak.IsHeld(currentControls.Jump); k && (d <= time.Millisecond * 30) {
    	// Do a jump
    }
    

    at first it works fine, but if I keep holding the button, the player will start jumping repeatedly. Is there some way to stop this?

    opened by lolbinarycat 23
  • Browser support through GopherJS

    Browser support through GopherJS

    We've attempted this in the past and the result was that the engine would compile but refuse to start, and then eventually run out of memory drawing nothing. At least some of those issues were related to the tight input and event handling loops not releasing their schedule priority. Who knows about the memory issues.

    enhancement 
    opened by 200sc 17
  • window/camera controls are confusing and don't seem to work.

    window/camera controls are confusing and don't seem to work.

    I've been working on this project, and have been having lots of trouble with the functions that relate to window/screen size. There are a few factors contributing to this.

    1. There are a lot of similar commands, and the difference between them is not well explained. there's ChangeWindow , MoveWindow, SetAspectRatio , SetViewportBounds, SetScreen, and probably more.
    2. I'm using a tiling window manager (specifically i3), so many concepts don't translate well, like screen position. i3 does have floating windows, but you have to use a keyboard shortcut for most windows, although some (like loading windows for programs) open like this automaticaly.
    3. SetFullscreen and SetBorderless don't work. Perhaps related to the previous point?
    4. The game I'm working on requires strict control over the visible area (It has a screen-based camera, like zelda 1)
    5. Many functions often don't work correctly and sometimes crash the program. For example, calling ChangeWindow before oak.Init results in segfault. More problematicaly, SetViewportBounds doesn't seem to properly set viewport bounds, so there is a space between screens that you can't see, (you can tell by holding rightshift, this will center the camera on the player)
    opened by lolbinarycat 16
  • Consider changing Bindable to func(interface{}) int

    Consider changing Bindable to func(interface{}) int

    As far as I know, no event uses both arguments. It would probably be better to only have one field.

    The biggest problem is that of backward compatibility, but I think with the help of some wrapper functions and build options that can be mitigated. This of course would have to wait until v3.

    opened by lolbinarycat 14
  • Quite a number of the examples don't work (on macOS)

    Quite a number of the examples don't work (on macOS)

    See:

    [email protected]
    Sat Sep 11 13:03:29
    ~/tmp/oak
     (master) 130
    $ go run examples/keyboard-test/main.go
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x40d3600]
    
    goroutine 13 [running]:
    image.(*RGBA).Bounds(0x0)
    	/usr/local/Cellar/go/1.17/libexec/src/image/image.go:98
    image/draw.clip({0x41ff7f0, 0x0}, 0xc00010d9a0, {0x41fe9e0, 0xc000078200}, 0xc00010d960, {0x0, 0x0}, 0xc00010d980)
    	/usr/local/Cellar/go/1.17/libexec/src/image/draw/draw.go:85 +0x6f
    image/draw.DrawMask({0x41ff7f0, 0x0}, {{0x0, 0x0}, {0x280, 0x1e0}}, {0x41fe9e0, 0xc000078200}, {0x0, 0x0}, ...)
    	/usr/local/Cellar/go/1.17/libexec/src/image/draw/draw.go:117 +0xa5
    golang.org/x/image/draw.DrawMask(...)
    	/Users/prologic/go/pkg/mod/golang.org/x/[email protected]/draw/draw.go:31
    golang.org/x/image/draw.Copy({0x41ff7f0, 0x0}, {0x0, 0x0}, {0x41fe9e0, 0xc000078200}, {{0x0, 0x0}, {0x280, 0x1e0}}, ...)
    	/Users/prologic/go/pkg/mod/golang.org/x/[email protected]/draw/scale.go:28 +0x1e5
    golang.org/x/image/draw.nnInterpolator.Transform({}, {0x41ff7f0, 0x0}, {0x3ff0000000000000, 0x0, 0x0, 0x0, 0x3ff0000000000000, 0x0}, {0x41fe9e0, ...}, ...)
    	/Users/prologic/go/pkg/mod/golang.org/x/[email protected]/draw/impl.go:113 +0x158
    github.com/oakmound/oak/v3/shiny/driver/mtldriver.(*windowImpl).Draw(0xc0001abdd0, {0x3ff0000000000000, 0x0, 0x0, 0x0, 0x3ff0000000000000, 0x0}, {0x4200098, 0xc0000100c0}, {{0x0, ...}, ...}, ...)
    	/Users/prologic/tmp/oak/shiny/driver/mtldriver/window.go:132 +0xb6
    github.com/oakmound/oak/v3/shiny/driver/internal/drawer.Scale({0x4200278, 0xc0001240f0}, {{0x1, 0x0}, {0x0, 0x0}}, {0x4200098, 0xc0000100c0}, {{0x0, 0x0}, ...}, ...)
    	/Users/prologic/tmp/oak/shiny/driver/internal/drawer/drawer.go:30 +0x110
    github.com/oakmound/oak/v3/shiny/driver/mtldriver.(*windowImpl).Scale(0xc0001240f0, {{0x0, 0x0}, {0x280, 0x1e0}}, {0x4200098, 0xc0000100c0}, {{0x0, 0x0}, {0x280, ...}}, ...)
    	/Users/prologic/tmp/oak/shiny/driver/mtldriver/window.go:144 +0x78
    github.com/oakmound/oak/v3.(*Window).publish(0xc000014800)
    	/Users/prologic/tmp/oak/drawLoop.go:62 +0x15c
    github.com/oakmound/oak/v3.(*Window).drawLoop(0xc000014800)
    	/Users/prologic/tmp/oak/drawLoop.go:22 +0x125
    created by github.com/oakmound/oak/v3.(*Window).lifecycleLoop
    	/Users/prologic/tmp/oak/lifecycle.go:36 +0x1c9
    exit status 2
    

    I haven't looked into why yet...

    opened by prologic 12
  • LayeredPoint should not have GetDims(), and it **really** shouldn't always return 6,6

    LayeredPoint should not have GetDims(), and it **really** shouldn't always return 6,6

    I was wondering why GetDims() on render.CompositeR didn't seem to be working. so I looked for the method definition. Nothing. well, it embeds DrawPolygon, maybe It's on that. Nope. After some searching in the code, I find it, and see this:

    return 6,6
    
    1. It's a point, it dosn't have dimentions
    2. WHAT
    opened by lolbinarycat 11
  • Why isn't .Attatch mutative?

    Why isn't .Attatch mutative?

    The first problem is that it is unclear in the documentation (and most methods in oak are mutative). The only reason I found it out is from looking at physics/attach_test.go. The second is that you have to select down to the Vector field for the object you want to attach. So instead of spr.Attach(entity) you have spr.LayeredPoint.Vector = spr.Attach(entity).

    I understand that this would probably be a breaking change, and would thus have to wait until oak v3, but at least we should update the documentation to make it clearer how to use this function. Also, while we're doing that, we should make it more clear which way the arguments should be supplied (renaming a to attachTo should be enough).

    I also can't think of a single situation where I would prefer the current behavior to a mutative version.

    opened by lolbinarycat 11
  • Feature/audio overhaul

    Feature/audio overhaul

    See #189, and also #131, although the latter is not done yet

    Before this is merged, the new audio system should have implementations for (or spiked and failed for):

    • [x] windows
    • [x] darwin
    • [x] linux
    • [ ] js
    • [ ] android
    opened by 200sc 10
  • was missing key presses, so added GetAndClearLastUpTime() to keyStore.go

    was missing key presses, so added GetAndClearLastUpTime() to keyStore.go

    Not necessary to merge this since I'm using a fork, but offering the PR if you like it.

    I found this new GetAndClearLastUpTime() very useful to avoid missing key presses.

    opened by glycerine 9
  • Q: guidance on avoiding slow/slowing fps?

    Q: guidance on avoiding slow/slowing fps?

    Arg. My screen flickers badly between redraws, and I'm only updating every 1 second. As in, there is a flash of black that is jarring to the eye.

    I'm probably not doing something right. Can you offer any guidance... should I be using sprites or something?

    I'm just getting familiar with oak so I've probably missed something important.

    I extracted out a minimal reproducer here: https://github.com/glycerine/oak-heatmap

    Thanks for any suggestions.

    opened by glycerine 8
  • Q: 100% cpu for examples/platformer-tutorial/1-start

    Q: 100% cpu for examples/platformer-tutorial/1-start

    Hi, oak looks really neat.

    I'm just worried a little about efficiency. I run the examples/platformer-tutorial/1-start example on ubuntu 18.04 under go1.15.7 and it consumes 100% of one cpu... while doing... what looks like nothing.

    Is there a way to make it do "less" busy work?

    The 6-complete does the same, even when I'm not pressing any key.

    opened by glycerine 8
  • Add Debug / Trace logs around OS drivers

    Add Debug / Trace logs around OS drivers

    It would help resolve issues like #171 if we had optionally compilable heavily verbose logs to our lowest-level interfaces for those coders who do not want to modify the library themselves to print out where failures occur.

    enhancement 
    opened by 200sc 0
  • Drop FOSSA?

    Drop FOSSA?

    Every time FOSSA tells us anything about a PR, it's always wrong. Right now it's just alert fatigue and having to go in manually and tell FOSSA "no we aren't importing ffmpeg code" or etc makes our builds red when they aren't (like https://github.com/oakmound/oak/commit/5ba729bd62a02c9540f9385bc048f3d91a717de5, the current commit) and is a bad look.

    opened by 200sc 2
  • JS does not support a Window Scale that is not 1

    JS does not support a Window Scale that is not 1

    If you provide JS with a window scale other than 1, (say, 2), you'll get something like this:

    image

    Where the image is duplicated horizontally, cut in half, because that's the raw byte data we sent the canvas.

    This can be worked around by manually scaling things up yourself for a given game but it's not optimal.

    bug enhancement 
    opened by 200sc 0
  • Should Wiki articles be moved to local readmes?

    Should Wiki articles be moved to local readmes?

    The wiki articles are nice, but they are hard to discover if you aren't explicitly looking for them. Should we move them to readmes? Or should we have readmes that just say 'go look at the wiki'? Or should we have a completely separate documentation site (hosted on oakmound.com?), open source and populated first by those wikis?

    question 
    opened by 200sc 0
Releases(v4.1.0)
  • v4.1.0(Aug 23, 2022)

    This release contains:

    • Better automated testing for JS compliation / builds
    • Improved support for child entities
    • Added floatgeom rect support for the span.Span interface
    • Added helpers to particles to enable working with specific draw stacks.

    Full Changelog: https://github.com/oakmound/oak/compare/v4.0.2...v4.1.0

    Source code(tar.gz)
    Source code(zip)
  • v4.0.2(Jun 11, 2022)

    • This release fixes a bug where the Height() method on a font would not return the default font height for those generated from default settings.

    What's Changed

    • render/font: Enforce default truetype font height for Height() by @Implausiblyfun in https://github.com/oakmound/oak/pull/209

    Full Changelog: https://github.com/oakmound/oak/compare/v4.0.1...v4.0.2

    Source code(tar.gz)
    Source code(zip)
  • v4.0.1(Jun 5, 2022)

    • This release fixes a bug where event bindings that returned event.ResponseUnbindThisBinding were not unbound.

    What's Changed

    • event/internal: Unbind calls now take the current reset of the bus by @Implausiblyfun in https://github.com/oakmound/oak/pull/208

    Full Changelog: https://github.com/oakmound/oak/compare/v4.0.0...v4.0.1

    Source code(tar.gz)
    Source code(zip)
  • v4.0.0(May 21, 2022)

    High level changelog:

    Overall

    • Bump from Go 1.17 to 1.18
    • Operations that would previously fail on an oak window because they were not supported on a specific OS will now fail at compile time instead.
    • Windows, Linux, and OSX have had their window functionality standardized.
    • Examples have been trimmed down and compressed.

    Testing

    • Added Linux AMD64 and Windows AMD64 automated test agents

    Alg Package

    • alg/range has been replaced by alg/span, a genericized version of the package.
    • Intgeom rectangles now implement the alg/span interface. In other words, rectangles can be queried for arbitrary points within them and have points clamped to their boundaries.

    Audio Package

    • The audio and pcm packages have been rewritten from scratch.
    • A program can now select a specific audio driver for a platform. There are minimal options currently, but this can be extended in the future.
    • The pcm package now defines the audio interface in a streamable fashion, and audio defines options for playing back pcm streams.
    • Some functionality has been removed with no current replacement, e.g. Ears, positional filters. They can be re-added in the future.
    • Streaming enables new functionality like FadeIn and FadeOut stream wrappers.
    • Audio format packages can now be compiled in at request instead of always compiled into programs. This should decrease binary sizes of most programs, particularly those not using audio or only using one format.
    • The synth package has additional functionality for manipulating generated waveforms like detuning, combining waveforms, and detecting a waveform's pitch.

    Entities Package

    • This package has been rewritten from scratch to use optional constructors instead of a series of scaling types with additional functionality. entities/x/move has been moved to entities itself.
    • entities/x/btn has been trimmed down to use entities internally instead of its own structures.
    • entities/x/force and entities/x/stat have been removed.
    • entities/x/shake has been promoted to oak/shake.

    Event Handling

    • Event handling has been augmented to support type safe argument handling via generics.
    • The interface for binding and unbinding events, and the internal logic for processing requests, has been overhauled.
    • Example: previously to unbind a specific known binding in collision.Detach, we did this:
    if _, ok := en.(attachSpace); ok { 
    event.UnbindBindable(
    	event.UnbindOption{
    		Event: event.Event{
    			Name:     event.Enter,
    			CallerID: s.CID,
    		},
    		Fn: attachSpaceEnter,
    	},
    )
    }
    

    Now, bindings return a value that can be explicitly used to unbind themselves later:

    if as, ok := en.(attachSpace); ok {
        as.getAttachSpace().binding.Unbind()
    }
    
    • These rewrites eliminate the need for oak.Config.EventRefreshRate.

    Render

    • The build tag nogift can be added to exclude the disintegration/gift dependency and its helper functions.
    • The build tag noimages can be added to exclude registering the standard library's built in image support.

    Scene Handling

    • Scenes no longer have a Loop function. For operations that should happen every frame, the event package is preferred, with helpers like scene.Context.DoEachFrame added. scene.Context.GoToScene and its like are preferred for handling when a scene ends.
    • Scene contexts embed most of their component constructs, and can be provided to the event and render packages as appropriate.

    Changelog by PRs:

    • scene: Embed Eventhandler to allow for some embedded calls by @Implausiblyfun in https://github.com/oakmound/oak/pull/197
    • Feature/v4 eventskeys+examples by @Implausiblyfun in https://github.com/oakmound/oak/pull/199
    • event: overhaul api by @200sc in https://github.com/oakmound/oak/pull/196
    • Feature/v4 shaker+examples by @Implausiblyfun in https://github.com/oakmound/oak/pull/202
    • shiny: overhaul api for v4 by @200sc in https://github.com/oakmound/oak/pull/198
    • Hotfix: OSX ARM colors by @200sc in https://github.com/oakmound/oak/pull/200
    • audio: overhaul api for v4 by @200sc in https://github.com/oakmound/oak/pull/201
    • Feature/v4 entities by @200sc in https://github.com/oakmound/oak/pull/203
    • Doc + refactor pass 1 by @200sc in https://github.com/oakmound/oak/pull/204
    • README: Update the readme to have a few more points added by @Implausiblyfun in https://github.com/oakmound/oak/pull/206
    • Feature/v4 examples by @200sc in https://github.com/oakmound/oak/pull/205
    • Release/v4.0.0 by @200sc in https://github.com/oakmound/oak/pull/207

    Full Changelog: https://github.com/oakmound/oak/compare/v3.4.0...v4.00

    Source code(tar.gz)
    Source code(zip)
  • v4.0.0-alpha.2(Apr 23, 2022)

    This release is a second alpha for Oak v4; this release overhauls the main package, ranges and spans of numbers and points, audio, internal drivers, screen shaking, and the entities package. It also changes from oak/v3 to oak/v4.

    What's Changed

    • Feature/v4 shaker+examples by @Implausiblyfun in https://github.com/oakmound/oak/pull/202
    • shiny: overhaul api for v4 by @200sc in https://github.com/oakmound/oak/pull/198
    • audio: overhaul api for v4 by @200sc in https://github.com/oakmound/oak/pull/201
    • Feature/v4 entities by @200sc in https://github.com/oakmound/oak/pull/203
    • Doc + refactor pass 1 by @200sc in https://github.com/oakmound/oak/pull/204

    Full Changelog: https://github.com/oakmound/oak/compare/v4.0.0-alpha.1...v4.0.0-alpha.2

    Source code(tar.gz)
    Source code(zip)
  • v4.0.0-alpha.1(Apr 2, 2022)

    This release is a first alpha for Oak v4; this release primarily targets the event API, overhauling it to reduce its exposed size, improve efficiency and add type safety with parameterized types.

    Oak v4 currently is planned to overhaul event, audio, internal drivers, and x/entities.

    What's Changed

    • scene: Embed Eventhandler to allow for some embedded calls by @Implausiblyfun in https://github.com/oakmound/oak/pull/197
    • Feature/v4 eventskeys+examples by @Implausiblyfun in https://github.com/oakmound/oak/pull/199
    • event: overhaul api by @200sc in https://github.com/oakmound/oak/pull/196

    Full Changelog: https://github.com/oakmound/oak/compare/v3.4.0...v4.0.0-alpha.1

    Source code(tar.gz)
    Source code(zip)
  • v3.4.0(Mar 12, 2022)

    New Features

    • Overhauls the audio system to support streaming audio on windows, linux, and OSX (https://github.com/oakmound/oak/pull/191)
    • Adds the ability to create persistent bindings that are not removed on scene transition (https://github.com/oakmound/oak/pull/194)

    Tweaks

    • Fixes a bug in alg.WeightedMapChoice where it did not respect input weights correctly (https://github.com/oakmound/oak/pull/195)

    Resolved Issues

    • #189
    • #179
    • #170
    • #131
    • #89

    Full Changelog: https://github.com/oakmound/oak/compare/v3.3.0...v3.4.0

    Source code(tar.gz)
    Source code(zip)
  • v3.3.0(Feb 8, 2022)

    New Features

    • Adds experimental android support (https://github.com/oakmound/oak/pull/188)
    • Adds windows arm64 support (https://github.com/oakmound/oak/pull/184)

    Tweaks

    • Defaults OSFallback to false for JS builds (https://github.com/oakmound/oak/pull/183)

    Full Changelog: https://github.com/oakmound/oak/compare/v3.2.2...v3.3.0

    Source code(tar.gz)
    Source code(zip)
  • v3.2.2(Jan 8, 2022)

  • v3.2.1(Dec 20, 2021)

  • v3.2.0(Dec 11, 2021)

    This release:

    • Enhances floatgeom.Polygon2 with some containment helpers.
    • Fixes LastMouseEvent usage to work with relative mouse events.
    • Adds render.ColorBoxR, a smaller, theoretically more efficient color box which is not modifiable.
    • Adds Driver to oak.Config, to make switching drivers easier.
    • Adds a double buffer to oak's standard draw loop. This theoretically should make drawing both more consistent, and enable drivers which directly render the buffer oak sends without copying it.
    Source code(tar.gz)
    Source code(zip)
  • v3.1.0(Oct 30, 2021)

    This release addresses #13 and #172:

    • Oak now supports targeting WASM+JS for most functionality. There is a new example helper, js-server, which can be used to host and test running other examples in a web browser.
    • To answer the question "what consitutes 'most' functionality?", Oak has new documentation for what specifically is not supported on each potential build target.
    Source code(tar.gz)
    Source code(zip)
  • v3.0.1(Oct 9, 2021)

    Changelog:

    • adds support for detecting keyboard changes on windows, although this is only used internally for now
    • adds AllKeys to the key package, a set of all supported keys.
    • deprecates render.DefFontGenerator in favor of DefaultFontGenerator.
    • drops the keyboard-test example
    • adds debugtools/inputviz package and corresponding examples #169

    Fixes:

    • fixes event.CallerMap persistence when using multiple windows #165
    • respect the context passed into debugtools.DebugMouseRelease
    • adds support for the Insert key on windows (an oversight before)
    • corrects the drawn location of texts drawn with a zero size font
    Source code(tar.gz)
    Source code(zip)
  • v3.0.0(Sep 18, 2021)

    This release marks the final, stable release of oak v3.

    The below changelog notes the delta between this release and the previous oak v3 beta release. For a complete changelog since 2.5.0, see this link.

    Changelog audio

    • The FontManager type has been removed. It was not frequently used and can be trivially introduced as a standalone package.
    • The Cache type has been introduced to handle file loading and caching. Several loading functions have changed to work with this new type and the DefaultCache global variable.
    • GetSounds has been removed.

    oak

    • Assets no longer contains an AssetPath or a FontPath.
    • The Font config type has been removed. Non-default fonts must be manually loaded outside of a base oak config, with a full asset path. This change emphasizes the built in nature of the default font and the reality of font configuration that the color, dpi, and hinting of a font is not often customizable from an end user's perspective.
    • Screen.Scale is now a float64 instead of an int.
    • Most Window methods are now exposed as package level functions on the default window.
    • SetBinaryPayload(func(...), func(...)) is now SetFS(fs.FS)

    debugtools

    • New package, contains common debug helper functions like rendering collision trees and printing mouse position

    dlog

    • Logger.GetLogLevel has been removed. Its hard to imagine a scenario where you would want to query the current log level other than to update it to be more or less verbose-- just set the desired verbosity.
    • Log strings used by oak are now exposed as constants in this package.

    physics

    • All Vector methods now modify Vectors in place. (#115)

    entities/x/mods

    • Adds the Lighter utility to return a lighter version of a color.

    entities/x/shake

    • shake.ShakeScreen has been renamed shake.Screen

    fileutil

    • This package has been stripped down to just be an exposed FS fs.FS, a couple configuration options, and the Open, ReadFile, and ReadDir functions.

    oakerr

    • Language constants have been expanded from two characters to three, matching ISO 639-2 (#53)

    scene

    • Context now contains the current key.State.

    render

    • ParseSubSprite has been removed.
    • LoadSprites has been removed.
    • SetFontDefaults has been removed.
    • LoadSpriteAndDraw has been removed.
    • Font.DrawString has been privatized.
    • Fonts now more accurately determine which elements of a font are undefined runes, e.g. a kanji character in a roman alphabet font.
    • Font and FontGenerators have had their interface significantly adjusted to simplify creation and reduce accidental persistence of one font's qualities or pointer to secondary fonts.
    • The Cache type has been introduced to handle file loading and caching. Several loading functions have changed to work with this new type and the DefaultCache global variable.
    • Batch loading has been rewritten. Alias json files are no longer supported. Individual file names can now hint to the batch loading system that they are a sheet with a particular sheet size, and this will supercede a hint coming from their containing directory. Directories and files now must end in explicitly %dx%d e.g. window64x64.png or /tiles32x32/ to be caught and automatically cached as sheets.

    shiny

    • The default OSX driver has improved feature parity with windows and linux and is substantially more stable.
    Source code(tar.gz)
    Source code(zip)
  • v3.0.0-beta.1(Jul 6, 2021)

    This release marks the second release of oak v3, the first beta.

    See the 3.0.0 project https://github.com/oakmound/oak/projects/2 for notes and issues to be addressed in beta 2, currently anticipated to be the last prerelease of 3.0.0

    Changelog:

    general

    • reduced verbosity of all libraries unnecessary logs have been removed throughout the codebase
    • Several functions which previously logged or ignored errors now return them

    audio

    • 200sc/klangsynthese is now effectively vendored locally. this change is primarily intended to speed up development iteration when working on these dependencies and to make version pinning more straightforward
    • channels, signals, and channel managers have been removed. They were tricky to use correctly and designed toward a specific game, not used by any games since

    collision

    • Added PhaseCollisionWithBus
    • Moved CallOnHits to be a method on a Tree
    • ReactiveSpace can now take in a Tree, and its methods are concurrent safe
    • NewEmptyReactiveSpace has been removed
    • CID is now IDTypeCID
    • PID is now IDTypePID
    • Space.String() has been removed
    • Space.SetZLayer(float64) has been added

    debugstream

    • A new package that contains utilities for adding command line debug commands. Not intended to be a full-fledged CLI builder, just enough for some helper tools.

    dlog

    • SetDebugFilter has been renamed SetFilter
    • filter strings are now func(string) bool, instead of picking between regex matching and containment.
    • Warn has been removed
    • SetLogger has been removed
    • Exposed DefaultLogger, setting this replaces SetLogger
    • Logger and FullLogger interfaces are now combined
    • CreateLogFile has been removed
    • SetDebugLevel has been renamed SetLogLevel
    • FileWrite has been removed
    • SetOutput has been added, replacing FileWrite and CreateLogFile

    entities

    • Removed String methods from all entities

    entities/x/btn

    • Added Destroy to Btn
    • DisallowRevert is now flipped to AllowRevert

    entities/x/force

    • Now accepts *scene.Contexts

    entities/x/shake

    • New package from oak/shake.go, can generically shake screens + anything

    event

    • Bus.ResolvePending has been renamed to Bus.ResolveChanges
    • event Busses now take a CallerMap reference
    • Enter events now take an EnterPayload, containing total frames, time since last frame, and proportionally how that time compares to the expected average tick time
    • Added TriggerCIDBack

    examples

    • New example click-propagation demoing mouse click layers
    • New example clipboard, using github.com/atotto/clipboard
    • New example svg demonstrates using svg helper libraries
    • fallback-font has its dependencies in its own go module
    • joystick-viz now demonstrates joystick deadzones
    • top-down-shooter part 6 has been modified to use new event enter frame details and DoBetweenDraws
    • Removed cliffracers example

    joystick

    • Stick changes can be isolated to only propagate if they exceed a deadzone threshold

    mouse

    • Mouse bindings now take in a (*mouse.Event) instead of a (mouse.Event)
    • Event now has a StopPropagation boolean which, when set, will stop mouse collision spaces beneath the one triggered on from receiving the event.
    • Mouse gestures, unused, have been removed, for now.

    oak

    • Added SkipRNGSeed to Config, a setting which will skip calling math/rand.Seed if set.
    • debug console functionality has been moved to debugstream
    • the default controller is now lazily initialized
    • Controllers have been renamed to Windows
    • Added Window.DoBetweenDraws, which will confine a function to be called in between screen draws.
    • Joystick is now InputTypeJoystick
    • KeyboardMouse is now InputTypeKeyboardMouse
    • trackInputChanges now propagates InputChange events
    • the engine will more reliably exit with a clean error if it cannot proceed during initialization
    • Shake functionaltiy has moved to entities/x/shake

    oakerr

    • Language constants now match ISO 639-1

    render

    • NewStrText is now NewText, the old NewText now NewStringerText
    • Added ToSprite to CompositeR
    • Removed DrawForTime (see scene context)
    • Removed draw polygons
    • DrawToScreen now accepts a *intgeom.Point2 for the viewport position
    • Removed FontManager

    render/particle

    • Allocators can now be stopped

    scene

    • Added DoAfter, DoAfterContext, and DrawForTime to Context

    shiny

    • noop build tag has been renamed nooswindow
    • Added GetCursorPos to windows/osx
    • Fixed bug where closed windows would stop oak, but not actually close the window on linux
    • Fixed potential race on window intialization on linux

    timing

    • Removed DynamicTicker, built in *time.Tickers support our use of these since Go 1.15.
    • Removed DoAfter and DoAfterContext, moved to scene package
    Source code(tar.gz)
    Source code(zip)
  • v3.0.0-alpha.1(May 23, 2021)

    This release marks the first release of oak v3, an early alpha where much but not all of the engine has been overhauled.

    The following packages are in a state we are happy with in oak v3, and we do not expect them to change substantially: render (and its subpackages) mouse collision shiny (new, brought in from oakmound/shiny) alg event key oakerr physics scene shape timing

    The main package, oak, is in a mostly good place, but some components like the debug console will likely be moved elsewhere before a stable v3 release.

    The joystick package needs to be reevaluated with respect to supporting more controllers before v3 is stable.

    The dlog package will still be significantly adjusted, to emphasize it is not meant to be a one-stop-shop logging solution, but just a 'here's what the engine will log to' destination.

    The audio and entities packages have not been sufficiently reviewed to where we can say they will not change before v3 is stable.

    We currently anticipate an Alpha 2 and Beta 1 release before a final Stable release.

    Changelog:

    overall

    • The Gopkg.lock and Gopkg.toml files, used for dep, have been removed. Dep has been deprecated and archived.
    • Throughout the project, tests have been expanded, and use of github.com/stretchr/testify has been removed.
    • Throughout the project, errors returned by packages are more regularly errors from the oakerr package.

    alg

    • RemainingWeights has been renamed to CumulativeWeights, and the old CumulativeWeights function has been removed.

    alg/floatgeom

    • Added the Polygon2 type.

    alg/range

    • New package, a port of github.com/200sc/go-dist, representing ranges of colors, integers, and floats

    audio

    • DefFont has been renamed to DefaultFont
    • DefChannel has been renamed to DefaultChannel
    • DefActiveChannel has been renamed to DefaultActiveChannel
    • DefPlay has been renamed to DefaultPlay
    • Added FontManager.GetDefault to get the manager's default channel
    • Fixed a bug in blank audio loading where the provided "blank" audio was invalid PCM

    collision

    • DefTree has been renamed DefaultTree
    • Attach now takes a *Tree argument, and no longer binds to priority -1
    • PhaseCollision now takes a single *Tree which can be nil instead of a variadic set
    • NewTree now takes no arguments and cannot error. The old NewTree with custom node sizes has been renamed to NewCustomTree
    • Fixed a bug where With would return nil spaces

    entities/x/btn

    • Added the Label(collision.Label) option

    event

    • Event bindings in the built in bus no longer support priority levels, as they were virtually unused
    • Added the Empty helper, for when a Bindable does not care about its arguments or return value
    • GlobalBind and Bind now take string, Bindable as their argument order, formerly Bindable, string
      • We felt Bind(EventName, func(){}) read better, especially with larger functions
    • Bindables now accept CID, interface{} instead of int, interface{}
    • The global caller list is now built into the CallerMap type
    • Many methods that used to be optional in a Handler are now required

    examples

    • Many new examples have been added and most existing examples have been tweaked

    key

    • Added the State type, encompassing key down/up/held states, which used to be global to the oak package.

    mouse

    • Added the Binding helper, converting a weakly typed interface{} payload into a mouse.Event type
    • DefTree has been renamed to DefaultTree
    • Buttons are now strongly typed

    oakerr

    • Errors now can be formatted to multiple languages
    • Several redundant error types have been removed

    render

    • Noisebox has been removed
    • Scrollbox has been removed
    • The Polygon type now uses floatgeom.Polygon2
    • Fonts are now copied several times as they are passed around, to enforce that the same font is not used to draw two pieces of text at once, which can panic
    • DrawOffset on Renderables has been removed and Draw has taken on its arguments (x and y offsets)
    • Texts are now drawn from the top left, like all other Renderables.
    • Fonts can now be provided fallback fonts, which they will try to use to render characters that would be rendered as an undefined character
    • Font.Generate can now return an error
    • OverlaySprites takes a slice of pointers instead of structs
    • ShinySet has been removed
    • ShinyOverwrite has been renamed to OverwriteImage
    • ShinyDraw has been renamed to DrawImage
    • Stackables have been changed to an interface that can be externally used, by removing private methods
    • Stackables now have a Clear method
    • FPS types are now Renderables instead of Stackables
    • Deprecated methods have been removed
    • DefFont is now DefaultFont

    render/mod

    • gift.Resampling is now aliases as the local Resampling type

    render/particle

    • Added the Allocator type to contain particle allocation requests

    scene

    • Scene start functions now take in (*scene.Context) as their only argument, a new struct containing everything a scene should need to render, bind, modify the window, etc

    shiny

    • New package, brought in from github.com/oakmound/shiny
    • Oak programs shouldn't need to directly interact with shiny other than to decide which driver to use, if not using the default

    timing

    • FPSToDuration has been renamed to FPSToFrameDelay
    • Added FrameDelayToFPS

    window

    • New package, handling the interface between scene and oak.Controller

    oak

    • Setup... constants have been removed and folded into the Config struct
    • Config.EventRefreshRate can now be properly unmarshaled from JSON
    • Added Config.IdleDrawFrameRate, controlling how often the screen will redraw when it does not have focus
    • Config creation and loading has been overhauled, using NewConfig and functional option loaders, FileConfig and ReaderConfig
    • Added the Controller type, containing old package globals and enabling running multiple oak windows simultaneously
    • Most public functions in the package are now methods on Controllers, in addition to default oak.<Method> helpers, which will redirect to a default controller
    • The draw loop has been substantially simplified
    • Backgrounds can now be any type that have GetRGBA() *image.RGBA, enabling complex or animating backgrounds
    • Init now takes in a variadic set of ConfigOptions, so patterns that used to setup config, then oak.Init(scene) now will look like oak.Init(scene, func() {setup config})
    • Shiny gestures are no longer supported at the input loop layer, as they were fundamentally unused. This could be revisited
    • We now propagate the event.FocusLoss and event.FocusGain events on appropriate window changes
    • Key events now have a key.Event payload instead of a string payload
    • Mouse events now trigger both an absolute and Relative event, the latter taking into account the viewport position
    • Keybindings have been removed as they did not cooperate well with other key refactoring. This will be revisited
    • Language constants have moved to oakerr, and are in progress
    • Added UpdateViewSize, to enable resizing the rectangle rendered within the client window
    • SeedRNG is no longer public, and no longer logs excessively
    • Removed Add, preferring AddScene
    • DefShaker has been renamed to DefaultShaker
    • Added HideCursor, ShowNotification, and SetTrayIcon window methods
    Source code(tar.gz)
    Source code(zip)
  • v2.5.0(Feb 25, 2021)

    2.5.0 Changelog:

    Debug Console:

    • Adds DisableDebugConsole configuration option on startup.
    • Adds the help built in debug command to print possible commands.
    • Adds oak.RunCommand() to simulate a debug console instruction.

    Event Bus:

    • Adds EventRefreshRate configuration option on startup.
    • The event.Bus type now supports being given a specific refresh rate, instead of having busy waiting on any pending bind or unbind requests.
    • event.Bus.ResolvePending() had a goroutine leak, and this has been fixed.

    Batch Loading:

    • Batch loading can now be configured to replace large images and audio files with blank versions, for faster test iteration in development.
    • Batch loading is now parallelized.

    Buttons:

    • Adds additional text helpers for entities/x/btn constructors.
    • Adds support for cutting buttons into shapes.

    Misc:

    • Adds render/mod.CutShape().
    • Adds oak.SetTitle() to change the running window title.
    • Adds audio.Audio.SetVolume to change a running audio's underlying volume level.
    • render.Text.ToSprite() has additional safety. Sometimes if a font or text changes in the middle of a ToSprite call it could panic deep inside of our font dependency. The font is now copied ahead of time to reduce this risk.
    Source code(tar.gz)
    Source code(zip)
  • v2.4.0(Aug 15, 2020)

    2.4.0 Changelog:

    buttons:

    • support fitting text within the button

    collision:

    • added a helper for 2d rectangular spaces.

    config:

    • added option for targeting a specific screen pixel ratio width/height when not in fullscreen (helps for osx retina displays)

    dlog:

    • added an example for non-default logger (regex logger)
    • small efficiency boost to standard logger
    • ErrorCheck now returns the error consumes

    oak: -viewports can now be shifted by a relative amount rather than having to be set to an absolute location with ShiftScreen

    • improved screenshake logic
    • expose keypress functionality to allow for software simulated keyboard interactions

    render:

    • our default font is now baked into our binary, to support use while vendoring.
    • added NewStrPtrText to Font.
    • added Reverting.Get to support sub Switch types.
    • added Polygon.GetThickOutline
    • added Polygon.GetGradientOutline
    • added Polygon.GetColoredOutline
    • added ParticleLimit to particle generators
    • added particle.InfiniteLifeSpan generation option
    • added NoopStackable, for tests to disable rendering anything.
    • added mod.StripOuterAlpha
    • renamed NewLineColored to NewColoredLine. The old name is deprecated for removal in 3.0.
    • added Replace, analogous to Draw, to replace one renderable with another without dropping frames.
    • renamed DrawPolygon.DrawPolygonDim to DrawPolygonBounds. The old name is deprecated for removal iun 3.0
    • composite updates to allow for subslices of compositeM and have compositeR implement stackable

    scene:

    • scenes will now use default NOP scene functions for start, loop, and end, if sent nil.

    timing:

    • added DoAfterContext

    dependencies:

    • upgrade to use new shiny 0.4.2 https://github.com/oakmound/shiny/releases/tag/v0.4.2
    • upgrade to use klangsynthese 2.1.0 https://github.com/200sc/klangsynthese/releases/tag/v0.2.1

    examples:

    • new examples were added illustrating viewport locked rooms, zooming on renderables, capturing keyboard presses
    Source code(tar.gz)
    Source code(zip)
  • v2.3.3(Mar 11, 2020)

  • v2.3.3-beta(Mar 6, 2020)

  • v2.3.2(Jan 25, 2020)

    Oak version 2.3.2 updates the project's go modules files and imports to resolve import issues with go modules and enable go getting without too much effort to work around modules (with crossed fingers).

    Source code(tar.gz)
    Source code(zip)
  • v2.3.2-beta-2(Jan 25, 2020)

  • v2.3.2-beta(Jan 7, 2020)

  • v2.3.1(Sep 15, 2019)

    Changelog:

    • Travis CI is replaced with Github Actions
    • entities/x/btn supports storing and retrieving arbitrary metadata
    • dep / go modules files updated
    • A new fork of libudev is being used to accomodate a bug in go modules
    • Adds oak.RecordGIF
    • Adds oak.Config.TrackInputChanges for switching between joystick and key/mouse controls
    • Adds oak.GetViewportBounds and oak.RemoveViewportBounds
    • Use of custom polygon clipping algorithms in render.DrawPolygon
    Source code(tar.gz)
    Source code(zip)
  • v2.3.0(Aug 17, 2019)

  • v2.3.0-beta.0(Jul 26, 2019)

    Beta release for 2.3.0, pending some more examples / tests / benchmarks.

    2.3.0 Changelog:

    Overall:

    • Improved test coverage
    • Updated example READMEs

    alg:

    • Added standard direction helpers
    • Allow usage of a rand other than the default rand

    Collision:

    • Minor refactoring

    oak:

    • Added new screen controls
    • New debug commands

    joystick:

    • Joystick support added

    render:

    • Add some missing methods
    Source code(tar.gz)
    Source code(zip)
  • v2.2.0(Mar 23, 2019)

    2.2.0 Changelog:

    collision:

    • Added Size method to rtrees.
    • Deprecated UpdateLabel Method.
    • Fixed race condition bug in UpdateSpace and UpdateSpaceRect, these methods will now return an error if attempting to update a space that does not exist in the tree.

    entities:

    • Added GetReactiveSpace to the Reactive type.

    entities/x:

    • General bug fixes
    • force/NewHurtColor and force/NewHurtDisplay now take a variadic set of layers
    • Added move/ShiftX and move/ShiftY

    examples:

    • Corrected the particle demo to use 2.0.0 commands

    render:

    • Added ToSprite to CompositeM
    • Corrected default font access
    • NewSheetSequence now returns an error if given invalid frames
    • Sprites now satisfy stdlib draw.Image
    • bugfix: Sprite copies now don't reuse the same pixel slice
    • Switch.Set returns an oakerr.NotFound instead of oakerr.InvalidInput

    scene:

    • Added GoToPtr, taking a string pointer as the next scene to run
    Source code(tar.gz)
    Source code(zip)
  • v2.1.0(Mar 4, 2019)

    Full Changelog:

    Overall:

    -Added dependency tracking files for dep and go modules

    alg:

    • Added floatgeom.Point4, mirroring Point3/2
    • Added Cross to floatgeom.Point3 to calculate cross products
    • Added Shift and Center to floatgeom.Rect2/3 and intgeom.Rect2/3
    • Added TriangulateConvex utility for converting polygons into a slice of triangles by vertex index

    oak:

    • Added ResetCommands to remove all debug console commands.

    entities/x:

    • The subpackages here are meant to be experimental extensions of existing oak functionality. These aren't bound to the versioning compatibility requirements, but packages here are candidates to be moved out of x and made a part of versioning compatibility.
    • Added the btn package, an experimental UI package for quick menu and button creation.
    • Added the force package, containing utilities for imparting directionality with collisions.
    • Added the 'mods' package, containing expanded color and Modifiable manipulation functions.
    • Added the 'move' package, containing quick-start entity movement control functions like WASD.
    • Added the 'stat' package, extending event tracking to also track incremental statistics over a game's life.

    event:

    • Added the Caller interface to cover entities composed with CIDs.
    • Added the ScanForEntity utility, allowing searching for arbitrary entities by function matching.
    • Added the 'OnStop' event for when the engine is closed.

    examples:

    • Added the radar-demo package, demonstrating how to write custom renderables and point tracking with a radar UI element.

    key:

    • Added Period as a duplicate of FullStop
    • Added KeyHeld to track when a key triggers repeats by being held down for long enough.

    render:

    • Added DrawPoint to draw single pixels.
    • Added 'LoadSprites' utility combining LoadSheet and ToSprites.

    scene:

    • Added utilities BooleanLoop and GoTo for common Loop and End scene functions.

    shape:

    • Added Condense, which finds a minimal set of rectangles covering a given shape.
    • Added Points, representing a shape via a set of (x,y) points.
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Feb 7, 2018)

    Full Changelog: alg:

    • alg has several new operations for working with degrees and radians.
    • alg/floatgeom has several new operations on points, including Normalize, Magnitude, Dot, DivConst, and Project<X/Y/Z>
    • alg/floatgeom now has a Triangle type, with minimal current functionality.
    • alg/intgeom is now parallel in API to alg/floatgeom, with only some functions that relied on floating point math removed.
    • alg has the new function F64eqEps which allows for the specification of the epsilon used for floating point equality.
    • alg.WeightedChoose has been removed.
    • alg.CumWeightedChooseOne has been renamed to alg.WeightedChooseOne.
    • alg.CumWeightedFromMap has been renamed to alg.WeightedMapChoice.
    • alg.RemainingWeights has been added, alike to alg.CumulativeWeights, but with a change to the position of the total weight index.

    audio:

    • audio.Audio.Get<X/Y>() have been renamed to <X/Y>p().
    • audio.SupportsPos has been changed to require Xp() and Yp() in accordance.
    • Several errors returned by audio have been changed to oakerr error types.

    collision:

    • The library github.com/200sc/rtreego, which was a fork of a fork, has been brought into Oak entirely and operates directly on collision struct types instead of on interfaces. Some math functionality required for this was split off and brought into alg/floatgeom instead. These files are subject to the rtree-LICENSE license file.
    • collision.Point is now composed of floatgeom.Point3 instead of physics.Vector
    • The subpackage collision/ray has been added to replace previous ray casting functionality.
    • All previous raycasting functionality has been removed, use collision/ray instead.
    • Previous rtreego.Rects have been replaced with floatgeom.Rect3s.
    • collision.Space.GetX() and GetY() have been renamed to X() and Y().
    • collision.Tree.UpdateLabel and collision.Tree.UpdateSpaceRect have been added
    • Several errors returned by collision have been changed to oakerr error types.

    dlog:

    • Previous dlog functionality is now built into the private logger type, which will be used by default.
    • dlog.SetLogger allows for the specification of a user-made logger to replace the private type. Either Logger or FullLogger, a superset of Logger, can be implemented by arguments to SetLogger.
    • Log levels now have an explicit type, dlog.Level.
    • Disabling logging with the nolog build tag has been disabled, use a NOP custom logger implementation instead.
    • Input debug level strings are no longer case sensitive.

    entities:

    • Almost all constructors in this package have changed to accommodate the ability to set the collision.Tree of created collision.Spaces, or for more realistic use in examples.
    • Several miscellaneous utilities have been added to the existing types here.

    event:

    • Operations on this package now operate on a default event.Bus type, and custom event buses can be constructed for more fine management of event propagation. Events on event.CIDs operate on this default bus as well.
    • The event.Handler interface has been added and can be used to replace the event package with a custom event handler from within the main Oak package.

    examples:

    • Many new examples have been added. Some of these were previously external repositories.

    fileutil:

    • fileutil.ReadFile uses the same double-checking that fileutil.Open has used if filepath.Rel fails.

    mouse:

    • mouse.LastMousePress has been renamed mouse.LastPress
    • mouse.LastMouseEvent has been renamed mouse.LastEvent
    • mouse.Event is now composed of a floatgeom.Point2 instead of manual X and Y fields.
    • mouse.NewEvent and mouse.NewZeroEvent helpers for constructing mouse events have been added.
    • Event.ToSpace() has been added, to convert a mouse event into a miniscule collision space.
    • "Click" events will be properly triggered now.

    oakerr:

    • Several new error types have been added.

    physics:

    • Vector.GetX() and Vector.GetY() have been removed.
    • NewVector32 and PtrVector have been added as additional constructors for physics.Vectors.

    render:

    • Renderable.UnDraw is now Undraw
    • render.Animation has been removed and folded into render.Sequence.
    • render.Composite had been renamed to render.CompositeM.
    • Support for adding custom image decoders has been added through render.RegisterDecoder.
    • Package global NewText constructors have been added as equivalent to render.DefFont.NewText, etc.
    • render.Draw, render.DrawColor, render.DrawForTime, and render.LoadSpriteAndDraw now take in a variadic set of layers.
    • render.Addable has been renamed to render.Stackable.
    • Addable/Stackable.Add now takes in variadic layer arguments.
    • render.SetDrawPolygon and other DrawPolygon functions have been moved to a struct.
    • render.ReplaceDraw has been removed.
    • render.Layered has been renamed to Layer.
    • render.Layered is now an interface describing layering functionality.
    • render.DrawLineOnto has been renamed to render.DrawLine
    • render.LoadSprite, render.LoadSheet, render.GetSprite, and render.GetSheet have all new signatures and functionality to be more consistent.
    • render.Modification has been changed to render/mod.Mod, and is now paired with render/mod.Filter, for transformations that operate in place.
    • All render.Modification functions that were in render can now be found in render/mod
    • Several constructors that previously took slices in render now take variadic inputs.
    • render.BoundingRect and render.WrappingContains have been removed.
    • render.Positional is a new interface that describes the positional requirements of a Renderable.
    • render.Sequence now have the function SetFPS to change animation speed after initialization.
    • Previous Animation functionality is now in the constructor NewSheetSequence.
    • render.Sheet can be converted to a 2D slice of sprites through ToSprites.
    • render.Compound has been renamed to render.Switch.
    • Many errors are now using oakerr error types.

    render/mod:

    • Previous render.Modifications have been split into two categories, Transforms or Mods, that create new images, and Filters, that operate in place.
    • Several new modifications are present here, many from gift.

    render/particle:

    • Particles no longer have String functions.
    • In addition to Size, generators now have an EndSize field for shifts in size over the particle lifespan.

    scene:

    • This is a new package which holds functionality previously in the Oak main package. No additional functionality relative to what was previously in the main package has been changed or added, except that private functions on scene maps have been exported.

    timing:

    • ForceStep has been added to timing.DynamicTicker, which acts just as Step but will block until the tick is accepted (if it ever is).

    oak:

    • Config.DisableKeyhold has been removed. Keyhold functionality is always on, as it no longer has a significant perfomance hit.
    • Config.LoadBuiltinCommands has been added. In order to use the built in commands described in the debugConsole files, this must be true.
    • Screen.X and Screen.Y have been added for managing the initial position of a screen.
    • All uses of "golang.org/x/exp/shiny" have been replaced with "github.com/oakmound/shiny"
    • AddCommand will now return an error if a command added would overwrite an existing command.
    • Two new builtin commands move and fullscreen, for moving the position of the window and toggling fullscreen mode, have been added.
    • Added Commands no longer use the prefix c. They no longer have any prefix, a function bound to foo will be triggered by the command line input of foo. Built in commands can fail to be added if you already use their names in a user command.
    • Driver is a new function type allowing Oak to be built on top of any underlying graphics / window management driver. By default, this will use shiny's Main driver, which itself splits to different drivers depending on OS. Shiny provides an alternative, which we do not include in Oak (as it uses C) but do note the existence of, that uses OpenGL ES: shiny/driver/gldriver.Main.
    • The FullScreenable interface and SetFullScreen have been added to manage window full screen support.
    • The MoveableWindow interface and MoveWindow have been added to manage manual window positioning.
    • SetLogicHandler can be used to overwrite the use of the oak/event package with custom event handling.
    • All Oak operations relating to scenes can now be found in the scene package, with the exception of Add and AddScene.
    • Oak's previously private scene map has been exported as SceneMap.

    Breaking API Changelog:

    • All previous uses of alg/intgeom will be almost certainly invalid now, as almost all types and functions in the package have changed signatures. This also applies for libraries in oak that used intgeom, such as shape.
    • alg.WeightedChoose has been removed.
    • alg.CumWeightedChooseOne has been renamed to alg.WeightedChooseOne.
    • alg.CumWeightedFromMap has been renamed to alg.WeightedMapChoice.
    • audio.Audio.Get<X/Y>() have been renamed to <X/Y>p().
    • audio.SupportsPos has been changed to require Xp() and Yp() in accordance.
    • All previous raycasting functionality has been removed, use collision/ray instead.
    • collision.Space.GetX() and GetY() have been renamed to X() and Y().
    • oak.Config and the structs underlying it have had several changes.
    • Added Commands no longer use the prefix c. They no longer have any prefix, a function bound to foo will be triggered by the command line input of foo. Built in commands can fail to be added if you already use their names in a user command.
    • Disabling logging with the nolog build tag has been disabled, use a NOP custom logger implementation instead.
    • Almost all constructors in the entities package have changed to accommodate the ability to set the collision.Tree of created collision.Spaces, or for more realistic use in examples.
    • All Oak operations relating to scenes can now be found in the scene package, with the exception of Add and AddScene.
    • physics.Vector.GetX() and physics.Vector.GetY() have been removed.
    • render.Animation has been removed and folded into render.Sequence.
    • render.Composite had been renamed to render.CompositeM.
    • render.Draw, render.DrawColor, render.DrawForTime, and render.LoadSpriteAndDraw now take in a variadic set of layers.
    • render.Addable has been renamed to render.Stackable.
    • render.Addable/Stackable.Add now takes in variadic layer arguments.
    • render.SetDrawPolygon and other DrawPolygon functions have been moved to a struct.
    • render.Layered has been renamed to Layer.
    • render.DrawLineOnto has been renamed to render.DrawLine
    • render.LoadSprite, render.LoadSheet, render.GetSprite, and render.GetSheet have all new signatures and functionality to be more consistent.
    • render.Modification has been changed to render/mod.Mod, and is now paired with render/mod.Filter, for transformations that operate in place.
    • All render.Modification functions that were in render can now be found in render/mod
    • render.BoundingRect and render.WrappingContains have been removed.
    • render.Compound has been renamed to render.Switch.
    • Renderable.UnDraw is now Undraw.
    • Several constructors that previously took slices in render now take variadic inputs.
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-beta.0(Jan 22, 2018)

    This is an release candidate for Oak 2.0. We're looking for feedback on, specifically, breaking API changes before making a full release.

    Changelist from 1.5 to follow.

    Source code(tar.gz)
    Source code(zip)
Owner
Oakmound Studio
Oakmound Studio
AircraftWar - a game powered by Go+ spx game engine

AircraftWar - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download thi

GoPlus 1 Jan 5, 2022
FlappyCalf - a game powered by Go+ spx game engine

FlappyCalf - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this

GoPlus 3 Nov 6, 2022
FlappyCalf - a game powered by Go+ spx game engine

FlappyCalf - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this

GoPlus 3 Nov 6, 2022
MazePlay - a game powered by Go+ spx game engine

MazePlay - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this g

GoPlus 1 Dec 16, 2021
A simple game that I created with Ebiten game library as a way to teach myself Go. Enjoy!

galactic-asteroid-belt Overview A simple game that I created with Ebiten game library as a way to teach myself Go. Enjoy! Run To run, you will need Go

null 0 Dec 2, 2021
RundQuiz-Game - This is a Go exercise that implements and builds a quiz game from a list of math questions in a CSV file.

Go RundQuiz Game Exercise details This exercise is broken into two parts to help simplify the process of explaining it as well as to make it easier to

IkehAkinyemi 0 Jan 5, 2022
Simple 2D game to teach myself various things about game development and ECS, etc

2d-grass-game I really don't know what to name this game. Its a big grass field, and its in 2d so....2D Grass game This is a simple 2D game to teach m

James Wynne III 1 Jan 17, 2022
Engo is an open-source 2D game engine written in Go.

Engo A cross-platform game engine written in Go following an interpretation of the Entity Component System paradigm. Engo is currently compilable for

Engo 1.6k Nov 14, 2022
Go 3D Game Engine

G3N - Go 3D Game Engine G3N (pronounced "gen") is an OpenGL 3D Game Engine written in Go. It can be used to write cross-platform Go applications that

G3N - Go 3D Game Engine Repositories 2.2k Nov 27, 2022
Scalable Distributed Game Server Engine with Hot Swapping in Golang

GoWorld Scalable Distributed Game Server Engine with Hot Reload in Golang Features Architecture Introduction Get GoWorld Manage GoWorld Servers Demos

Nan Lin 2.2k Dec 1, 2022
Terminal-based game engine for Go, built on top of Termbox

Termloop Termloop is a pure Go game engine for the terminal, built on top of the excellent Termbox. It provides a simple render loop for building game

Joel Auterson 1.3k Nov 13, 2022
A 2D ARPG game engine.

Abyss Engine is an ARPG game engine in the same vein of the 2000's games, and supports playing games similar to Diablo 2. The engine is written in golang and is cross platform. This engine does not ship with game specific files, and will require a game's assets in order to run.

OpenDiablo2 59 Nov 22, 2022
A small fantasy game engine in WASM using GoLang

The GoLang Fantasy Engine (GoLF Engine) is a retro game engine. It draws inspiration from fantasy console projects like pico-8, tic-80, and pyxle. Like those projects it is designed to be a retro-feeling game creation/playing tool. Unlike those projects GoLF is more minimal in scope and only provides an API and a small set of tools to help you create your games. Tools like an image editor and code editor are not built in. Despite this minimalism creating games in GoLF is still easy and should still maintain the retro game feel.

Brandon Atkinson 87 Jul 16, 2022
golang powered game engine

Gobatch Go powered engine that offers features from low level opengl abstraction to UI framework. I created this to separate lot of logic from game am

Jakub Dóka 43 Nov 13, 2022
spx - A 2D Game Engine for learning Go+

spx - A 2D Game Engine for learning Go+ Tutorials How to run spx tutorials? Download Go+ and build it. See https://github.com/goplus/gop#how-to-build.

GoPlus 77 Dec 1, 2022
Go Game Engine using SDL for fun

nMage nMage is a (hopefully!) high performance 3D Game Engine written in Go being developed live, with recordings posted on YouTube. This project is b

Omar Mahdi 58 Oct 23, 2022
HelloSpx - Hello world of Go+ spx game engine

HelloSpx - Hello world of Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this game

null 1 Nov 27, 2021
HelloWorldForSpx - Hello world of Go+ spx game engine

HelloWorldForSpx - Hello world of Go+ spx game engineHelloWorldForSpx - Hello world of Go+ spx game engine

孙其瑞 3 Nov 22, 2021
build and animate objects according to verlet physics. pure golang library

verlet build and animate objects according to verlet physics. pure golang library Examples depend on pixel library, see requirements to build them: wo

Paolo Calao 23 Sep 8, 2022