Portal targets. The check is broken, I don't know why yet
This commit is contained in:
parent
8ca1c44af1
commit
4f4c793c42
|
@ -4,7 +4,7 @@
|
||||||
"description": "vr experiments 3",
|
"description": "vr experiments 3",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "yarn regenerate && yarn compile && yarn rollup",
|
"prepare": "yarn regenerate && yarn compile && yarn rollup",
|
||||||
"regenerate": "rm -rf ./src/gen && preserves-schema-ts --output ./src/gen ./protocols/schemas",
|
"regenerate": "rm -rf ./src/gen && preserves-schema-ts --module sturdy=@syndicate-lang/core:Schemas.sturdy --xref node_modules/@syndicate-lang/core/protocols/schemas --output ./src/gen ./protocols/schemas",
|
||||||
"regenerate:watch": "yarn regenerate --watch",
|
"regenerate:watch": "yarn regenerate --watch",
|
||||||
"compile": "syndicate-tsc",
|
"compile": "syndicate-tsc",
|
||||||
"compile:watch": "syndicate-tsc -w --verbose --intermediate-directory src.ts",
|
"compile:watch": "syndicate-tsc -w --verbose --intermediate-directory src.ts",
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
version 1 .
|
version 1 .
|
||||||
|
|
||||||
|
Portal = <portal @name string @destination PortalDestination> .
|
||||||
|
PortalDestination =
|
||||||
|
/ @local #!any
|
||||||
|
/ @remote <remote <ws @url string> @sturdyref sturdy.SturdyRef>
|
||||||
|
.
|
||||||
|
|
||||||
; Message
|
; Message
|
||||||
Touch = <touch @subject string @object string> .
|
Touch = <touch @subject string @object string> .
|
||||||
|
|
18
src/index.ts
18
src/index.ts
|
@ -127,8 +127,22 @@ function bootApp(ds: Ref, scene: Scene) {
|
||||||
}
|
}
|
||||||
|
|
||||||
at sceneDs {
|
at sceneDs {
|
||||||
on message SceneProtocol.Touch({ "subject": $subject, "object": $object }) => {
|
on message SceneProtocol.Touch({ "subject": id, "object": $o }) => {
|
||||||
console.log('touch!', subject, object);
|
console.log('touch!', o);
|
||||||
|
react {
|
||||||
|
on stop console.log('portal check ending', o);
|
||||||
|
during SceneProtocol.Portal({
|
||||||
|
"name": o,
|
||||||
|
"destination": $dest: SceneProtocol.PortalDestination
|
||||||
|
}) => {
|
||||||
|
console.log('portal!', dest);
|
||||||
|
}
|
||||||
|
const checkFacet = Turn.activeFacet;
|
||||||
|
Turn.active.sync(sceneDs).then(() => checkFacet.turn(() => {
|
||||||
|
console.log('synced');
|
||||||
|
stop;
|
||||||
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert Shapes.Sprite({
|
assert Shapes.Sprite({
|
||||||
|
|
Loading…
Reference in New Issue