@shijiu/jsview-vue-samples 2.2.128 → 2.2.373

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/BakeViewDemo/App.vue +6 -1
  2. package/Basic/components/anim/AnimEasingCubicBezier.vue +56 -0
  3. package/Basic/components/anim/AnimGroup2.vue +33 -0
  4. package/Basic/components/panel/Panel2.vue +8 -3
  5. package/CoupletsTest/widget/Banger/Maroon.vue +4 -7
  6. package/CoupletsTest/widget/Fireworks/Fireworks.vue +52 -44
  7. package/CustomShader/App.vue +174 -0
  8. package/CustomShader/gaussianBlur.glsl +27 -0
  9. package/CustomShader/pageFlip.glsl +41 -0
  10. package/CustomShader/sdf.glsl +22 -0
  11. package/CustomShader/test.glsl +8 -0
  12. package/CustomShader/vortex.glsl +38 -0
  13. package/DemoHomepage/App.vue +50 -32
  14. package/DemoHomepage/components/Item.vue +23 -12
  15. package/DemoHomepage/index.d.ts +5 -2
  16. package/DemoHomepage/router.js +105 -72
  17. package/DispersedFocusControl/App.vue +67 -0
  18. package/DispersedFocusControl/Button.vue +76 -0
  19. package/DispersedFocusControl/data.js +44 -0
  20. package/DragBox/App.vue +148 -0
  21. package/DriftScopeTest/App.vue +128 -0
  22. package/FlexCellDemo/App.vue +47 -223
  23. package/FlexCellDemo/TestFrame1.vue +88 -0
  24. package/FlexCellDemo/TestFrame2.vue +100 -0
  25. package/FlexCellDemo/TestFrame3.vue +97 -0
  26. package/FlexCellDemo/TestFrame4.vue +60 -0
  27. package/FlexCellDemo/TestFrame5.vue +60 -0
  28. package/FlexCellDemo/images/6.jpg +0 -0
  29. package/FocusMoveStyle/App.vue +1 -0
  30. package/FocusMoveStyle/CreepFocus.vue +11 -1
  31. package/FocusMoveStyle/FoldableItem.vue +1 -1
  32. package/FreeMove/App.vue +62 -64
  33. package/FreeMoveLink/App.vue +2 -2
  34. package/FullScreenFlex/App.vue +42 -0
  35. package/FullScreenFlex/TestFrame2.vue +107 -0
  36. package/FullScreenFlex/images/1.png +0 -0
  37. package/HashHistory/App.vue +8 -4
  38. package/ImpactStop/App.vue +45 -45
  39. package/Input/App.vue +184 -97
  40. package/Input/InputPanel.vue +98 -82
  41. package/LatexFormula/App.vue +97 -10
  42. package/LongImage/App.vue +1 -2
  43. package/LongText/App.vue +2 -2
  44. package/LongText/LongTextScroll.vue +22 -22
  45. package/LongText/Scroll.vue +28 -9
  46. package/MetroWidgetDemos/RefreshDemo/App.vue +172 -56
  47. package/MetroWidgetDemos/RefreshDemo/ControlItem.vue +45 -0
  48. package/MetroWidgetDemos/RefreshDemo/Item.vue +20 -4
  49. package/MetroWidgetDemos/itemSizeUpdate/backward/Item.vue +1 -1
  50. package/MetroWidgetDemos/routeList.js +17 -17
  51. package/MindMap/App.vue +10 -1
  52. package/MindMap/data.js +34 -8
  53. package/Parkour/appConfig/jsview.config.mjs +0 -4
  54. package/PosterPacker/App.vue +207 -0
  55. package/PosterPacker/images/bg.jpg +0 -0
  56. package/PosterPacker/images/blue.png +0 -0
  57. package/PosterPacker/images/darkGreen.png +0 -0
  58. package/PosterPacker/images/left.png +0 -0
  59. package/PosterPacker/images/orange.png +0 -0
  60. package/PosterPacker/images/pink.png +0 -0
  61. package/PosterPacker/images/purple.png +0 -0
  62. package/PosterPacker/images/red.png +0 -0
  63. package/PosterPacker/images/right.png +0 -0
  64. package/PosterPacker/images/yellowGreen.png +0 -0
  65. package/PosterPacker/tools/geniePakcer/Genie.vue +686 -0
  66. package/PosterPacker/tools/geniePakcer/genieBottom.glsl +49 -0
  67. package/PosterPacker/tools/geniePakcer/genieLeft.glsl +50 -0
  68. package/PosterPacker/tools/geniePakcer/genieRight.glsl +57 -0
  69. package/PosterPacker/tools/geniePakcer/genieTop.glsl +50 -0
  70. package/PosterPacker/tools/particlePacker/Particle.vue +71 -0
  71. package/PosterPacker/tools/vortexPacker/Vortex.vue +135 -0
  72. package/PosterPacker/tools/vortexPacker/vortex.glsl +37 -0
  73. package/Preload/App.vue +1 -1
  74. package/SceneTransition/JsvSceneTransition.vue +30 -42
  75. package/ScrollBoxTest/App.vue +35 -86
  76. package/ScrollBoxTest/ClipBar.vue +154 -0
  77. package/ScrollBoxTest/DrawCircle.ts +25 -0
  78. package/ScrollBoxTest/NinePatchBar.vue +188 -0
  79. package/ScrollBoxTest/NoBackgroundBar.vue +125 -0
  80. package/ScrollBoxTest/SizeDivBar.vue +139 -0
  81. package/SprayMove/App.vue +75 -0
  82. package/SprayMove/SprayMove.vue +173 -0
  83. package/SprayView/App.vue +8 -9
  84. package/TestNativeSharedView/App.vue +6 -4
  85. package/TextShadowDemo/App.vue +3 -3
  86. package/TextureAnimation/App.vue +244 -148
  87. package/TextureAnimation/App2.vue +66 -14
  88. package/TextureAnimation/assets/blackWhiteTurntable.png +0 -0
  89. package/TextureAnimation/assets/circleHaloMask.png +0 -0
  90. package/TombSweepingDayTest/Raining/Rain.vue +8 -8
  91. package/TouchWidget/App.vue +79 -40
  92. package/TouchWidget/Item.vue +15 -3
  93. package/index.d.ts +1 -1
  94. package/package.json +1 -1
  95. package/MetroWidgetDemos/RefreshDemo/data.js +0 -16
  96. package/TextureAnimation/assets/mask.png +0 -0
  97. package/TextureAnimation/assets/php.jpg +0 -0
  98. package/TouchSample/App.vue +0 -136
  99. package/TouchSample/Item.vue +0 -102
  100. package/TouchSample/MetroWidgetHorizontal.vue +0 -144
  101. package/TouchSample/MetroWidgetVertical.vue +0 -144
  102. package/TouchSample/TouchContainerHorizontal.vue +0 -160
  103. package/TouchSample/TouchContainerVertical.vue +0 -160
  104. package/TouchSample/data.js +0 -81
  105. /package/TextureAnimation/assets/{php2.png → borderOpacity.png} +0 -0
