@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,128 @@
1
+ /* global platypus */
2
+ import Data from '../Data.js';
3
+ import createComponentClass from '../factory.js';
4
+
5
+ export default (function () {
6
+ return createComponentClass(/** @lends platypus.components.SceneChanger.prototype */{
7
+ id: 'SceneChanger',
8
+
9
+ properties: {
10
+ /**
11
+ * Optional, but must be provided by a "new-scene" parameter if not defined here. This causes a "new-scene" event to load this set of layers.
12
+ *
13
+ * @property loadLayers
14
+ * @type Array
15
+ * @default null
16
+ */
17
+ loadLayers: null,
18
+
19
+ /**
20
+ * Optional. This causes a "new-scene" event to load this scene.
21
+ *
22
+ * @property scene
23
+ * @type String
24
+ * @default ""
25
+ */
26
+ scene: "",
27
+
28
+ /**
29
+ * Optional, but must be provided by a "new-scene" parameter if not defined here. This causes a "new-scene" event to unload these layers.
30
+ *
31
+ * @property unloadLayers
32
+ * @type Array
33
+ * @default null
34
+ */
35
+ unloadLayers: null,
36
+
37
+ /**
38
+ * An object containing key/value pairs of information that should be passed into the new layers on the new layers' "layer-loaded" and "layer-live" events.
39
+ *
40
+ * @property persistentData
41
+ * @type platypus.Data|Object
42
+ * @default null
43
+ */
44
+ persistentData: null
45
+ },
46
+
47
+ /**
48
+ * This component allows the entity to initiate a change from the current scene to another scene.
49
+ *
50
+ * @memberof platypus.components
51
+ * @extends platypus.Component
52
+ * @constructs
53
+ * @listens platypus.Entity#new-scene
54
+ * @listens platypus.Entity#set-scene
55
+ * @listens platypus.Entity#set-persistent-scene-data
56
+ */
57
+ initialize: function () {
58
+ this.persistentData = Data.setUp(this.persistentData);
59
+ },
60
+
61
+ events: {
62
+ /**
63
+ * On receiving this message, a new scene is loaded according to provided parameters or previously determined component settings.
64
+ *
65
+ * @event platypus.Entity#new-scene
66
+ * @param message.load {String} This is a label corresponding with a predefined layer.
67
+ * @param message.persistentData {Object} Any values that should be passed to the layers' "layer-loaded" and "layer-live" events.
68
+ */
69
+ "new-scene": function (response) {
70
+ const
71
+ loadLayers = (response && response.loadLayers) || this.loadLayers,
72
+ scene = (response && response.scene) || this.scene,
73
+ unloadLayers = (response && response.unloadLayers) || this.unloadLayers,
74
+ data = (response && response.persistentData) || this.persistentData;
75
+
76
+ if (unloadLayers && unloadLayers.length) {
77
+ for (let i = 0; i < unloadLayers.length; i++) {
78
+ platypus.game.unload(unloadLayers[i]);
79
+ }
80
+ }
81
+
82
+ if (loadLayers && loadLayers.length) {
83
+ platypus.game.load(loadLayers, data);
84
+ }
85
+
86
+ if (scene) {
87
+ platypus.game.loadScene(scene, data);
88
+ }
89
+ },
90
+
91
+ /**
92
+ * On receiving this message, a scene value is stored, waiting for a `new-scene` to make the transition.
93
+ *
94
+ * @event platypus.Entity#set-scene
95
+ * @param scene {String} This is a label corresponding with a predefined scene.
96
+ */
97
+ "set-scene": function (scene) {
98
+ this.scene = scene;
99
+ },
100
+
101
+ /**
102
+ * On receiving this message, persistent data is stored, waiting for a `new-scene` to make the transition.
103
+ *
104
+ * @event platypus.Entity#set-persistent-scene-data
105
+ * @param persistentData {Object} Any values that should be passed to the next scene via the "layer-loaded" and "layer-live" events.
106
+ */
107
+ "set-persistent-scene-data": function (data) {
108
+ const
109
+ thisData = this.persistentData,
110
+ keys = Object.keys(data),
111
+ {length} = keys;
112
+
113
+ for (let i = 0; i < length; i++) {
114
+ const
115
+ key = keys[i];
116
+
117
+ thisData[key] = data[key];
118
+ }
119
+ }
120
+ },
121
+
122
+ methods: {
123
+ destroy: function () {
124
+ //data.recycle() - can't do this here since it may be in use by the next scene.
125
+ }
126
+ }
127
+ });
128
+ }());