@Override
  public Scene onLoadScene() {
    mEngine.registerUpdateHandler(new FPSLogger());

    final Scene scene = new Scene(2);
    scene.setBackground(new ColorBackground(0, 0, 0));
    scene.setOnSceneTouchListener(this);

    mPhysicsWorld = new PhysicsWorld(new Vector2(0, SensorManager.GRAVITY_EARTH), false);

    final Shape ground = new Rectangle(0, CAMERA_HEIGHT - 2, CAMERA_WIDTH, 2);
    final Shape roof = new Rectangle(0, 0, CAMERA_WIDTH, 2);
    final Shape left = new Rectangle(0, 0, 2, CAMERA_HEIGHT);
    final Shape right = new Rectangle(CAMERA_WIDTH - 2, 0, 2, CAMERA_HEIGHT);

    final FixtureDef wallFixtureDef = PhysicsFactory.createFixtureDef(0, 0.5f, 0.5f);
    PhysicsFactory.createBoxBody(mPhysicsWorld, ground, BodyType.StaticBody, wallFixtureDef);
    PhysicsFactory.createBoxBody(mPhysicsWorld, roof, BodyType.StaticBody, wallFixtureDef);
    PhysicsFactory.createBoxBody(mPhysicsWorld, left, BodyType.StaticBody, wallFixtureDef);
    PhysicsFactory.createBoxBody(mPhysicsWorld, right, BodyType.StaticBody, wallFixtureDef);

    scene.getFirstChild().attachChild(ground);
    scene.getFirstChild().attachChild(roof);
    scene.getFirstChild().attachChild(left);
    scene.getFirstChild().attachChild(right);

    scene.registerUpdateHandler(mPhysicsWorld);

    scene.setOnAreaTouchListener(this);

    return scene;
  }
  @Override
  public Scene onLoadScene() {
    this.mEngine.registerUpdateHandler(new FPSLogger());

    final Scene scene = new Scene();
    scene.setBackground(new ColorBackground(0.09804f, 0.6274f, 0.8784f));

    /* We allow only the server to actively send around messages. */
    if (MultiplayerServerDiscoveryExample.this.mSocketServer != null) {
      scene.setOnSceneTouchListener(
          new IOnSceneTouchListener() {
            @Override
            public boolean onSceneTouchEvent(
                final Scene pScene, final TouchEvent pSceneTouchEvent) {
              if (pSceneTouchEvent.isActionDown()) {
                try {
                  final AddFaceServerMessage addFaceServerMessage =
                      (AddFaceServerMessage)
                          MultiplayerServerDiscoveryExample.this.mMessagePool.obtainMessage(
                              FLAG_MESSAGE_SERVER_ADD_FACE);
                  addFaceServerMessage.set(
                      MultiplayerServerDiscoveryExample.this.mFaceIDCounter++,
                      pSceneTouchEvent.getX(),
                      pSceneTouchEvent.getY());

                  MultiplayerServerDiscoveryExample.this.mSocketServer.sendBroadcastServerMessage(
                      addFaceServerMessage);

                  MultiplayerServerDiscoveryExample.this.mMessagePool.recycleMessage(
                      addFaceServerMessage);
                } catch (final IOException e) {
                  Debug.e(e);
                }
                return true;
              } else {
                return false;
              }
            }
          });

      scene.setOnAreaTouchListener(
          new IOnAreaTouchListener() {
            @Override
            public boolean onAreaTouched(
                final TouchEvent pSceneTouchEvent,
                final ITouchArea pTouchArea,
                final float pTouchAreaLocalX,
                final float pTouchAreaLocalY) {
              try {
                final Sprite face = (Sprite) pTouchArea;
                final Integer faceID = (Integer) face.getUserData();

                final MoveFaceServerMessage moveFaceServerMessage =
                    (MoveFaceServerMessage)
                        MultiplayerServerDiscoveryExample.this.mMessagePool.obtainMessage(
                            FLAG_MESSAGE_SERVER_MOVE_FACE);
                moveFaceServerMessage.set(faceID, pSceneTouchEvent.getX(), pSceneTouchEvent.getY());

                MultiplayerServerDiscoveryExample.this.mSocketServer.sendBroadcastServerMessage(
                    moveFaceServerMessage);

                MultiplayerServerDiscoveryExample.this.mMessagePool.recycleMessage(
                    moveFaceServerMessage);
              } catch (final IOException e) {
                Debug.e(e);
                return false;
              }
              return true;
            }
          });

      scene.setTouchAreaBindingEnabled(true);
    }

    return scene;
  }