Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/orsinium-labs/wasm4go
Framework for making WASM-4 games with Go (and TinyGo).
https://github.com/orsinium-labs/wasm4go
emulator framework game-development game-engine gamedev games go golang tinygo wasm wasm4 webassembly
Last synced: 1 day ago
JSON representation
Framework for making WASM-4 games with Go (and TinyGo).
- Host: GitHub
- URL: https://github.com/orsinium-labs/wasm4go
- Owner: orsinium-labs
- License: mit
- Created: 2024-02-15T14:03:24.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-03-29T16:13:56.000Z (8 months ago)
- Last Synced: 2024-06-21T15:18:53.407Z (5 months ago)
- Topics: emulator, framework, game-development, game-engine, gamedev, games, go, golang, tinygo, wasm, wasm4, webassembly
- Language: Go
- Homepage:
- Size: 44.9 KB
- Stars: 16
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wasm4go
Framework for making [WASM-4](https://wasm4.org/) games with Go (and [TinyGo](https://tinygo.org/)).
Unlike the Go bindings that WASM-4 generates by default, this library is idiomatic Go with type safety, no direct memory manipulation and no byte operations. It provides a friendly API that is easy to read and hard to misuse.
Features:
* **Type-safe API** that is easy to use and hard to misuse.
* **Zero-cost abstraction** in most of the cases, thanks to the crazy optimizations that TinyGo does.
* **Helpful documentation** with links and examples.## Installation
```bash
go get github.com/orsinium-labs/wasm4go
```## Usage
```go
package mainimport "github.com/orsinium-labs/wasm4go/w4"
func init() {
w4.Update = update
}func update() {
w4.DrawColors.SetPrimary(w4.Primary)
w4.DrawText("Hello from TinyGo!", w4.Point{X: 10, Y: 10})
if w4.Gamepad.X() {
w4.DrawColors.SetPrimary(w4.Dark)
}
w4.DrawText("Press X to blink", w4.Point{X: 16, Y: 90})
}
```See [examples](./_examples) for some real code and [documentation](https://pkg.go.dev/github.com/orsinium-labs/wasm4go/w4) to learn what's inside.