Skip to content

Commit

Permalink
[examples/physics] simplify jsdelivr demo
Browse files Browse the repository at this point in the history
  • Loading branch information
codefrau committed Mar 18, 2024
1 parent 9d6e727 commit dca75fd
Show file tree
Hide file tree
Showing 7 changed files with 4,644 additions and 4,272 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"globalThis": false
},
"rules": {
"import/extensions": ["warn", "never"],
"import/extensions": "off",
"import/prefer-default-export": "off",
"import/no-cycle": "off",
"import/newline-after-import": "off",
Expand Down
11 changes: 3 additions & 8 deletions examples/physics/index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
// Microverse Base

// import { App } from "@croquet/worldcore";
import { StartWorldcore, App } from "@croquet/worldcore";
import { MyViewRoot } from "./src/Views";
import { MyModelRoot } from "./src/Models";
import { MyViewRoot } from "./src/Views.js";
import { MyModelRoot } from "./src/Models.js";


App.makeWidgetDock({debug: true, stats: true});
App.makeWidgetDock();

StartWorldcore({
appId: 'io.croquet.physics',
apiKey: '1Mnk3Gf93ls03eu0Barbdzzd3xl1Ibxs7khs8Hon9',
model: MyModelRoot,
name: App.autoSession(),
password: 'password',
view: MyViewRoot,
});
15 changes: 12 additions & 3 deletions examples/physics/jsdelivr.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<html>
<head>
<title>Worldcore Physics</title>
Expand All @@ -9,12 +10,9 @@
background: rgb(30, 30, 30);
}
</style>
<!-- THIS HTML FILE WORKS WITHOUT A BUNDLER -->
<script type="importmap">
{
"imports": {
"./src/Views": "./src/Views.js",
"./src/Models": "./src/Models.js",
"@croquet/worldcore": "https://esm.run/@croquet/worldcore@pre",
"@croquet/worldcore-rapier": "https://esm.run/@croquet/worldcore-rapier@pre"
}
Expand All @@ -23,5 +21,16 @@
<script type="module" src="index.js"></script>
</head>
<body>
<!--
THIS HTML FILE IS A DEMO FOR USING WORLDCORE WITHOUT A BUNDLER
It uses jsDelivr's ESM CDN to import the Worldcore modules via an
import map.
The application source code is used directly without any bundling.
The only change in source code was to use import statements
with .js extension so the browser can resolve these local references
without having to declare them in the import map.
-->
</body>
</html>
Loading

0 comments on commit dca75fd

Please sign in to comment.