package/FreeMove/App.vue CHANGED
@@ -53,46 +53,46 @@ const procKeyDown = (ev) => {
53
53
  };
54
54
  // ******* 直接跳转位置 *******
55
55
  window.DebugResetPos = (x, y) => {
56
- actorControl.run([
57
- actorControl.state().clearAllConditions(),
58
- actorControl.action().teleportTo(x, y),
56
+ actorControl.run((cmds) => [
57
+ cmds.state().clearAllConditions(),
58
+ cmds.action().teleportTo(x, y),
59
59
  ]);
60
60
 
61
- actorControl2.run([
62
- actorControl2.state().clearAllConditions(),
63
- actorControl2.action().teleportTo(x, y + 50),
61
+ actorControl2.run((cmds) => [
62
+ cmds.state().clearAllConditions(),
63
+ cmds.action().teleportTo(x, y + 50),
64
64
  ]);
65
65
  };
66
66
 
67
67
  window.DebugResetOffsetPos = (x, y) => {
68
- actorControl.run([
69
- actorControl.state().clearAllConditions(),
70
- actorControl.action().teleportOffset(x, y),
68
+ actorControl.run((cmds) => [
69
+ cmds.state().clearAllConditions(),
70
+ cmds.action().teleportOffset(x, y),
71
71
  ]);
72
72
 
73
- actorControl2.run([
74
- actorControl2.state().clearAllConditions(),
75
- actorControl2.action().teleportOffset(x, y),
73
+ actorControl2.run((cmds) => [
74
+ cmds.state().clearAllConditions(),
75
+ cmds.action().teleportOffset(x, y),
76
76
  ]);
77
77
  };
78
78
 
79
79
  // ******* 有参照物的刹车测试,仅X轴移动 *******
80
80
  window.DebugBrakeToPosX = () => {
81
81
  // 参照物
82
- actorControl.run([
83
- actorControl.state().clearAllConditions(),
84
- actorControl.action().teleportTo(400, 50),
82
+ actorControl.run((cmds) => [
83
+ cmds.state().clearAllConditions(),
84
+ cmds.action().teleportTo(400, 50),
85
85
  ]);
86
86
  // 运动体
87
- actorControl2.run([
88
- actorControl2.state().clearAllConditions(),
89
- actorControl2.state().setStartPos(0, 200),
90
- actorControl2.action().moveTo(300, undefined, 10, undefined),
91
- actorControl2
87
+ actorControl2.run((cmds) => [
88
+ cmds.state().clearAllConditions(),
89
+ cmds.state().setStartPos(0, 200),
90
+ cmds.action().moveTo(300, undefined, 10, undefined),
91
+ cmds
92
92
  .condition()
93
93
  .reachPosition(200, undefined)
94
94
  .then([
95
- actorControl2.action(1).brakeToPosition(
95
+ cmds.action(1).brakeToPosition(
96
96
  400,
97
97
  undefined,
98
98
  (a, b, c, d) => {
@@ -111,20 +111,20 @@ window.DebugBrakeToPosX = () => {
111
111
  // ******* 有参照物的刹车测试,XY都移动 *******
112
112
  window.DebugBrakeToPosXY = () => {
113
113
  // 参照物
114
- actorControl.run([
115
- actorControl.state().clearAllConditions(),
116
- actorControl.action().teleportTo(400, 50),
114
+ actorControl.run((cmds) => [
115
+ cmds.state().clearAllConditions(),
116
+ cmds.action().teleportTo(400, 50),
117
117
  ]);
118
118
  // 运动体
119
- actorControl2.run([
120
- actorControl2.state().clearAllConditions(),
121
- actorControl2.state().setStartPos(800, 400),
122
- actorControl2.action().moveTo(100, 50, 10, undefined),
123
- actorControl2
119
+ actorControl2.run((cmds) => [
120
+ cmds.state().clearAllConditions(),
121
+ cmds.state().setStartPos(800, 400),
122
+ cmds.action().moveTo(100, 50, 10, undefined),
123
+ cmds
124
124
  .condition()
125
125
  .reachPosition(400, undefined)
126
126
  .then([
127
- actorControl2.action(3).brakeToPosition(
127
+ cmds.action(3).brakeToPosition(
128
128
  100,
129
129
  50,
130
130
  (a, b, c, d) => {
@@ -142,20 +142,20 @@ window.DebugBrakeToPosXY = () => {
142
142
 
143
143
  // ******* 定向移动 *******
144
144
  window.DebugMoveTarget = () => {
145
- actorControl2.run([
146
- actorControl2.state().clearAllConditions(),
147
- actorControl2.state().setStartPos(0, 400),
148
- actorControl2.action().moveTo(300, undefined, 10, undefined),
145
+ actorControl2.run((cmds) => [
146
+ cmds.state().clearAllConditions(),
147
+ cmds.state().setStartPos(0, 400),
148
+ cmds.action().moveTo(300, undefined, 10, undefined),
149
149
  ]);
150
150
  };
151
151
 
152
152
  // ******* 定向移动 + 回调监听 和 共享结束监听(OnNexusEvent) *******
153
153
  window.DebugTestMove = (x, y) => {
154
154
  let actRef = {};
155
- actorControl.run([
156
- actorControl.state().clearAllConditions(),
157
- actorControl.state().setStartPos(160, 150),
158
- actorControl.action(0, 0, actRef).moveTo(x, y, 2, 2, (a, b, c, d) => {
155
+ actorControl.run((cmds) => [
156
+ cmds.state().clearAllConditions(),
157
+ cmds.state().setStartPos(160, 150),
158
+ cmds.action(0, 0, actRef).moveTo(x, y, 2, 2, (a, b, c, d) => {
159
159
  console.log(
160
160
  "LudlDebugCB DebugTestMove enter " +
161
161
  " a=" +
@@ -168,7 +168,7 @@ window.DebugTestMove = (x, y) => {
168
168
  d
169
169
  );
170
170
  }),
171
- actorControl
171
+ cmds
172
172
  .condition()
173
173
  .onNexusEvent(actRef, actEvents.ActFinish)
174
174
  .then([
@@ -180,39 +180,37 @@ window.DebugTestMove = (x, y) => {
180
180
  };
181
181
 
182
182
  window.DebugTestOffset = (control, startPos) => {
183
- control.run([
184
- actorControl.state().clearAllConditions(),
185
- control.state().setStartPos(startPos, 150),
186
- control.action().altSpeed(3, undefined, 0),
187
- control
183
+ control.run((cmds) => [
184
+ cmds.state().clearAllConditions(),
185
+ cmds.state().setStartPos(startPos, 150),
186
+ cmds.action().altSpeed(3, undefined, 0),
187
+ cmds
188
188
  .condition(undefined, true)
189
189
  .reachPosition(460, undefined)
190
- .then([actorControl.action(1, 0).teleportOffset(-300, undefined)]),
190
+ .then([cmds.action(1, 0).teleportOffset(-300, undefined)]),
191
191
  ]);
192
192
  };
193
193
  window.DebugTestThrowStart = () => {
194
194
  // 参照物
195
- actorControl2.run([
196
- actorControl2.state().clearAllConditions(),
197
- actorControl2.action().teleportTo(400, 300),
195
+ actorControl2.run((cmds) => [
196
+ cmds.state().clearAllConditions(),
197
+ cmds.action().teleportTo(400, 300),
198
198
  ]);
199
199
 
200
- actorControl.run([
201
- actorControl.state().clearAllConditions(),
202
- actorControl.state().setStartPos(100, 300),
203
- actorControl.action().setSpeed(2, undefined),
204
- actorControl
205
- .action(1)
206
- .setSpdAndAccel(undefined, -20, undefined, 0.3, null, () => {
207
- console.log("on pole");
208
- // 在接触地板时停止
209
- actorControl.run([
210
- actorControl
211
- .condition(undefined, true)
212
- .reachPosition(undefined, 300)
213
- .then([actorControl.action(3, 3).stopMoving()]),
214
- ]);
215
- }),
200
+ actorControl.run((cmds) => [
201
+ cmds.state().clearAllConditions(),
202
+ cmds.state().setStartPos(100, 300),
203
+ cmds.action().setSpeed(2, undefined),
204
+ cmds.action(1).setSpdAndAccel(undefined, -20, undefined, 0.3, null, () => {
205
+ console.log("on pole");
206
+ // 在接触地板时停止
207
+ actorControl.run((cmds) => [
208
+ cmds
209
+ .condition(undefined, true)
210
+ .reachPosition(undefined, 300)
211
+ .then([cmds.action(3, 3).stopMoving()]),
212
+ ]);
213
+ }),
216
214
  ]);
217
215
  };
218
216
 
@@ -16,7 +16,7 @@ onMounted(() => {
16
16
  div1View.DragEnables?.(ForgeConst.DragFlags.TOUCH_RECV_MOVE_BIT); // 只激活drag
17
17
 
18
18
  control1.run([
19
- control1.state().startMovementSync(linkNexusId, -200, -200, 200, 200, 0b11),
19
+ control1.state().startMovementSync(linkNexusId, -200, 200, -200, 200, 0b11),
20
20
  ]);
21
21
 
22
22
  let div2View = div2.value.jsvGetProxyView();
@@ -26,7 +26,7 @@ onMounted(() => {
26
26
  control2
27
27
  .condition()
28
28
  .movementSync(linkNexusId)
29
- .then([control2.action().ackMovementSync(-100, -100, 100, 100, 0b11, 1)]),
29
+ .then([control2.action().ackMovementSync(-100, 100, -100, 100, 0b11, 1)]),
30
30
  ]);
31
31
  });
32
32
  </script>
@@ -0,0 +1,42 @@
1
+ <!--
2
+ * @Author: ChenChanghua
3
+ * @Date: 2022-04-20 21:05:26
4
+ * @LastEditors: ChenChanghua
5
+ * @LastEditTime: 2022-07-08 11:16:52
6
+ * @Description: file content
7
+ -->
8
+ <script setup>
9
+ import { ref, reactive, onMounted } from "vue";
10
+ import { useRouter } from "vue-router";
11
+ import { jJsvRuntimeBridge } from "jsview";
12
+ import TestFrame2 from "./TestFrame2.vue";
13
+
14
+ const UseTestFrame = TestFrame2;
15
+
16
+ const router = useRouter();
17
+
18
+ const _onKeyDown = (ev) => {
19
+ if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
20
+ router.go(-1); // 有router时,是从DemoHomepage进入,回退
21
+ }
22
+
23
+ return true;
24
+ };
25
+
26
+ onMounted(() => {
27
+ jJsvRuntimeBridge.notifyPageLoaded();
28
+ });
29
+ </script>
30
+
31
+ <template>
32
+ <jsv-focus-block
33
+ autoFocus
34
+ :onAction="{
35
+ onKeyDown: _onKeyDown,
36
+ }"
37
+ >
38
+ <UseTestFrame />
39
+ </jsv-focus-block>
40
+ </template>
41
+
42
+ <style scoped></style>
@@ -0,0 +1,107 @@
1
+ <!--
2
+ * @Author: ChenChanghua
3
+ * @Date: 2022-04-20 21:05:26
4
+ * @LastEditors: ChenChanghua
5
+ * @LastEditTime: 2022-07-08 11:16:52
6
+ * @Description: file content
7
+ -->
8
+ <script setup>
9
+ import image1 from "./images/1.png";
10
+ import { JsvScreenFlex } from "jsview";
11
+ </script>
12
+
13
+ <template>
14
+ <!-- 测试aligneContent未设置, 内容进行stretch的场景 -->
15
+ <JsvScreenFlex
16
+ :style="{
17
+ flexDirection: 'row',
18
+ justifyContent: 'flex-start',
19
+ alignItems: 'flex-start',
20
+ }"
21
+ background="https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/BackgroundLongmao.jpg"
22
+ >
23
+ <div
24
+ id="DivAnchor1"
25
+ :style="{
26
+ width: 50,
27
+ height: 50,
28
+ backgroundColor: '#00F000',
29
+ }"
30
+ />
31
+ <div
32
+ :style="{
33
+ width: 50,
34
+ height: 50,
35
+ backgroundColor: '#0000F0',
36
+ }"
37
+ />
38
+ </JsvScreenFlex>
39
+
40
+ <JsvScreenFlex
41
+ :style="{
42
+ flexDirection: 'row',
43
+ justifyContent: 'center',
44
+ alignItems: 'center',
45
+ }"
46
+ >
47
+ <div
48
+ id="DivAnchor2"
49
+ :style="{
50
+ width: 200,
51
+ height: 200,
52
+ backgroundColor: '#00F000',
53
+ }"
54
+ />
55
+ <div
56
+ :style="{
57
+ width: 200,
58
+ height: 200,
59
+ backgroundColor: '#0000F0',
60
+ }"
61
+ />
62
+ </JsvScreenFlex>
63
+
64
+ <JsvScreenFlex
65
+ :style="{
66
+ flexDirection: 'row',
67
+ justifyContent: 'flex-end',
68
+ alignItems: 'flex-end',
69
+ }"
70
+ >
71
+ <div
72
+ id="DivAnchor3"
73
+ :style="{
74
+ width: 300,
75
+ height: 300,
76
+ }"
77
+ >
78
+ <div
79
+ :style="{
80
+ top: 10,
81
+ left: 10,
82
+ width: 280,
83
+ height: 280,
84
+ backgroundColor: '#00F000',
85
+ }"
86
+ />
87
+ </div>
88
+ <div
89
+ :style="{
90
+ width: 300,
91
+ height: 300,
92
+ }"
93
+ >
94
+ <div
95
+ :style="{
96
+ top: 10,
97
+ left: 10,
98
+ width: 280,
99
+ height: 280,
100
+ backgroundColor: '#0000F0',
101
+ }"
102
+ />
103
+ </div>
104
+ </JsvScreenFlex>
105
+ </template>
106
+
107
+ <style scoped></style>
Binary file
@@ -21,6 +21,7 @@ let topRef = shallowRef(null);
21
21
  let routePage = shallowRef(null);
22
22
  let currentRouter;
23
23
  if (props.routePath) {
24
+ // 向主Router插入新路径定义
24
25
  const currentRoute = useRoute();
25
26
  currentRouter = useRouter();
26
27
 
@@ -38,6 +39,7 @@ if (props.routePath) {
38
39
 
39
40
  currentRouter.replace(props.routePath + redirectPath); // 自动跳转到redirectPath
40
41
  } else {
42
+ // 主Router就是自己
41
43
  currentRouter = router;
42
44
  }
43
45
  currentRouter.afterEach(() => {
@@ -63,7 +65,11 @@ onMounted(() => {
63
65
  <component
64
66
  :is="Component"
65
67
  ref="routePage"
66
- class="router"
68
+ class="childComponentStyle"
69
+ :style="{
70
+ top:150,
71
+ overflow:'hidden'
72
+ }"
67
73
  @requestFocus="onRequestFocus"
68
74
  />
69
75
  </router-view>
@@ -96,11 +102,9 @@ onMounted(() => {
96
102
  background-color: #00f000;
97
103
  }
98
104
 
99
- .router {
105
+ .childComponentStyle {
100
106
  left: 0;
101
- top: 150;
102
107
  width: 1920;
103
108
  height: 930;
104
- overflow: hidden;
105
109
  }
106
110
  </style>
@@ -196,16 +196,16 @@ const procKeyDown = (ev) => {
196
196
 
197
197
  let interactNexus = FreeMoveFunc.newNexus();
198
198
 
199
- actorControl.run([
200
- actorControl.state().clearAllConditions(),
201
- actorControl
199
+ actorControl.run((cmds) => [
200
+ cmds.state().clearAllConditions(),
201
+ cmds
202
202
  .condition()
203
203
  .onNextTick(1)
204
204
  .then([
205
205
  () => {
206
206
  bodyState.value = 1;
207
207
  },
208
- actorControl
208
+ cmds
209
209
  .condition()
210
210
  .onHitBlock(1)
211
211
  .then([
@@ -213,8 +213,8 @@ const procKeyDown = (ev) => {
213
213
  console.log("LudlDebug on hit 1");
214
214
  bodyState.value = 0;
215
215
  },
216
- actorControl.state().revertWithHitBlock(),
217
- actorControl.action().stopMoving(),
216
+ cmds.state().revertWithHitBlock(),
217
+ cmds.action().stopMoving(),
218
218
  (a) => {
219
219
  jumping = false;
220
220
 
@@ -239,11 +239,11 @@ const procKeyDown = (ev) => {
239
239
  ]);
240
240
 
241
241
  if (direction.value) {
242
- actorControl.run([
243
- actorControl
242
+ actorControl.run((cmds) => [
243
+ cmds
244
244
  .action(0, 0, interactNexus)
245
245
  .setSpdAndAccel(7.9, -24, undefined, 1, null, () => {}),
246
- actorControl
246
+ cmds
247
247
  .condition()
248
248
  .onNexusEvent(interactNexus, actEvents.SpeedRevertY)
249
249
  .then([
@@ -253,11 +253,11 @@ const procKeyDown = (ev) => {
253
253
  ]),
254
254
  ]);
255
255
  } else {
256
- actorControl.run([
257
- actorControl
256
+ actorControl.run((cmds) => [
257
+ cmds
258
258
  .action(0, 0, interactNexus)
259
259
  .setSpdAndAccel(-7.9, -24, undefined, 1, null, () => {}),
260
- actorControl
260
+ cmds
261
261
  .condition()
262
262
  .onNexusEvent(interactNexus, actEvents.SpeedRevertY)
263
263
  .then([
@@ -271,61 +271,61 @@ const procKeyDown = (ev) => {
271
271
  break;
272
272
  case 37:
273
273
  if (board == "left") {
274
- actorControl.run([actorControl.action().setSpeed(-5, 0)]);
275
- actorControl.run([
276
- actorControl.state().clearAllConditions(),
277
- actorControl
274
+ actorControl.run((cmds) => [cmds.action().setSpeed(-5, 0)]);
275
+ actorControl.run((cmds) => [
276
+ cmds.state().clearAllConditions(),
277
+ cmds
278
278
  .condition()
279
279
  .reachPosition(0, undefined)
280
- .then([actorControl.action().stopMoving()]),
280
+ .then([cmds.action().stopMoving()]),
281
281
  ]);
282
282
  } else if (board == "right") {
283
- actorControl.run([actorControl.action().setSpeed(-5, 0)]);
284
- actorControl.run([
285
- actorControl.state().clearAllConditions(),
286
- actorControl
283
+ actorControl.run((cmds) => [cmds.action().setSpeed(-5, 0)]);
284
+ actorControl.run((cmds) => [
285
+ cmds.state().clearAllConditions(),
286
+ cmds
287
287
  .condition()
288
288
  .reachPosition(840 - 40, undefined)
289
- .then([actorControl.action().stopMoving()]),
289
+ .then([cmds.action().stopMoving()]),
290
290
  ]);
291
291
  } else if (board == "middle") {
292
- actorControl.run([actorControl.action().setSpeed(-5, 0)]);
293
- actorControl.run([
294
- actorControl.state().clearAllConditions(),
295
- actorControl
292
+ actorControl.run((cmds) => [cmds.action().setSpeed(-5, 0)]);
293
+ actorControl.run((cmds) => [
294
+ cmds.state().clearAllConditions(),
295
+ cmds
296
296
  .condition()
297
297
  .reachPosition(540 - 40, undefined)
298
- .then([actorControl.action().stopMoving()]),
298
+ .then([cmds.action().stopMoving()]),
299
299
  ]);
300
300
  }
301
301
  break;
302
302
  case 39:
303
303
  if (board == "left") {
304
- actorControl.run([actorControl.action().setSpeed(5, 0)]);
305
- actorControl.run([
306
- actorControl.state().clearAllConditions(),
307
- actorControl
304
+ actorControl.run((cmds) => [cmds.action().setSpeed(5, 0)]);
305
+ actorControl.run((cmds) => [
306
+ cmds.state().clearAllConditions(),
307
+ cmds
308
308
  .condition()
309
309
  .reachPosition(410 - 40, undefined)
310
- .then([actorControl.action().stopMoving()]),
310
+ .then([cmds.action().stopMoving()]),
311
311
  ]);
312
312
  } else if (board == "right") {
313
- actorControl.run([actorControl.action().setSpeed(5, 0)]);
314
- actorControl.run([
315
- actorControl.state().clearAllConditions(),
316
- actorControl
313
+ actorControl.run((cmds) => [cmds.action().setSpeed(5, 0)]);
314
+ actorControl.run((cmds) => [
315
+ cmds.state().clearAllConditions(),
316
+ cmds
317
317
  .condition()
318
318
  .reachPosition(1240 - 30 - 40, undefined)
319
- .then([actorControl.action().stopMoving()]),
319
+ .then([cmds.action().stopMoving()]),
320
320
  ]);
321
321
  } else if (board == "middle") {
322
- actorControl.run([actorControl.action().setSpeed(5, 0)]);
323
- actorControl.run([
324
- actorControl.state().clearAllConditions(),
325
- actorControl
322
+ actorControl.run((cmds) => [cmds.action().setSpeed(5, 0)]);
323
+ actorControl.run((cmds) => [
324
+ cmds.state().clearAllConditions(),
325
+ cmds
326
326
  .condition()
327
327
  .reachPosition(740 - 40 - 30, undefined)
328
- .then([actorControl.action().stopMoving()]),
328
+ .then([cmds.action().stopMoving()]),
329
329
  ]);
330
330
  }
331
331
  break;
@@ -338,10 +338,10 @@ const procKeyUp = (ev) => {
338
338
  }
339
339
  switch (ev.keyCode) {
340
340
  case 37:
341
- actorControl.run([actorControl.action().stopMoving()]);
341
+ actorControl.run((cmds) => [cmds.action().stopMoving()]);
342
342
  break;
343
343
  case 39:
344
- actorControl.run([actorControl.action().stopMoving()]);
344
+ actorControl.run((cmds) => [cmds.action().stopMoving()]);
345
345
  break;
346
346
 
347
347
  default:
@@ -357,7 +357,7 @@ const onActionObj = {
357
357
  const reset = () => {
358
358
  board = "left";
359
359
  direction.value = 1;
360
- actorControl.run([actorControl.action().teleportTo(0, 0)]);
360
+ actorControl.run((cmds) => [cmds.action().teleportTo(0, 0)]);
361
361
  };
362
362
  onMounted(() => {
363
363
  actorControl = actorRef.value.control;