4 <dt><a href="#AngleComponent">AngleComponent</a> ⇐ <code>external:Serpentity.Component</code></dt>
6 <dt><a href="#BodyComponent">BodyComponent</a> ⇐ <code>external:Serpentity.Component</code></dt>
8 <dt><a href="#CoupledEntitiesComponent">CoupledEntitiesComponent</a> ⇐ <code>external:Serpentity.Component</code></dt>
10 <dt><a href="#PixiContainerComponent">PixiContainerComponent</a> ⇐ <code>external:Serpentity.Component</code></dt>
12 <dt><a href="#PhysicalWithAttributesNode">PhysicalWithAttributesNode</a> ⇐ <code>external:Serpentity.Node</code></dt>
14 <dt><a href="#PhysicalNode">PhysicalNode</a> ⇐ <code>external:Serpentity.Node</code></dt>
16 <dt><a href="#RenderableCoupleNode">RenderableCoupleNode</a> ⇐ <code>external:Serpentity.Node</code></dt>
18 <dt><a href="#RenderableWithAttributesNode">RenderableWithAttributesNode</a> ⇐ <code>external:Serpentity.Node</code></dt>
20 <dt><a href="#RenderableNode">RenderableNode</a> ⇐ <code>external:Serpentity.Node</code></dt>
22 <dt><a href="#Sumo">Sumo</a></dt>
24 <dt><a href="#AttributesToRenderableSystem">AttributesToRenderableSystem</a> ⇐ <code>external:Serpentity.System</code></dt>
26 <dt><a href="#CreateCouplingLineSystem">CreateCouplingLineSystem</a> ⇐ <code>external:Serpentity.System</code></dt>
28 <dt><a href="#PhysicsToAttributesSystem">PhysicsToAttributesSystem</a> ⇐ <code>external:Serpentity.System</code></dt>
30 <dt><a href="#PhysicsWorldControlSystem">PhysicsWorldControlSystem</a> ⇐ <code>external:Serpentity.System</code></dt>
32 <dt><a href="#RenderSystem">RenderSystem</a> ⇐ <code>external:Serpentity.System</code></dt>
39 <dt><a href="#PixiFactory">PixiFactory</a> : <code>object</code></dt>
40 <dd><p>Factory object that contains many methods to create prefab pixi
43 <dt><a href="#SumoFactory">SumoFactory</a> : <code>object</code></dt>
44 <dd><p>Factory object that contains many methods to create prefab entities.</p>
48 <a name="AngleComponent"></a>
50 ## AngleComponent ⇐ <code>external:Serpentity.Component</code>
51 **Kind**: global class
52 **Extends**: <code>external:Serpentity.Component</code>
53 <a name="new_AngleComponent_new"></a>
55 ### new AngleComponent(config)
56 Component that stores an angle
59 | Param | Type | Description |
61 | config | <code>object</code> | a configuration object to extend. |
63 <a name="BodyComponent"></a>
65 ## BodyComponent ⇐ <code>external:Serpentity.Component</code>
66 **Kind**: global class
67 **Extends**: <code>external:Serpentity.Component</code>
68 <a name="new_BodyComponent_new"></a>
70 ### new BodyComponent(config)
71 Component that stores a body for physics calculation
74 | Param | Type | Description |
76 | config | <code>object</code> | a configuration object to extend. |
78 <a name="CoupledEntitiesComponent"></a>
80 ## CoupledEntitiesComponent ⇐ <code>external:Serpentity.Component</code>
81 **Kind**: global class
82 **Extends**: <code>external:Serpentity.Component</code>
83 <a name="new_CoupledEntitiesComponent_new"></a>
85 ### new CoupledEntitiesComponent(config)
86 Component that stores a number of entities coupled to this one.
89 | Param | Type | Description |
91 | config | <code>object</code> | a configuration object to extend. |
93 <a name="PixiContainerComponent"></a>
95 ## PixiContainerComponent ⇐ <code>external:Serpentity.Component</code>
96 **Kind**: global class
97 **Extends**: <code>external:Serpentity.Component</code>
99 * [PixiContainerComponent](#PixiContainerComponent) ⇐ <code>external:Serpentity.Component</code>
100 * [new PixiContainerComponent(config)](#new_PixiContainerComponent_new)
101 * [.container](#PixiContainerComponent+container)
103 <a name="new_PixiContainerComponent_new"></a>
105 ### new PixiContainerComponent(config)
106 Component that stores a pixi container
109 | Param | Type | Description |
111 | config | <code>object</code> | a configuration object to extend. |
113 <a name="PixiContainerComponent+container"></a>
115 ### pixiContainerComponent.container
116 The properthy that holds the pixi container
118 **Kind**: instance property of [<code>PixiContainerComponent</code>](#PixiContainerComponent)
123 | container | <code>external:PixiJs.Container</code> |
125 <a name="PhysicalWithAttributesNode"></a>
127 ## PhysicalWithAttributesNode ⇐ <code>external:Serpentity.Node</code>
128 **Kind**: global class
129 **Extends**: <code>external:Serpentity.Node</code>
131 * [PhysicalWithAttributesNode](#PhysicalWithAttributesNode) ⇐ <code>external:Serpentity.Node</code>
132 * [new PhysicalWithAttributesNode()](#new_PhysicalWithAttributesNode_new)
133 * [.types](#PhysicalWithAttributesNode.types)
135 <a name="new_PhysicalWithAttributesNode_new"></a>
137 ### new PhysicalWithAttributesNode()
138 Node identifying an entity that can interact with physics and has
139 components updated from its values
141 <a name="PhysicalWithAttributesNode.types"></a>
143 ### PhysicalWithAttributesNode.types
144 Holds the types that are used to identify an entity with a physics
145 object and external attributes
147 **Kind**: static property of [<code>PhysicalWithAttributesNode</code>](#PhysicalWithAttributesNode)
152 | types | <code>object</code> |
154 <a name="PhysicalNode"></a>
156 ## PhysicalNode ⇐ <code>external:Serpentity.Node</code>
157 **Kind**: global class
158 **Extends**: <code>external:Serpentity.Node</code>
160 * [PhysicalNode](#PhysicalNode) ⇐ <code>external:Serpentity.Node</code>
161 * [new PhysicalNode()](#new_PhysicalNode_new)
162 * [.types](#PhysicalNode.types)
164 <a name="new_PhysicalNode_new"></a>
166 ### new PhysicalNode()
167 Node identifying an entity that can interact with physics
169 <a name="PhysicalNode.types"></a>
171 ### PhysicalNode.types
172 Holds the types that are used to identify an entity with a physical
175 **Kind**: static property of [<code>PhysicalNode</code>](#PhysicalNode)
180 | types | <code>object</code> |
182 <a name="RenderableCoupleNode"></a>
184 ## RenderableCoupleNode ⇐ <code>external:Serpentity.Node</code>
185 **Kind**: global class
186 **Extends**: <code>external:Serpentity.Node</code>
188 * [RenderableCoupleNode](#RenderableCoupleNode) ⇐ <code>external:Serpentity.Node</code>
189 * [new RenderableCoupleNode()](#new_RenderableCoupleNode_new)
190 * [.types](#RenderableCoupleNode.types)
192 <a name="new_RenderableCoupleNode_new"></a>
194 ### new RenderableCoupleNode()
195 Node identifying an entity that has coupled entities and can be
198 <a name="RenderableCoupleNode.types"></a>
200 ### RenderableCoupleNode.types
201 Holds the types that are used to identify a renderable couple
203 **Kind**: static property of [<code>RenderableCoupleNode</code>](#RenderableCoupleNode)
208 | types | <code>object</code> |
210 <a name="RenderableWithAttributesNode"></a>
212 ## RenderableWithAttributesNode ⇐ <code>external:Serpentity.Node</code>
213 **Kind**: global class
214 **Extends**: <code>external:Serpentity.Node</code>
216 * [RenderableWithAttributesNode](#RenderableWithAttributesNode) ⇐ <code>external:Serpentity.Node</code>
217 * [new RenderableWithAttributesNode()](#new_RenderableWithAttributesNode_new)
218 * [.types](#RenderableWithAttributesNode.types)
220 <a name="new_RenderableWithAttributesNode_new"></a>
222 ### new RenderableWithAttributesNode()
223 Node identifying a renderable entity, should have position and a
226 <a name="RenderableWithAttributesNode.types"></a>
228 ### RenderableWithAttributesNode.types
229 Holds the types that are used to identify a renderable with external
232 **Kind**: static property of [<code>RenderableWithAttributesNode</code>](#RenderableWithAttributesNode)
237 | types | <code>object</code> |
239 <a name="RenderableNode"></a>
241 ## RenderableNode ⇐ <code>external:Serpentity.Node</code>
242 **Kind**: global class
243 **Extends**: <code>external:Serpentity.Node</code>
245 * [RenderableNode](#RenderableNode) ⇐ <code>external:Serpentity.Node</code>
246 * [new RenderableNode()](#new_RenderableNode_new)
247 * [.types](#RenderableNode.types)
249 <a name="new_RenderableNode_new"></a>
251 ### new RenderableNode()
252 Node identifying a renderable entity, should have a pixi renderable
254 <a name="RenderableNode.types"></a>
256 ### RenderableNode.types
257 Holds the types that are used to identify a renderable entity
259 **Kind**: static property of [<code>RenderableNode</code>](#RenderableNode)
264 | types | <code>object</code> |
269 **Kind**: global class
272 | Name | Type | Default | Description |
273 | --- | --- | --- | --- |
274 | [element] | <code>HTMLElement</code> | <code></code> | the element in which to render. Required, will throw if not provided |
275 | [fps] | <code>Number</code> | <code>60</code> | the fps target to maintain |
276 | [verticalResolution] | <code>Number</code> | <code>224</code> | how many pixels to render in the vertical axis (gets scaled if the canvas is larger) |
277 | [aspectRatio] | <code>Array.<Number></code> | <code>[2.76, 1]</code> | the aspect ratio experssed as an array of two numbers, where aspect ratio x:y is [x, y] (eg. [16, 9]) |
281 * [new Sumo(config)](#new_Sumo_new)
282 * [.startLoop()](#Sumo+startLoop)
283 * [.pauseLoop()](#Sumo+pauseLoop)
285 <a name="new_Sumo_new"></a>
288 Sumo - main entry point. Attached to window->load
291 | Param | Type | Description |
293 | config | <code>object</code> | the configuration to extend the object |
295 <a name="Sumo+startLoop"></a>
298 Starts the main loop. Resets the FPS (if you change it it won't go
299 live until after you stop and start the loop)
301 **Kind**: instance method of [<code>Sumo</code>](#Sumo)
302 <a name="Sumo+pauseLoop"></a>
307 **Kind**: instance method of [<code>Sumo</code>](#Sumo)
308 <a name="AttributesToRenderableSystem"></a>
310 ## AttributesToRenderableSystem ⇐ <code>external:Serpentity.System</code>
311 **Kind**: global class
312 **Extends**: <code>external:Serpentity.System</code>
314 * [AttributesToRenderableSystem](#AttributesToRenderableSystem) ⇐ <code>external:Serpentity.System</code>
315 * [new AttributesToRenderableSystem(config)](#new_AttributesToRenderableSystem_new)
316 * [.added(engine)](#AttributesToRenderableSystem+added)
317 * [.removed()](#AttributesToRenderableSystem+removed)
318 * [.update(currentFrameDuration)](#AttributesToRenderableSystem+update)
320 <a name="new_AttributesToRenderableSystem_new"></a>
322 ### new AttributesToRenderableSystem(config)
323 Updates the renderables based on their attribuets
326 | Param | Type | Description |
328 | config | <code>object</code> | a configuration object to extend. |
330 <a name="AttributesToRenderableSystem+added"></a>
332 ### attributesToRenderableSystem.added(engine)
333 Initializes system when added. Requests renderable nodes and
334 attaches to event listeners to add / remove them to pixi stage
336 **Kind**: instance method of [<code>AttributesToRenderableSystem</code>](#AttributesToRenderableSystem)
338 | Param | Type | Description |
340 | engine | <code>external:Serpentity.Engine</code> | the serpentity engine to which we are getting added |
342 <a name="AttributesToRenderableSystem+removed"></a>
344 ### attributesToRenderableSystem.removed()
345 Clears system resources when removed.
347 **Kind**: instance method of [<code>AttributesToRenderableSystem</code>](#AttributesToRenderableSystem)
348 <a name="AttributesToRenderableSystem+update"></a>
350 ### attributesToRenderableSystem.update(currentFrameDuration)
351 Runs on every update of the loop. Updates the graphics so they're
354 **Kind**: instance method of [<code>AttributesToRenderableSystem</code>](#AttributesToRenderableSystem)
356 | Param | Type | Description |
358 | currentFrameDuration | <code>Number</code> | the duration of the current frame |
360 <a name="CreateCouplingLineSystem"></a>
362 ## CreateCouplingLineSystem ⇐ <code>external:Serpentity.System</code>
363 **Kind**: global class
364 **Extends**: <code>external:Serpentity.System</code>
366 * [CreateCouplingLineSystem](#CreateCouplingLineSystem) ⇐ <code>external:Serpentity.System</code>
367 * [new CreateCouplingLineSystem(config)](#new_CreateCouplingLineSystem_new)
368 * [.added(engine)](#CreateCouplingLineSystem+added)
369 * [.removed()](#CreateCouplingLineSystem+removed)
370 * [.update(currentFrameDuration)](#CreateCouplingLineSystem+update)
372 <a name="new_CreateCouplingLineSystem_new"></a>
374 ### new CreateCouplingLineSystem(config)
375 Renders renderable objects using pixi
378 | Param | Type | Description |
380 | config | <code>object</code> | a configuration object to extend. |
382 <a name="CreateCouplingLineSystem+added"></a>
384 ### createCouplingLineSystem.added(engine)
385 Initializes system when added. Requests renderable nodes and
387 **Kind**: instance method of [<code>CreateCouplingLineSystem</code>](#CreateCouplingLineSystem)
389 | Param | Type | Description |
391 | engine | <code>external:Serpentity.Engine</code> | the serpentity engine to which we are getting added |
393 <a name="CreateCouplingLineSystem+removed"></a>
395 ### createCouplingLineSystem.removed()
396 Clears system resources when removed.
398 **Kind**: instance method of [<code>CreateCouplingLineSystem</code>](#CreateCouplingLineSystem)
399 <a name="CreateCouplingLineSystem+update"></a>
401 ### createCouplingLineSystem.update(currentFrameDuration)
402 Runs on every update of the loop. Does nothing.
404 **Kind**: instance method of [<code>CreateCouplingLineSystem</code>](#CreateCouplingLineSystem)
406 | Param | Type | Description |
408 | currentFrameDuration | <code>Number</code> | the duration of the current frame |
410 <a name="PhysicsToAttributesSystem"></a>
412 ## PhysicsToAttributesSystem ⇐ <code>external:Serpentity.System</code>
413 **Kind**: global class
414 **Extends**: <code>external:Serpentity.System</code>
416 * [PhysicsToAttributesSystem](#PhysicsToAttributesSystem) ⇐ <code>external:Serpentity.System</code>
417 * [new PhysicsToAttributesSystem(config)](#new_PhysicsToAttributesSystem_new)
418 * [.added(engine)](#PhysicsToAttributesSystem+added)
419 * [.removed()](#PhysicsToAttributesSystem+removed)
420 * [.update(currentFrameDuration)](#PhysicsToAttributesSystem+update)
422 <a name="new_PhysicsToAttributesSystem_new"></a>
424 ### new PhysicsToAttributesSystem(config)
425 Distribuets physics data to the related components
428 | Param | Type | Description |
430 | config | <code>object</code> | a configuration object to extend. |
432 <a name="PhysicsToAttributesSystem+added"></a>
434 ### physicsToAttributesSystem.added(engine)
435 Initializes system when added. Requests physics nodes
437 **Kind**: instance method of [<code>PhysicsToAttributesSystem</code>](#PhysicsToAttributesSystem)
439 | Param | Type | Description |
441 | engine | <code>external:Serpentity.Engine</code> | the serpentity engine to which we are getting added |
443 <a name="PhysicsToAttributesSystem+removed"></a>
445 ### physicsToAttributesSystem.removed()
446 Clears system resources when removed.
448 **Kind**: instance method of [<code>PhysicsToAttributesSystem</code>](#PhysicsToAttributesSystem)
449 <a name="PhysicsToAttributesSystem+update"></a>
451 ### physicsToAttributesSystem.update(currentFrameDuration)
452 Runs on every update of the loop. Updates the other components
455 **Kind**: instance method of [<code>PhysicsToAttributesSystem</code>](#PhysicsToAttributesSystem)
457 | Param | Type | Description |
459 | currentFrameDuration | <code>Number</code> | the duration of the current frame |
461 <a name="PhysicsWorldControlSystem"></a>
463 ## PhysicsWorldControlSystem ⇐ <code>external:Serpentity.System</code>
464 **Kind**: global class
465 **Extends**: <code>external:Serpentity.System</code>
467 * [PhysicsWorldControlSystem](#PhysicsWorldControlSystem) ⇐ <code>external:Serpentity.System</code>
468 * [new PhysicsWorldControlSystem(config)](#new_PhysicsWorldControlSystem_new)
469 * [.added(engine)](#PhysicsWorldControlSystem+added)
470 * [.removed()](#PhysicsWorldControlSystem+removed)
471 * [.update(currentFrameDuration)](#PhysicsWorldControlSystem+update)
473 <a name="new_PhysicsWorldControlSystem_new"></a>
475 ### new PhysicsWorldControlSystem(config)
476 Adds and removes objects to the physics world and calls update
479 | Param | Type | Description |
481 | config | <code>object</code> | a configuration object to extend. |
483 <a name="PhysicsWorldControlSystem+added"></a>
485 ### physicsWorldControlSystem.added(engine)
486 Initializes system when added. Requests physics nodes and
487 attaches to event listeners to add / remove them to pixi stage
489 **Kind**: instance method of [<code>PhysicsWorldControlSystem</code>](#PhysicsWorldControlSystem)
491 | Param | Type | Description |
493 | engine | <code>external:Serpentity.Engine</code> | the serpentity engine to which we are getting added |
495 <a name="PhysicsWorldControlSystem+removed"></a>
497 ### physicsWorldControlSystem.removed()
498 Clears system resources when removed.
500 **Kind**: instance method of [<code>PhysicsWorldControlSystem</code>](#PhysicsWorldControlSystem)
501 <a name="PhysicsWorldControlSystem+update"></a>
503 ### physicsWorldControlSystem.update(currentFrameDuration)
504 Runs on every update of the loop. Updates the physics
506 **Kind**: instance method of [<code>PhysicsWorldControlSystem</code>](#PhysicsWorldControlSystem)
508 | Param | Type | Description |
510 | currentFrameDuration | <code>Number</code> | the duration of the current frame |
512 <a name="RenderSystem"></a>
514 ## RenderSystem ⇐ <code>external:Serpentity.System</code>
515 **Kind**: global class
516 **Extends**: <code>external:Serpentity.System</code>
518 * [RenderSystem](#RenderSystem) ⇐ <code>external:Serpentity.System</code>
519 * [new RenderSystem(config)](#new_RenderSystem_new)
520 * [.added(engine)](#RenderSystem+added)
521 * [.removed()](#RenderSystem+removed)
522 * [.update(currentFrameDuration)](#RenderSystem+update)
524 <a name="new_RenderSystem_new"></a>
526 ### new RenderSystem(config)
527 Renders renderable objects using pixi
530 | Param | Type | Description |
532 | config | <code>object</code> | a configuration object to extend. |
534 <a name="RenderSystem+added"></a>
536 ### renderSystem.added(engine)
537 Initializes system when added. Requests renderable nodes and
538 attaches to event listeners to add / remove them to pixi stage
540 **Kind**: instance method of [<code>RenderSystem</code>](#RenderSystem)
542 | Param | Type | Description |
544 | engine | <code>external:Serpentity.Engine</code> | the serpentity engine to which we are getting added |
546 <a name="RenderSystem+removed"></a>
548 ### renderSystem.removed()
549 Clears system resources when removed.
551 **Kind**: instance method of [<code>RenderSystem</code>](#RenderSystem)
552 <a name="RenderSystem+update"></a>
554 ### renderSystem.update(currentFrameDuration)
555 Runs on every update of the loop. Does nothing.
557 **Kind**: instance method of [<code>RenderSystem</code>](#RenderSystem)
559 | Param | Type | Description |
561 | currentFrameDuration | <code>Number</code> | the duration of the current frame |
563 <a name="PixiFactory"></a>
565 ## PixiFactory : <code>object</code>
566 Factory object that contains many methods to create prefab pixi
569 **Kind**: global variable
571 * [PixiFactory](#PixiFactory) : <code>object</code>
572 * [.createSumo()](#PixiFactory.createSumo) ⇒ <code>external:CreateJs.Container</code>
573 * [.createEmptyGraphic()](#PixiFactory.createEmptyGraphic) ⇒ <code>external:CreateJs.Container</code>
575 <a name="PixiFactory.createSumo"></a>
577 ### PixiFactory.createSumo() ⇒ <code>external:CreateJs.Container</code>
578 Creates a sumo container
580 **Kind**: static method of [<code>PixiFactory</code>](#PixiFactory)
581 **Returns**: <code>external:CreateJs.Container</code> - the created container
582 <a name="PixiFactory.createEmptyGraphic"></a>
584 ### PixiFactory.createEmptyGraphic() ⇒ <code>external:CreateJs.Container</code>
585 Creates an empty graphic
587 **Kind**: static method of [<code>PixiFactory</code>](#PixiFactory)
588 **Returns**: <code>external:CreateJs.Container</code> - the created container
589 <a name="SumoFactory"></a>
591 ## SumoFactory : <code>object</code>
592 Factory object that contains many methods to create prefab entities.
594 **Kind**: global variable
596 * [SumoFactory](#SumoFactory) : <code>object</code>
597 * [.createSumo([engine], [config])](#SumoFactory.createSumo) ⇒ <code>external:Serpentity.Entity</code>
598 * [.createRubberBand([engine], [config])](#SumoFactory.createRubberBand) ⇒ <code>external:Serpentity.Entity</code>
600 <a name="SumoFactory.createSumo"></a>
602 ### SumoFactory.createSumo([engine], [config]) ⇒ <code>external:Serpentity.Entity</code>
603 Creates a sumo entity and adds it to the engine. Can override
604 position in the config object
606 **Kind**: static method of [<code>SumoFactory</code>](#SumoFactory)
607 **Returns**: <code>external:Serpentity.Entity</code> - the created entity
609 | Param | Type | Description |
611 | [engine] | <code>external:Serpentity</code> | the serpentity engine to attach to. If not sent, it will not be attached. |
612 | [config] | <code>object</code> | the config to override the entity, accepts the key `position` as an object with an x and y property. |
614 <a name="SumoFactory.createRubberBand"></a>
616 ### SumoFactory.createRubberBand([engine], [config]) ⇒ <code>external:Serpentity.Entity</code>
617 Creates a rubber band entity and adds it to the engine.
619 **Kind**: static method of [<code>SumoFactory</code>](#SumoFactory)
620 **Returns**: <code>external:Serpentity.Entity</code> - the created entity
622 | Param | Type | Description |
624 | [engine] | <code>external:Serpentity</code> | the serpentity engine to attach to. If not sent, it will not be attached. |
625 | [config] | <code>object</code> | the config to override the entity, it must include entityA and entityB which will be tied by it. If they are not sent or don't have a physics body, this will throw. |