screeps2go is an SDK Generator and Golang Runtime for screeps.com!
Well, it intends to be eventually. In the meantime, have a look. ;)
GOOS=js GOARCH=wasm go build -o example/example.wasm ./example
Include the following modules in your branch:
./example/main.js
asmain
./example/example.wasm
aswasmbin
./screeps2go.js
asscreeps2go
The "runtime" simply refers to how the SDK implements a game tick. Essentially, your Go application will look something like this:
package main
import . "github.com/adamgoose/screeps2go/runtime"
func main() {
Run(func(g *Game) any {
// Do something with the game
return nil
})
}
It's very sloppily generated in gen.go
from the various types defined in the
aptly named types.go
. In theory, the generator and type definitions can be
expanded to support the rest of the Screeps API.
I copy/pasted some constant definitions from an early Golang implementation by Robalian.