Skip to content

Commit 69f8218

Browse files
committed
test
1 parent 67f9d1d commit 69f8218

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

Compile.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
rm -f Res/Game.wasm
2+
cd Source
3+
GOOS=js GOARCH=wasm go build -o Game.wasm -v *.go
4+
mv Game.wasm ../Res/

Push.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
git add .
2+
git commit -m $1 $2
3+
git push origin main --force

Res/Game.wasm

-60 Bytes
Binary file not shown.

index.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE HTML>
2+
<html>
3+
<title>
4+
Bones 'N Souls
5+
</title>
6+
<style>
7+
body { margin: 0; }
8+
canvas { display: block; }
9+
</style>
10+
<script src="Res/Cannon.js"></script>
11+
<script src="Res/Three.js"></script>
12+
<script src="Res/Wasm.js"></script>
13+
<script>
14+
try {
15+
var go = new Go();
16+
WebAssembly.instantiateStreaming(fetch("Res/Game.wasm"), go.importObject).then((result) => {go.run(result.instance);});
17+
} catch(E) {
18+
alert("An error has occured:\n\n" + E + "\n\nPlease reload the game.");
19+
};
20+
</script>
21+
</html>

0 commit comments

Comments
 (0)