@makefully/platypus 4.1.5 → 4.1.6

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 (136) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +3 -3
  3. package/lib/platypus.js +1 -1
  4. package/package.json +6 -5
  5. package/src/AABB.js +685 -0
  6. package/src/ActionState.js +121 -0
  7. package/src/AssetManager.js +206 -0
  8. package/src/CollisionData.js +96 -0
  9. package/src/CollisionDataContainer.js +127 -0
  10. package/src/CollisionShape.js +315 -0
  11. package/src/Component.js +231 -0
  12. package/src/Data.js +64 -0
  13. package/src/DataMap.js +204 -0
  14. package/src/Entity.js +404 -0
  15. package/src/EntityLinker.js +113 -0
  16. package/src/EventHandler.js +115 -0
  17. package/src/EventHandlerList.js +251 -0
  18. package/src/Game.js +840 -0
  19. package/src/Gamepad.js +175 -0
  20. package/src/ID3CaptionPlayer.js +61 -0
  21. package/src/Messenger.js +365 -0
  22. package/src/PIXIAnimation.js +622 -0
  23. package/src/RandomSet.js +140 -0
  24. package/src/SFXPlayer.js +120 -0
  25. package/src/StateMap.js +252 -0
  26. package/src/Storage.js +152 -0
  27. package/src/TickerClient.js +48 -0
  28. package/src/TickerServer.js +23 -0
  29. package/src/TimeEvent.js +50 -0
  30. package/src/TimeEventList.js +100 -0
  31. package/src/VOPlayer.js +684 -0
  32. package/src/Vector.js +702 -0
  33. package/src/components/AIChaser.js +161 -0
  34. package/src/components/AIPacer.js +107 -0
  35. package/src/components/AudioMusic.js +151 -0
  36. package/src/components/AudioSFX.js +673 -0
  37. package/src/components/AudioVO.js +301 -0
  38. package/src/components/CollisionBasic.js +826 -0
  39. package/src/components/CollisionFilter.js +74 -0
  40. package/src/components/CollisionGroup.js +448 -0
  41. package/src/components/CollisionTiles.js +608 -0
  42. package/src/components/ComponentSwitcher.js +173 -0
  43. package/src/components/ControllerInput.js +65 -0
  44. package/src/components/Counter.js +165 -0
  45. package/src/components/EntityCamera.js +215 -0
  46. package/src/components/EntityContainer.js +549 -0
  47. package/src/components/EntityController.js +541 -0
  48. package/src/components/HandlerCamera.js +1052 -0
  49. package/src/components/HandlerCollision.js +1318 -0
  50. package/src/components/HandlerController.js +291 -0
  51. package/src/components/HandlerLogic.js +394 -0
  52. package/src/components/HandlerRender.js +217 -0
  53. package/src/components/Interactive.js +502 -0
  54. package/src/components/LevelBuilder.js +524 -0
  55. package/src/components/LogicAngularMovement.js +154 -0
  56. package/src/components/LogicAttachment.js +265 -0
  57. package/src/components/LogicButton.js +466 -0
  58. package/src/components/LogicCarrier.js +39 -0
  59. package/src/components/LogicDestroyMe.js +58 -0
  60. package/src/components/LogicDirectionalMovement.js +325 -0
  61. package/src/components/LogicDragDrop.js +371 -0
  62. package/src/components/LogicImpactLaunch.js +144 -0
  63. package/src/components/LogicPacingPlatform.js +64 -0
  64. package/src/components/LogicPortable.js +112 -0
  65. package/src/components/LogicPortal.js +115 -0
  66. package/src/components/LogicPushable.js +98 -0
  67. package/src/components/LogicRebounder.js +136 -0
  68. package/src/components/LogicRegionSpawner.js +139 -0
  69. package/src/components/LogicRotationalMovement.js +205 -0
  70. package/src/components/LogicSpawner.js +159 -0
  71. package/src/components/LogicStateMachine.js +382 -0
  72. package/src/components/LogicSwitch.js +77 -0
  73. package/src/components/LogicTeleportee.js +68 -0
  74. package/src/components/LogicTeleporter.js +93 -0
  75. package/src/components/LogicTimer.js +178 -0
  76. package/src/components/LogicWindUpRacer.js +179 -0
  77. package/src/components/Motion.js +371 -0
  78. package/src/components/Mover.js +566 -0
  79. package/src/components/Node.js +289 -0
  80. package/src/components/NodeMap.js +295 -0
  81. package/src/components/NodeResident.js +636 -0
  82. package/src/components/Orientation.js +697 -0
  83. package/src/components/RandomEvents.js +73 -0
  84. package/src/components/RelativePosition.js +204 -0
  85. package/src/components/RelayFamily.js +106 -0
  86. package/src/components/RelayGame.js +53 -0
  87. package/src/components/RelayLinker.js +94 -0
  88. package/src/components/RelayParent.js +57 -0
  89. package/src/components/RelaySelf.js +55 -0
  90. package/src/components/Render.js +178 -0
  91. package/src/components/RenderAnimator.js +275 -0
  92. package/src/components/RenderContainer.js +646 -0
  93. package/src/components/RenderDebug.js +319 -0
  94. package/src/components/RenderDestroyMe.js +59 -0
  95. package/src/components/RenderLottie.js +149 -0
  96. package/src/components/RenderProgress.js +120 -0
  97. package/src/components/RenderSpine.js +833 -0
  98. package/src/components/RenderSprite.js +527 -0
  99. package/src/components/RenderText.js +147 -0
  100. package/src/components/RenderTiles.js +1391 -0
  101. package/src/components/SceneChanger.js +128 -0
  102. package/src/components/TiledLoader.js +1451 -0
  103. package/src/components/Timeline.js +314 -0
  104. package/src/components/Tutorial.js +267 -0
  105. package/src/components/Tween.js +296 -0
  106. package/src/components/VoiceOver.js +373 -0
  107. package/src/components/XHR.js +129 -0
  108. package/src/components/index.js +79 -0
  109. package/src/factory.js +305 -0
  110. package/src/index.js +159 -0
  111. package/src/mixins/PIXI.Graphics.js +41 -0
  112. package/src/platypus.css +68 -0
  113. package/src/sayHello.js +50 -0
  114. package/src/shapes/Capsule.js +74 -0
  115. package/src/shapes/Circle.js +43 -0
  116. package/src/shapes/Ellipse.js +117 -0
  117. package/src/shapes/Point.js +191 -0
  118. package/src/shapes/Polygon.js +112 -0
  119. package/src/shapes/Polyline.js +97 -0
  120. package/src/shapes/Rectangle.js +78 -0
  121. package/src/shapes/RoundedRectangle.js +33 -0
  122. package/src/shapes/Segment.js +346 -0
  123. package/src/shapes/adjustedXY.js +19 -0
  124. package/src/shapes/castFromBox2D.js +92 -0
  125. package/src/shapes/castFromObject.js +53 -0
  126. package/src/shapes/castFromPixiGraphics.js +6 -0
  127. package/src/shapes/castFromPixiShape.js +89 -0
  128. package/src/shapes/castToBox2D.js +190 -0
  129. package/src/shapes/castToPixiGraphics.js +100 -0
  130. package/src/shapes/castToPixiShape.js +61 -0
  131. package/src/shapes/checkPointsMap.js +313 -0
  132. package/src/shapes/index.js +35 -0
  133. package/src/utils/array.js +73 -0
  134. package/src/utils/string.js +39 -0
  135. package/lib/243.platypus.mjs +0 -1
  136. package/lib/platypus.mjs +0 -1
