{
  "_ui": {
    "version": 1,
    "state": {
      "called": false,
      "scared": false
    }
  },
  "type": "Scene",
  "anchor": "floor",
  "bounds": {
    "radius": 2.5
  },
  "actors": [
    {
      "id": "fox",
      "name": "Rusty",
      "transform": {
        "position": [
          0.8,
          0,
          0.4
        ],
        "rotation": [
          0,
          180,
          0
        ]
      },
      "body": {
        "$ref": "bodies/fox.json",
        "sounds": {
          "yip": "https://qrx.apphaus.us/sounds/yip.wav"
        }
      },
      "mobility": {
        "mode": "ground",
        "speed": 0.6,
        "turnRate": 240,
        "idle": "idle",
        "move": "walk"
      },
      "behaviors": [
        {
          "type": "flee",
          "from": "user",
          "distance": 1.2,
          "priority": 10,
          "when": "$scared"
        },
        {
          "type": "approach",
          "target": "user",
          "stopAt": 0.6,
          "priority": 5,
          "when": "$called"
        },
        {
          "type": "lookAt",
          "target": "user",
          "priority": 1
        },
        {
          "type": "wander",
          "radius": 2.0,
          "pause": [
            1,
            4
          ]
        }
      ],
      "mind": {
        "$ref": "minds/fox.json"
      },
      "on": {
        "tap": [
          {
            "set": {
              "called": true
            }
          },
          {
            "sound": "yip"
          }
        ],
        "arrived": [
          {
            "set": {
              "called": false
            }
          },
          {
            "play": "happy"
          }
        ],
        "animationEnd": {
          "emit": "settle"
        },
        "settle": {
          "play": "idle"
        }
      }
    },
    {
      "id": "duck",
      "name": "Pip",
      "transform": {
        "position": [
          -0.5,
          0.8,
          0.2
        ]
      },
      "body": {
        "$ref": "bodies/duck.json"
      },
      "mobility": {
        "mode": "air",
        "speed": 0.9,
        "turnRate": 360,
        "altitude": [
          0.4,
          1.4
        ]
      },
      "behaviors": [
        {
          "type": "perchOn",
          "target": "fox",
          "socket": "back",
          "priority": 5,
          "when": "${!state.called}"
        },
        {
          "type": "wander",
          "radius": 1.5,
          "pause": [
            0.5,
            2
          ]
        }
      ],
      "on": {
        "tap": {
          "set": {
            "called": true
          }
        }
      }
    }
  ]
}
