]> git.r.bdr.sh - rbdr/sumo/blob - doc/README.md
Use new lib components
[rbdr/sumo] / doc / README.md
1 ## Classes
2
3 <dl>
4 <dt><a href="#AngleComponent">AngleComponent</a> ⇐ <code>external:Serpentity.Component</code></dt>
5 <dd></dd>
6 <dt><a href="#BodyComponent">BodyComponent</a> ⇐ <code>external:Serpentity.Component</code></dt>
7 <dd></dd>
8 <dt><a href="#CoupledEntitiesComponent">CoupledEntitiesComponent</a> ⇐ <code>external:Serpentity.Component</code></dt>
9 <dd></dd>
10 <dt><a href="#PixiContainerComponent">PixiContainerComponent</a> ⇐ <code>external:Serpentity.Component</code></dt>
11 <dd></dd>
12 <dt><a href="#PhysicalWithAttributesNode">PhysicalWithAttributesNode</a> ⇐ <code>external:Serpentity.Node</code></dt>
13 <dd></dd>
14 <dt><a href="#PhysicalNode">PhysicalNode</a> ⇐ <code>external:Serpentity.Node</code></dt>
15 <dd></dd>
16 <dt><a href="#RenderableCoupleNode">RenderableCoupleNode</a> ⇐ <code>external:Serpentity.Node</code></dt>
17 <dd></dd>
18 <dt><a href="#RenderableWithAttributesNode">RenderableWithAttributesNode</a> ⇐ <code>external:Serpentity.Node</code></dt>
19 <dd></dd>
20 <dt><a href="#RenderableNode">RenderableNode</a> ⇐ <code>external:Serpentity.Node</code></dt>
21 <dd></dd>
22 <dt><a href="#Sumo">Sumo</a></dt>
23 <dd></dd>
24 <dt><a href="#AttributesToRenderableSystem">AttributesToRenderableSystem</a> ⇐ <code>external:Serpentity.System</code></dt>
25 <dd></dd>
26 <dt><a href="#CreateCouplingLineSystem">CreateCouplingLineSystem</a> ⇐ <code>external:Serpentity.System</code></dt>
27 <dd></dd>
28 <dt><a href="#PhysicsToAttributesSystem">PhysicsToAttributesSystem</a> ⇐ <code>external:Serpentity.System</code></dt>
29 <dd></dd>
30 <dt><a href="#PhysicsWorldControlSystem">PhysicsWorldControlSystem</a> ⇐ <code>external:Serpentity.System</code></dt>
31 <dd></dd>
32 <dt><a href="#RenderSystem">RenderSystem</a> ⇐ <code>external:Serpentity.System</code></dt>
33 <dd></dd>
34 </dl>
35
36 ## Members
37
38 <dl>
39 <dt><a href="#PixiFactory">PixiFactory</a> : <code>object</code></dt>
40 <dd><p>Factory object that contains many methods to create prefab pixi
41 objects</p>
42 </dd>
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>
45 </dd>
46 </dl>
47
48 <a name="AngleComponent"></a>
49
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>
54
55 ### new AngleComponent(config)
56 Component that stores an angle
57
58
59 | Param | Type | Description |
60 | --- | --- | --- |
61 | config | <code>object</code> | a configuration object to extend. |
62
63 <a name="BodyComponent"></a>
64
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>
69
70 ### new BodyComponent(config)
71 Component that stores a body for physics calculation
72
73
74 | Param | Type | Description |
75 | --- | --- | --- |
76 | config | <code>object</code> | a configuration object to extend. |
77
78 <a name="CoupledEntitiesComponent"></a>
79
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>
84
85 ### new CoupledEntitiesComponent(config)
86 Component that stores a number of entities coupled to this one.
87
88
89 | Param | Type | Description |
90 | --- | --- | --- |
91 | config | <code>object</code> | a configuration object to extend. |
92
93 <a name="PixiContainerComponent"></a>
94
95 ## PixiContainerComponent ⇐ <code>external:Serpentity.Component</code>
96 **Kind**: global class
97 **Extends**: <code>external:Serpentity.Component</code>
98
99 * [PixiContainerComponent](#PixiContainerComponent) ⇐ <code>external:Serpentity.Component</code>
100 * [new PixiContainerComponent(config)](#new_PixiContainerComponent_new)
101 * [.container](#PixiContainerComponent+container)
102
103 <a name="new_PixiContainerComponent_new"></a>
104
105 ### new PixiContainerComponent(config)
106 Component that stores a pixi container
107
108
109 | Param | Type | Description |
110 | --- | --- | --- |
111 | config | <code>object</code> | a configuration object to extend. |
112
113 <a name="PixiContainerComponent+container"></a>
114
115 ### pixiContainerComponent.container
116 The properthy that holds the pixi container
117
118 **Kind**: instance property of [<code>PixiContainerComponent</code>](#PixiContainerComponent)
119 **Properties**
120
121 | Name | Type |
122 | --- | --- |
123 | container | <code>external:PixiJs.Container</code> |
124
125 <a name="PhysicalWithAttributesNode"></a>
126
127 ## PhysicalWithAttributesNode ⇐ <code>external:Serpentity.Node</code>
128 **Kind**: global class
129 **Extends**: <code>external:Serpentity.Node</code>
130
131 * [PhysicalWithAttributesNode](#PhysicalWithAttributesNode) ⇐ <code>external:Serpentity.Node</code>
132 * [new PhysicalWithAttributesNode()](#new_PhysicalWithAttributesNode_new)
133 * [.types](#PhysicalWithAttributesNode.types)
134
135 <a name="new_PhysicalWithAttributesNode_new"></a>
136
137 ### new PhysicalWithAttributesNode()
138 Node identifying an entity that can interact with physics and has
139 components updated from its values
140
141 <a name="PhysicalWithAttributesNode.types"></a>
142
143 ### PhysicalWithAttributesNode.types
144 Holds the types that are used to identify an entity with a physics
145 object and external attributes
146
147 **Kind**: static property of [<code>PhysicalWithAttributesNode</code>](#PhysicalWithAttributesNode)
148 **Properties**
149
150 | Name | Type |
151 | --- | --- |
152 | types | <code>object</code> |
153
154 <a name="PhysicalNode"></a>
155
156 ## PhysicalNode ⇐ <code>external:Serpentity.Node</code>
157 **Kind**: global class
158 **Extends**: <code>external:Serpentity.Node</code>
159
160 * [PhysicalNode](#PhysicalNode) ⇐ <code>external:Serpentity.Node</code>
161 * [new PhysicalNode()](#new_PhysicalNode_new)
162 * [.types](#PhysicalNode.types)
163
164 <a name="new_PhysicalNode_new"></a>
165
166 ### new PhysicalNode()
167 Node identifying an entity that can interact with physics
168
169 <a name="PhysicalNode.types"></a>
170
171 ### PhysicalNode.types
172 Holds the types that are used to identify an entity with a physical
173 body
174
175 **Kind**: static property of [<code>PhysicalNode</code>](#PhysicalNode)
176 **Properties**
177
178 | Name | Type |
179 | --- | --- |
180 | types | <code>object</code> |
181
182 <a name="RenderableCoupleNode"></a>
183
184 ## RenderableCoupleNode ⇐ <code>external:Serpentity.Node</code>
185 **Kind**: global class
186 **Extends**: <code>external:Serpentity.Node</code>
187
188 * [RenderableCoupleNode](#RenderableCoupleNode) ⇐ <code>external:Serpentity.Node</code>
189 * [new RenderableCoupleNode()](#new_RenderableCoupleNode_new)
190 * [.types](#RenderableCoupleNode.types)
191
192 <a name="new_RenderableCoupleNode_new"></a>
193
194 ### new RenderableCoupleNode()
195 Node identifying an entity that has coupled entities and can be
196 rendered
197
198 <a name="RenderableCoupleNode.types"></a>
199
200 ### RenderableCoupleNode.types
201 Holds the types that are used to identify a renderable couple
202
203 **Kind**: static property of [<code>RenderableCoupleNode</code>](#RenderableCoupleNode)
204 **Properties**
205
206 | Name | Type |
207 | --- | --- |
208 | types | <code>object</code> |
209
210 <a name="RenderableWithAttributesNode"></a>
211
212 ## RenderableWithAttributesNode ⇐ <code>external:Serpentity.Node</code>
213 **Kind**: global class
214 **Extends**: <code>external:Serpentity.Node</code>
215
216 * [RenderableWithAttributesNode](#RenderableWithAttributesNode) ⇐ <code>external:Serpentity.Node</code>
217 * [new RenderableWithAttributesNode()](#new_RenderableWithAttributesNode_new)
218 * [.types](#RenderableWithAttributesNode.types)
219
220 <a name="new_RenderableWithAttributesNode_new"></a>
221
222 ### new RenderableWithAttributesNode()
223 Node identifying a renderable entity, should have position and a
224 symbol to render
225
226 <a name="RenderableWithAttributesNode.types"></a>
227
228 ### RenderableWithAttributesNode.types
229 Holds the types that are used to identify a renderable with external
230 attributes
231
232 **Kind**: static property of [<code>RenderableWithAttributesNode</code>](#RenderableWithAttributesNode)
233 **Properties**
234
235 | Name | Type |
236 | --- | --- |
237 | types | <code>object</code> |
238
239 <a name="RenderableNode"></a>
240
241 ## RenderableNode ⇐ <code>external:Serpentity.Node</code>
242 **Kind**: global class
243 **Extends**: <code>external:Serpentity.Node</code>
244
245 * [RenderableNode](#RenderableNode) ⇐ <code>external:Serpentity.Node</code>
246 * [new RenderableNode()](#new_RenderableNode_new)
247 * [.types](#RenderableNode.types)
248
249 <a name="new_RenderableNode_new"></a>
250
251 ### new RenderableNode()
252 Node identifying a renderable entity, should have a pixi renderable
253
254 <a name="RenderableNode.types"></a>
255
256 ### RenderableNode.types
257 Holds the types that are used to identify a renderable entity
258
259 **Kind**: static property of [<code>RenderableNode</code>](#RenderableNode)
260 **Properties**
261
262 | Name | Type |
263 | --- | --- |
264 | types | <code>object</code> |
265
266 <a name="Sumo"></a>
267
268 ## Sumo
269 **Kind**: global class
270 **Properties**
271
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.&lt;Number&gt;</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]) |
278
279
280 * [Sumo](#Sumo)
281 * [new Sumo(config)](#new_Sumo_new)
282 * [.startLoop()](#Sumo+startLoop)
283 * [.pauseLoop()](#Sumo+pauseLoop)
284
285 <a name="new_Sumo_new"></a>
286
287 ### new Sumo(config)
288 Sumo - main entry point. Attached to window->load
289
290
291 | Param | Type | Description |
292 | --- | --- | --- |
293 | config | <code>object</code> | the configuration to extend the object |
294
295 <a name="Sumo+startLoop"></a>
296
297 ### sumo.startLoop()
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)
300
301 **Kind**: instance method of [<code>Sumo</code>](#Sumo)
302 <a name="Sumo+pauseLoop"></a>
303
304 ### sumo.pauseLoop()
305 Pauses the loop
306
307 **Kind**: instance method of [<code>Sumo</code>](#Sumo)
308 <a name="AttributesToRenderableSystem"></a>
309
310 ## AttributesToRenderableSystem ⇐ <code>external:Serpentity.System</code>
311 **Kind**: global class
312 **Extends**: <code>external:Serpentity.System</code>
313
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)
319
320 <a name="new_AttributesToRenderableSystem_new"></a>
321
322 ### new AttributesToRenderableSystem(config)
323 Updates the renderables based on their attribuets
324
325
326 | Param | Type | Description |
327 | --- | --- | --- |
328 | config | <code>object</code> | a configuration object to extend. |
329
330 <a name="AttributesToRenderableSystem+added"></a>
331
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
335
336 **Kind**: instance method of [<code>AttributesToRenderableSystem</code>](#AttributesToRenderableSystem)
337
338 | Param | Type | Description |
339 | --- | --- | --- |
340 | engine | <code>external:Serpentity.Engine</code> | the serpentity engine to which we are getting added |
341
342 <a name="AttributesToRenderableSystem+removed"></a>
343
344 ### attributesToRenderableSystem.removed()
345 Clears system resources when removed.
346
347 **Kind**: instance method of [<code>AttributesToRenderableSystem</code>](#AttributesToRenderableSystem)
348 <a name="AttributesToRenderableSystem+update"></a>
349
350 ### attributesToRenderableSystem.update(currentFrameDuration)
351 Runs on every update of the loop. Updates the graphics so they're
352 rendered correctly
353
354 **Kind**: instance method of [<code>AttributesToRenderableSystem</code>](#AttributesToRenderableSystem)
355
356 | Param | Type | Description |
357 | --- | --- | --- |
358 | currentFrameDuration | <code>Number</code> | the duration of the current frame |
359
360 <a name="CreateCouplingLineSystem"></a>
361
362 ## CreateCouplingLineSystem ⇐ <code>external:Serpentity.System</code>
363 **Kind**: global class
364 **Extends**: <code>external:Serpentity.System</code>
365
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)
371
372 <a name="new_CreateCouplingLineSystem_new"></a>
373
374 ### new CreateCouplingLineSystem(config)
375 Renders renderable objects using pixi
376
377
378 | Param | Type | Description |
379 | --- | --- | --- |
380 | config | <code>object</code> | a configuration object to extend. |
381
382 <a name="CreateCouplingLineSystem+added"></a>
383
384 ### createCouplingLineSystem.added(engine)
385 Initializes system when added. Requests renderable nodes and
386
387 **Kind**: instance method of [<code>CreateCouplingLineSystem</code>](#CreateCouplingLineSystem)
388
389 | Param | Type | Description |
390 | --- | --- | --- |
391 | engine | <code>external:Serpentity.Engine</code> | the serpentity engine to which we are getting added |
392
393 <a name="CreateCouplingLineSystem+removed"></a>
394
395 ### createCouplingLineSystem.removed()
396 Clears system resources when removed.
397
398 **Kind**: instance method of [<code>CreateCouplingLineSystem</code>](#CreateCouplingLineSystem)
399 <a name="CreateCouplingLineSystem+update"></a>
400
401 ### createCouplingLineSystem.update(currentFrameDuration)
402 Runs on every update of the loop. Does nothing.
403
404 **Kind**: instance method of [<code>CreateCouplingLineSystem</code>](#CreateCouplingLineSystem)
405
406 | Param | Type | Description |
407 | --- | --- | --- |
408 | currentFrameDuration | <code>Number</code> | the duration of the current frame |
409
410 <a name="PhysicsToAttributesSystem"></a>
411
412 ## PhysicsToAttributesSystem ⇐ <code>external:Serpentity.System</code>
413 **Kind**: global class
414 **Extends**: <code>external:Serpentity.System</code>
415
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)
421
422 <a name="new_PhysicsToAttributesSystem_new"></a>
423
424 ### new PhysicsToAttributesSystem(config)
425 Distribuets physics data to the related components
426
427
428 | Param | Type | Description |
429 | --- | --- | --- |
430 | config | <code>object</code> | a configuration object to extend. |
431
432 <a name="PhysicsToAttributesSystem+added"></a>
433
434 ### physicsToAttributesSystem.added(engine)
435 Initializes system when added. Requests physics nodes
436
437 **Kind**: instance method of [<code>PhysicsToAttributesSystem</code>](#PhysicsToAttributesSystem)
438
439 | Param | Type | Description |
440 | --- | --- | --- |
441 | engine | <code>external:Serpentity.Engine</code> | the serpentity engine to which we are getting added |
442
443 <a name="PhysicsToAttributesSystem+removed"></a>
444
445 ### physicsToAttributesSystem.removed()
446 Clears system resources when removed.
447
448 **Kind**: instance method of [<code>PhysicsToAttributesSystem</code>](#PhysicsToAttributesSystem)
449 <a name="PhysicsToAttributesSystem+update"></a>
450
451 ### physicsToAttributesSystem.update(currentFrameDuration)
452 Runs on every update of the loop. Updates the other components
453 based on physics
454
455 **Kind**: instance method of [<code>PhysicsToAttributesSystem</code>](#PhysicsToAttributesSystem)
456
457 | Param | Type | Description |
458 | --- | --- | --- |
459 | currentFrameDuration | <code>Number</code> | the duration of the current frame |
460
461 <a name="PhysicsWorldControlSystem"></a>
462
463 ## PhysicsWorldControlSystem ⇐ <code>external:Serpentity.System</code>
464 **Kind**: global class
465 **Extends**: <code>external:Serpentity.System</code>
466
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)
472
473 <a name="new_PhysicsWorldControlSystem_new"></a>
474
475 ### new PhysicsWorldControlSystem(config)
476 Adds and removes objects to the physics world and calls update
477
478
479 | Param | Type | Description |
480 | --- | --- | --- |
481 | config | <code>object</code> | a configuration object to extend. |
482
483 <a name="PhysicsWorldControlSystem+added"></a>
484
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
488
489 **Kind**: instance method of [<code>PhysicsWorldControlSystem</code>](#PhysicsWorldControlSystem)
490
491 | Param | Type | Description |
492 | --- | --- | --- |
493 | engine | <code>external:Serpentity.Engine</code> | the serpentity engine to which we are getting added |
494
495 <a name="PhysicsWorldControlSystem+removed"></a>
496
497 ### physicsWorldControlSystem.removed()
498 Clears system resources when removed.
499
500 **Kind**: instance method of [<code>PhysicsWorldControlSystem</code>](#PhysicsWorldControlSystem)
501 <a name="PhysicsWorldControlSystem+update"></a>
502
503 ### physicsWorldControlSystem.update(currentFrameDuration)
504 Runs on every update of the loop. Updates the physics
505
506 **Kind**: instance method of [<code>PhysicsWorldControlSystem</code>](#PhysicsWorldControlSystem)
507
508 | Param | Type | Description |
509 | --- | --- | --- |
510 | currentFrameDuration | <code>Number</code> | the duration of the current frame |
511
512 <a name="RenderSystem"></a>
513
514 ## RenderSystem ⇐ <code>external:Serpentity.System</code>
515 **Kind**: global class
516 **Extends**: <code>external:Serpentity.System</code>
517
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)
523
524 <a name="new_RenderSystem_new"></a>
525
526 ### new RenderSystem(config)
527 Renders renderable objects using pixi
528
529
530 | Param | Type | Description |
531 | --- | --- | --- |
532 | config | <code>object</code> | a configuration object to extend. |
533
534 <a name="RenderSystem+added"></a>
535
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
539
540 **Kind**: instance method of [<code>RenderSystem</code>](#RenderSystem)
541
542 | Param | Type | Description |
543 | --- | --- | --- |
544 | engine | <code>external:Serpentity.Engine</code> | the serpentity engine to which we are getting added |
545
546 <a name="RenderSystem+removed"></a>
547
548 ### renderSystem.removed()
549 Clears system resources when removed.
550
551 **Kind**: instance method of [<code>RenderSystem</code>](#RenderSystem)
552 <a name="RenderSystem+update"></a>
553
554 ### renderSystem.update(currentFrameDuration)
555 Runs on every update of the loop. Does nothing.
556
557 **Kind**: instance method of [<code>RenderSystem</code>](#RenderSystem)
558
559 | Param | Type | Description |
560 | --- | --- | --- |
561 | currentFrameDuration | <code>Number</code> | the duration of the current frame |
562
563 <a name="PixiFactory"></a>
564
565 ## PixiFactory : <code>object</code>
566 Factory object that contains many methods to create prefab pixi
567 objects
568
569 **Kind**: global variable
570
571 * [PixiFactory](#PixiFactory) : <code>object</code>
572 * [.createSumo()](#PixiFactory.createSumo) ⇒ <code>external:CreateJs.Container</code>
573 * [.createEmptyGraphic()](#PixiFactory.createEmptyGraphic) ⇒ <code>external:CreateJs.Container</code>
574
575 <a name="PixiFactory.createSumo"></a>
576
577 ### PixiFactory.createSumo() ⇒ <code>external:CreateJs.Container</code>
578 Creates a sumo container
579
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>
583
584 ### PixiFactory.createEmptyGraphic() ⇒ <code>external:CreateJs.Container</code>
585 Creates an empty graphic
586
587 **Kind**: static method of [<code>PixiFactory</code>](#PixiFactory)
588 **Returns**: <code>external:CreateJs.Container</code> - the created container
589 <a name="SumoFactory"></a>
590
591 ## SumoFactory : <code>object</code>
592 Factory object that contains many methods to create prefab entities.
593
594 **Kind**: global variable
595
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>
599
600 <a name="SumoFactory.createSumo"></a>
601
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
605
606 **Kind**: static method of [<code>SumoFactory</code>](#SumoFactory)
607 **Returns**: <code>external:Serpentity.Entity</code> - the created entity
608
609 | Param | Type | Description |
610 | --- | --- | --- |
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. |
613
614 <a name="SumoFactory.createRubberBand"></a>
615
616 ### SumoFactory.createRubberBand([engine], [config]) ⇒ <code>external:Serpentity.Entity</code>
617 Creates a rubber band entity and adds it to the engine.
618
619 **Kind**: static method of [<code>SumoFactory</code>](#SumoFactory)
620 **Returns**: <code>external:Serpentity.Entity</code> - the created entity
621
622 | Param | Type | Description |
623 | --- | --- | --- |
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. |
626