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 3
3
4
4
PRE_TEST_HOOK=_install_dependencies_hook
5
5
PRE_LINT_HOOK=_install_dependencies_hook
6
- GO_MOD_VERSION_EXPECTED=1.23
6
+ GO_MOD_VERSION_EXPECTED=1.24
7
7
SKIP_i386_TESTS=true
8
8
SKIP_API_DIFF=true
9
9
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
10
10
11
11
`` go run . `` for running the game on desktop
12
12
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
+
13
17
(see [ this tutorial for more information on how to build for WebAssembly] ( https://ebitengine.org/en/documents/webassembly.html ) )
14
18
15
19
Click "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 15
15
}
16
16
17
17
const go = new Go ( ) ;
18
- WebAssembly . instantiateStreaming ( fetch ( "gopher-combat .wasm" ) , go . importObject ) . then ( result => {
18
+ WebAssembly . instantiateStreaming ( fetch ( "game .wasm" ) , go . importObject ) . then ( result => {
19
19
go . run ( result . instance ) ;
20
20
} ) ;
21
21
</ script >
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ func (g *game) logWindow(ctx *debugui.Context) {
53
53
ctx .SetTextFieldValue (g .logSubmitBuf )
54
54
}
55
55
})
56
- ctx .Button ("Open " ).On (func () {
56
+ ctx .Button ("Host Game " ).On (func () {
57
57
submitOpen ()
58
58
})
59
59
ctx .Button ("Join" ).On (func () {
Original file line number Diff line number Diff line change 1
1
module github.com/pion/example-webrtc-applications/v3
2
2
3
- go 1.23 .0
3
+ go 1.24 .0
4
4
5
5
toolchain go1.25.1
6
6
You can’t perform that action at this time.
0 commit comments