File tree Expand file tree Collapse file tree 6 files changed +16
-4
lines changed Expand file tree Collapse file tree 6 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 33
44PRE_TEST_HOOK=_install_dependencies_hook
55PRE_LINT_HOOK=_install_dependencies_hook
6- GO_MOD_VERSION_EXPECTED=1.23
6+ GO_MOD_VERSION_EXPECTED=1.24
77SKIP_i386_TESTS=true
88SKIP_API_DIFF=true
99
Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ you can then run the game by going in /game and doing either
1010
1111`` go run . `` for running the game on desktop
1212
13+ or run `` build_wasm.sh `` to build for the web. (Requires Git Bash on Windows)
14+
15+ (To serve the web version of the game, you can run `` python -m http.server `` or some other simple web server inside /game)
16+
1317(see [ this tutorial for more information on how to build for WebAssembly] ( https://ebitengine.org/en/documents/webassembly.html ) )
1418
1519Click "Host Game" to get the lobby id, and then share that with the other clients to get connected
Original file line number Diff line number Diff line change 1+ # SPDX-FileCopyrightText: 2025 The Pion community <https://pion.ly>
2+ # SPDX-License-Identifier: MIT
3+
4+ # we have to do this for Go 1.24 and newer
5+ # see: https://tip.golang.org/doc/go1.24#wasm
6+ cp $( go env GOROOT) /lib/wasm/wasm_exec.js .
7+
8+ env GOOS=js GOARCH=wasm go build -o game.wasm
Original file line number Diff line number Diff line change 1515}
1616
1717const go = new Go ( ) ;
18- WebAssembly . instantiateStreaming ( fetch ( "gopher-combat .wasm" ) , go . importObject ) . then ( result => {
18+ WebAssembly . instantiateStreaming ( fetch ( "game .wasm" ) , go . importObject ) . then ( result => {
1919 go . run ( result . instance ) ;
2020} ) ;
2121</ script >
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ func (g *game) logWindow(ctx *debugui.Context) {
5353 ctx .SetTextFieldValue (g .logSubmitBuf )
5454 }
5555 })
56- ctx .Button ("Open " ).On (func () {
56+ ctx .Button ("Host Game " ).On (func () {
5757 submitOpen ()
5858 })
5959 ctx .Button ("Join" ).On (func () {
Original file line number Diff line number Diff line change 11module github.com/pion/example-webrtc-applications/v3
22
3- go 1.23 .0
3+ go 1.24 .0
44
55toolchain go1.25.1
66
You can’t perform that action at this time.
0 commit comments