@@ -0,0 +1,23 @@
1
+ self.onmessage = ({data}) => {
2
+ let interval = 0;
3
+
4
+ if (data.begin) {
5
+ let time = performance.now();
6
+
7
+ clearInterval(interval);
8
+ interval = setInterval(() => {
9
+ const
10
+ newTime = performance.now();
11
+
12
+ self.postMessage({
13
+ deltaTime: newTime - time
14
+ });
15
+
16
+ time = newTime;
17
+ }, data.begin.delta);
18
+ }
19
+ if (data.stop) {
20
+ clearInterval(interval);
21
+ }
22
+ };
23
+
@@ -0,0 +1,50 @@
1
+ import recycle from 'recycle';
2
+
3
+ const
4
+ TimeEvent = function (event = '', time = 0, message = null, entity = null, interruptable = true) {
5
+ if (typeof event === 'object') {
6
+ this.event = event.event ?? '';
7
+ this.message = event.message ?? message;
8
+ this.time = (event.time ?? 0) + time;
9
+ this.entity = event.entity ?? entity;
10
+ this.interruptable = event.interruptable ?? interruptable;
11
+ } else {
12
+ this.event = event;
13
+ this.message = message;
14
+ this.time = time;
15
+ this.entity = entity;
16
+ this.interruptable = interruptable;
17
+ }
18
+ },
19
+ proto = TimeEvent.prototype;
20
+
21
+ proto.toJSON = function () {
22
+ return {
23
+ event: this.event,
24
+ message: this.message,
25
+ time: this.time,
26
+ entity: this.entity?.id ?? this.entity,
27
+ interruptable: this.interruptable
28
+ };
29
+ };
30
+
31
+ /**
32
+ * Returns a TimeEvent from cache or creates a new one if none are available.
33
+ *
34
+ * @method platypus.TimeEvent.setUp
35
+ * @return {platypus.TimeEvent} The instantiated TimeEvent.
36
+ */
37
+ /**
38
+ * Returns a TimeEvent back to the cache.
39
+ *
40
+ * @method platypus.TimeEvent.recycle
41
+ * @param {platypus.TimeEvent} timeEvent The TimeEvent to be recycled.
42
+ */
43
+ /**
44
+ * Relinquishes properties of the TimeEvent and recycles it.
45
+ *
46
+ * @method platypus.TimeEvent#recycle
47
+ */
48
+ recycle.add(TimeEvent, 'TimeEvent', TimeEvent, null, true);
49
+
50
+ export default TimeEvent;
@@ -0,0 +1,100 @@
1
+ import recycle from 'recycle';
2
+ import { arrayCache } from './utils/array';
3
+ import TimeEvent from './TimeEvent';
4
+
5
+ const
6
+ TimeEventList = function (list = [], time = 0) {
7
+ if (!this.list) {
8
+ this.list = arrayCache.setUp();
9
+ }
10
+
11
+ this.addEvents(list);
12
+ this.time = time;
13
+ },
14
+ sortByTime = function (a, b) {
15
+ return a.time - b.time;
16
+ },
17
+ proto = TimeEventList.prototype;
18
+
19
+ proto.clear = function (list) {
20
+ return this.getEvents(Infinity, list);
21
+ };
22
+
23
+ proto.addEvents = function (list, time = 0) {
24
+ const
25
+ {list: timeList} = this,
26
+ arr = arrayCache.setUp();
27
+
28
+ list.forEach((entry) => {
29
+ if (typeof entry === 'number') {
30
+ time += entry;
31
+ } else if (entry instanceof TimeEvent) {
32
+ timeList.push(entry);
33
+ arr.push(entry);
34
+ } else {
35
+ const
36
+ event = TimeEvent.setUp(entry, time);
37
+
38
+ timeList.push(event);
39
+ arr.push(event);
40
+ }
41
+ });
42
+
43
+ timeList.sort(sortByTime);
44
+
45
+ return arr;
46
+ };
47
+
48
+ proto.getEvents = function (time, limitToThese) {
49
+ const
50
+ arr = arrayCache.setUp(),
51
+ {list} = this;
52
+
53
+ this.time = time;
54
+
55
+ while (list.length && list[0].time <= time) {
56
+ if (!limitToThese || limitToThese.indexOf(list[0]) >= 0) {
57
+ arr.push(list.shift());
58
+ }
59
+ }
60
+
61
+ return arr;
62
+ }
63
+
64
+ proto.getDuration = function () {
65
+ const
66
+ {list} = this;
67
+
68
+ return list.length ? list[list.length - 1].time : 0;
69
+ }
70
+
71
+ proto.update = function (delta) {
72
+ return this.getEvents(this.time + delta);
73
+ };
74
+
75
+ proto.toJSON = function () {
76
+ return this.list.map((entry) => entry.toJSON());
77
+ };
78
+
79
+ /**
80
+ * Returns a TimeEventList from cache or creates a new one if none are available.
81
+ *
82
+ * @method platypus.TimeEventList.setUp
83
+ * @return {platypus.TimeEventList} The instantiated TimeEventList.
84
+ */
85
+ /**
86
+ * Returns a TimeEventList back to the cache.
87
+ *
88
+ * @method platypus.TimeEventList.recycle
89
+ * @param {platypus.TimeEventList} timeEvent The TimeEventList to be recycled.
90
+ */
91
+ /**
92
+ * Relinquishes properties of the TimeEventList and recycles it.
93
+ *
94
+ * @method platypus.TimeEventList#recycle
95
+ */
96
+ recycle.add(TimeEventList, 'TimeEventList', TimeEventList, function () {
97
+ this.list.length = 0;
98
+ }, true);
99
+
100
+ export default TimeEventList;