+ const position = entity.getComponent(PositionComponent);
+
+ entity.addComponent(new AngleComponent(config.angle));
+ const angle = entity.getComponent(AngleComponent);
+
+ entity.addComponent(new ForceComponent(config.force));
+
+ config.maxVelocity = {
+ maxVelocity: 12
+ };
+ entity.addComponent(new MaxVelocityComponent(config.maxVelocity));
+
+ // CONTROLS & ABILITIES
+
+ entity.addComponent(new DashComponent(config.dash));
+
+ // RENDERING
+
+ const radius = 25;
+
+ const container = config.container || {
+ container: PixiFactory.createSumo({ radius })
+ };
+ container.container.position.x = position.x;
+ container.container.position.y = position.y;
+ container.container.rotation = angle.angle;
+ entity.addComponent(new PixiContainerComponent(container));
+
+ // PHYSICS
+
+ const frictionAir = 0.02;
+ const friction = 0.01;
+ const frictionStatic = 0.01;
+ const restitution = 1;
+ const density = 1.5;
+
+ const body = Bodies.circle(position.x / Config.meterSize, position.y / Config.meterSize, radius / Config.meterSize, {
+ label: 'Sumo body',
+ angle: angle.angle,
+ density,
+ frictionAir,
+ frictionStatic,
+ friction,
+ restitution
+ });
+ entity.addComponent(new BodyComponent({ body }));
+
+ if (engine) {
+ engine.addEntity(entity);
+ }
+
+ return entity;
+ },
+
+ /**
+ * Creates a rubber band entity and adds it to the engine.
+ *
+ * @function createRubberBand
+ * @memberof SumoFactory
+ * @param {external:Serpentity} [engine] the serpentity engine to attach
+ * to. If not sent, it will not be attached.
+ * @param {object} [config] 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.
+ * @return {external:Serpentity.Entity} the created entity
+ */
+ createRubberBand(engine, config = {}) {
+
+ const entity = new Entity();
+
+ if (!config.entityA || !config.entityB) {
+ throw new Error(internals.kNoEntityError);
+ }
+
+ if (!config.entityA.hasComponent(BodyComponent) || !config.entityB.hasComponent(BodyComponent)) {
+ throw new Error(internals.kEntityHasNoBodyError);
+ }
+
+ // RENDERING