Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/guilledipa/cheguordel

Che Guordel!
https://github.com/guilledipa/cheguordel

Last synced: about 2 months ago
JSON representation

Che Guordel!

Awesome Lists containing this project

README

        

# Che Guordel

"Che Guordel!" es una implementacion del juego Wordle, en Go, para un publico
Argentino.

Sera desarrollado usando https://ebitengine.org

## Build

### Linux

```shell
env GOOS=js GOARCH=wasm go build -o yourgame.wasm github.com/guilledipa/cheguordel
```

```shell
cp $(go env GOROOT)/misc/wasm/wasm_exec.js .
```

### Windows

```shell
$Env:GOOS = 'js'
$Env:GOARCH = 'wasm'
go build -o cheguordel.wasm github.com/guilledipa/cheguordel
Remove-Item Env:GOOS
Remove-Item Env:GOARCH
```

```shell
$goroot = go env GOROOT
cp $goroot\misc\wasm\wasm_exec.js .
```

## HTML

Create this HTML:

```html

// Polyfill
if (!WebAssembly.instantiateStreaming) {
WebAssembly.instantiateStreaming = async (resp, importObject) => {
const source = await (await resp).arrayBuffer();
return await WebAssembly.instantiate(source, importObject);
};
}

const go = new Go();
WebAssembly.instantiateStreaming(fetch("cheguordel.wasm"), go.importObject).then(result => {
go.run(result.instance);
});

```

Luego abrir el HTML en tu navegador.

Para embeber el juego en una pagina web se recomienda usar un iframe.

Si el HTML visto mas arriba se llama `main.html` el HTML host deberia ser:

```html

```

Si ves este mensaje en Chrome:

```none
The AudioContext was not allowed to start. It must be resume (or created) after a user gesture on the page. https://goo.gl/7K7WLu
```

Se resuelve agregando `allow="autoplay"` en el iframe.