All Projects → oakmound → Oak

oakmound / Oak

Licence: apache-2.0
A pure Go game engine

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Oak

Korge
KorGE Game Engine. Multiplatform Kotlin Game Engine
Stars: ✭ 780 (-7.91%)
Mutual labels:  game-engine, particles
Black
World's fastest HTML5 2D game engine   🛸
Stars: ✭ 174 (-79.46%)
Mutual labels:  game-engine, particles
Awesome Gideros
A curated list of awesome Gideros resources, classes and tips.
Stars: ✭ 17 (-97.99%)
Mutual labels:  game-engine
Acid
A high speed C++17 Vulkan game engine
Stars: ✭ 838 (-1.06%)
Mutual labels:  game-engine
Cartridge.js
HTML5 retro game engine
Stars: ✭ 23 (-97.28%)
Mutual labels:  game-engine
Coord Rs
[deprecated] A simple, ergonomic vector mathematics crate for Rust
Stars: ✭ 18 (-97.87%)
Mutual labels:  game-engine
Fieldplay
A vector field explorer
Stars: ✭ 922 (+8.85%)
Mutual labels:  particles
Aposelene
Experimental 2D Engine in C
Stars: ✭ 16 (-98.11%)
Mutual labels:  game-engine
Aisvms vis
AIS visualization from an interactive R and Shiny based web app using Material Design from Google.
Stars: ✭ 8 (-99.06%)
Mutual labels:  shiny
Datofutbol
Dato Fútbol repository
Stars: ✭ 23 (-97.28%)
Mutual labels:  shiny
Cross
Cross++ Lightweight Crossplatform Game Engine
Stars: ✭ 26 (-96.93%)
Mutual labels:  game-engine
Shinyappdemo
A demo shiny app inside a package
Stars: ✭ 23 (-97.28%)
Mutual labels:  shiny
Space
A 3D Game Engine by creatorlxd.Use DirectX
Stars: ✭ 19 (-97.76%)
Mutual labels:  game-engine
Swifteventbus
A publish/subscribe EventBus optimized for iOS
Stars: ✭ 937 (+10.63%)
Mutual labels:  eventbus
Excalibur
🎮 An easy to use 2D HTML5 game engine written in TypeScript
Stars: ✭ 892 (+5.31%)
Mutual labels:  game-engine
Aero Engine D3d
An action-based game engine in Direct 3D
Stars: ✭ 7 (-99.17%)
Mutual labels:  game-engine
Iris
Convenient wrapper library to perform network queries using Retrofit and Android Priority Job Queue (Job Manager)
Stars: ✭ 17 (-97.99%)
Mutual labels:  eventbus
Ctmmweb
Web app for analyzing animal tracking data, built upon ctmm R package
Stars: ✭ 22 (-97.4%)
Mutual labels:  shiny
Profugus
A set of radiation transport mini-applications used for performance optimization on HPC systems.
Stars: ✭ 23 (-97.28%)
Mutual labels:  particles
Gparticlesio
Simple IO transfer particles cache in DCC application
Stars: ✭ 8 (-99.06%)
Mutual labels:  particles

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].