Ebiten 1.8, a 2D game library in Go, is here with experimental WebAssembly support and newly added APIs

The Go team has released version 1.8 of its 2D game library called Ebiten, yesterday. Ebiten 1.8 comes with new features such as experimental WebAssembly Port, newly added APIs, and bug fixes among other updates.

Experimental WebAssembly Port

The Go team has added a WebAssembly port to Ebiten 1.8, but this is still in the experimental phase. This new feature compiles to a single WebAssembly module including the Go runtime for goroutine scheduling, garbage collection, maps, and other Go essentials, that results in a module of at least 2MB, or 500KB when compressed.

WebAssembly refers to a binary instruction format for a stack-based virtual machine. It is designed for the compilation of high-level languages such as C/ C++/Rust. This helps with easily deploying the apps on client and server applications.

New APIs added

New APIs have been added for different features such as polygon, TPS, Vsync, Package audio, and Package ebitenutil, in Ebiten 1.8.

For polygon, type DrawTrianglesOptions API has been added which represents options to render triangles on an image. Another API type Vertex has also been added that represents a vertex passed to DrawTriangles.

For TPS, func CurrentTPS() float64 API is added that returns the current TPS and represents the number of update functions called in a second. Another added API, func MaxTPS() int: returns the current maximum TPS. Also, func SetMaxTPS(tps int) API is added that sets the maximum TPS (ticks per second) and represents the number of the updating function called per second.