+
+ const sumoB = SumoFactory.createPlayer2Sumo(null, {
+ position: {
+ x: this.horizontalResolution / 2 + 100,
+ y: this.verticalResolution / 2
+ }
+ });
+
+ const harness = SumoFactory.createHarness(null, {
+ position: {
+ x: this.horizontalResolution / 2,
+ y: this.verticalResolution / 2
+ }
+ });
+
+ SumoFactory.createRubberBand(this._engine, {
+ entityA: sumoA,
+ entityB: harness
+ });
+
+ SumoFactory.createRubberBand(this._engine, {
+ entityA: sumoB,
+ entityB: harness
+ });
+
+ // Walls
+
+ SumoFactory.createInvisibleBlock(this._engine, {
+ width: this.horizontalResolution * 2,
+ height: this.verticalResolution * 0.1,
+ position: {
+ x: this.horizontalResolution / 2,
+ y: -this.verticalResolution * 0.1
+ }
+ });
+
+ SumoFactory.createInvisibleBlock(this._engine, {
+ width: this.horizontalResolution * 2,
+ height: this.verticalResolution * 0.1,
+ position: {
+ x: this.horizontalResolution / 2,
+ y: this.verticalResolution + this.verticalResolution * 0.1
+ }
+ });
+
+ // Points Detector
+
+ SumoFactory.createPointsCollider(this._engine, {
+ collisionTarget: sumoA,
+ pointsTarget: 'red',
+ height: this.verticalResolution,
+ width: this.horizontalResolution,
+ position: {
+ x: this.horizontalResolution + this.horizontalResolution / 2,
+ y: this.verticalResolution / 2
+ }
+ });
+
+ SumoFactory.createPointsCollider(this._engine, {
+ collisionTarget: sumoB,
+ pointsTarget: 'blue',
+ height: this.verticalResolution,
+ width: this.horizontalResolution,
+ position: {
+ x: -this.horizontalResolution / 2,
+ y: this.verticalResolution / 2
+ }
+ });
+
+ // The game state
+ SumoFactory.createGameState(this._engine);
+
+ // To keep the coupling behind, we'll manually add the sumos later
+
+ this._engine.addEntity(sumoA);
+ this._engine.addEntity(sumoB);
+ this._engine.addEntity(harness);