Initial trial and error draft of using gopherjs.

This commit is contained in:
genxium
2022-12-23 17:31:04 +08:00
parent faee73ae50
commit 69e6baf8e7
25 changed files with 211226 additions and 19 deletions

18
jsexport/index.html Normal file
View File

@@ -0,0 +1,18 @@
<html>
<head>
<script src="jsexport.js"></script>
</head>
<script>
var minStep = 8;
var space = gopkgs.NewCollisionSpaceJs(2048, 2048, 8, 8);
var snapIntoPlatformOverlap = 0.1;
var spaceOffsetX = 0;
var spaceOffsetY = 0;
var a = gopkgs.GenerateRectColliderJs(189, 497, 48, 48, snapIntoPlatformOverlap, snapIntoPlatformOverlap, snapIntoPlatformOverlap, snapIntoPlatformOverlap, spaceOffsetX, spaceOffsetY, "Player");
space.Add(a);
var b = gopkgs.GenerateRectColliderJs(189, 504, 48, 48, snapIntoPlatformOverlap, snapIntoPlatformOverlap, snapIntoPlatformOverlap, snapIntoPlatformOverlap, spaceOffsetX, spaceOffsetY, "Player");
space.Add(b);
var collision = gopkgs.CheckCollisionJs(a, 0, 0);
console.log(collision);
</script>
</html>