{
  "id": "runner",
  "calls": [
    {
      "name": "aether_actors_add",
      "arguments": {
        "actors": [
          {
            "id": "player",
            "name": "Player",
            "kind": "cube",
            "position": [
              0,
              1,
              0
            ],
            "color": "#e5bb53",
            "group": "Example",
            "scale": [
              1,
              1,
              1
            ]
          },
          {
            "id": "ground",
            "name": "Ground",
            "kind": "cube",
            "position": [
              0,
              -0.5,
              0
            ],
            "color": "#243c50",
            "group": "Example",
            "scale": [
              1,
              1,
              1
            ]
          },
          {
            "id": "road",
            "name": "Track",
            "kind": "cube",
            "position": [
              0,
              -0.2,
              -35
            ],
            "color": "#3b465a",
            "group": "Example",
            "scale": [
              1,
              1,
              1
            ]
          },
          {
            "id": "obstacle0",
            "name": "Obstacle 1",
            "kind": "cube",
            "position": [
              -2,
              1,
              -12
            ],
            "color": "#cb7167",
            "group": "Example",
            "scale": [
              1,
              1,
              1
            ]
          },
          {
            "id": "obstacle1",
            "name": "Obstacle 2",
            "kind": "cube",
            "position": [
              2,
              1,
              -22
            ],
            "color": "#cb7167",
            "group": "Example",
            "scale": [
              1,
              1,
              1
            ]
          },
          {
            "id": "obstacle2",
            "name": "Obstacle 3",
            "kind": "cube",
            "position": [
              0,
              1,
              -32
            ],
            "color": "#cb7167",
            "group": "Example",
            "scale": [
              1,
              1,
              1
            ]
          },
          {
            "id": "obstacle3",
            "name": "Obstacle 4",
            "kind": "cube",
            "position": [
              -2,
              1,
              -42
            ],
            "color": "#cb7167",
            "group": "Example",
            "scale": [
              1,
              1,
              1
            ]
          },
          {
            "id": "obstacle4",
            "name": "Obstacle 5",
            "kind": "cube",
            "position": [
              2,
              1,
              -52
            ],
            "color": "#cb7167",
            "group": "Example",
            "scale": [
              1,
              1,
              1
            ]
          }
        ]
      }
    },
    {
      "name": "aether_model_compose",
      "arguments": {
        "actor_id": "player",
        "recipe": {
          "shapes": [
            {
              "kind": "box",
              "min": [
                -0.5,
                -0.5,
                -0.5
              ],
              "max": [
                0.5,
                0.5,
                0.5
              ]
            }
          ]
        }
      }
    },
    {
      "name": "aether_model_compose",
      "arguments": {
        "actor_id": "ground",
        "recipe": {
          "shapes": [
            {
              "kind": "box",
              "min": [
                -12,
                -0.5,
                -8
              ],
              "max": [
                12,
                0.5,
                8
              ]
            }
          ]
        }
      }
    },
    {
      "name": "aether_model_compose",
      "arguments": {
        "actor_id": "road",
        "recipe": {
          "shapes": [
            {
              "kind": "box",
              "min": [
                -4.5,
                -0.15,
                -50
              ],
              "max": [
                4.5,
                0.15,
                50
              ]
            }
          ]
        }
      }
    },
    {
      "name": "aether_model_compose",
      "arguments": {
        "actor_id": "obstacle0",
        "recipe": {
          "shapes": [
            {
              "kind": "box",
              "min": [
                -0.7,
                -1,
                -0.7
              ],
              "max": [
                0.7,
                1,
                0.7
              ]
            }
          ]
        }
      }
    },
    {
      "name": "aether_model_compose",
      "arguments": {
        "actor_id": "obstacle1",
        "recipe": {
          "shapes": [
            {
              "kind": "box",
              "min": [
                -0.7,
                -1,
                -0.7
              ],
              "max": [
                0.7,
                1,
                0.7
              ]
            }
          ]
        }
      }
    },
    {
      "name": "aether_model_compose",
      "arguments": {
        "actor_id": "obstacle2",
        "recipe": {
          "shapes": [
            {
              "kind": "box",
              "min": [
                -0.7,
                -1,
                -0.7
              ],
              "max": [
                0.7,
                1,
                0.7
              ]
            }
          ]
        }
      }
    },
    {
      "name": "aether_model_compose",
      "arguments": {
        "actor_id": "obstacle3",
        "recipe": {
          "shapes": [
            {
              "kind": "box",
              "min": [
                -0.7,
                -1,
                -0.7
              ],
              "max": [
                0.7,
                1,
                0.7
              ]
            }
          ]
        }
      }
    },
    {
      "name": "aether_model_compose",
      "arguments": {
        "actor_id": "obstacle4",
        "recipe": {
          "shapes": [
            {
              "kind": "box",
              "min": [
                -0.7,
                -1,
                -0.7
              ],
              "max": [
                0.7,
                1,
                0.7
              ]
            }
          ]
        }
      }
    },
    {
      "name": "aether_gameplay_apply",
      "arguments": {
        "program": {
          "version": 1,
          "scriptModules": [],
          "components": [],
          "animationControllers": [],
          "widgets": [],
          "randomSeed": 1,
          "title": "Lane runner",
          "description": "Steer with A/D and avoid the red blocks. Reach the end of the track. Swept collision queries prevent passing through an obstacle between updates.",
          "variables": {
            "x": 0,
            "z": 0,
            "oldx": 0,
            "oldz": 0,
            "speed": 8,
            "crashed": 0,
            "won": 0
          },
          "rules": [
            {
              "name": "Move",
              "event": "tick",
              "when": 1,
              "set": [
                {
                  "variable": "oldx",
                  "value": "x"
                },
                {
                  "variable": "oldz",
                  "value": "z"
                },
                {
                  "variable": "x",
                  "value": "clamp(x+(input.KeyD-input.KeyA)*8*dt,-3.5,3.5)"
                },
                {
                  "variable": "z",
                  "value": "z-speed*dt"
                }
              ],
              "actions": []
            },
            {
              "name": "Collision",
              "event": "tick",
              "when": "hitBoxes(oldx,1,oldz,x,1,z,0.5)",
              "set": [
                {
                  "variable": "crashed",
                  "value": 1
                }
              ],
              "actions": []
            },
            {
              "name": "Finish",
              "event": "tick",
              "when": "z<-60",
              "set": [
                {
                  "variable": "won",
                  "value": 1
                }
              ],
              "actions": []
            }
          ],
          "prefabs": [],
          "sounds": [],
          "sensors": [],
          "bindings": [
            {
              "actorId": "player",
              "position": [
                "x",
                1,
                "z"
              ],
              "rotation": [
                0,
                0,
                0
              ],
              "scale": [
                1,
                1,
                1
              ],
              "visible": 1
            }
          ],
          "camera": {
            "actorId": "player",
            "mode": "fixed",
            "offset": [
              0,
              7,
              12
            ],
            "lookAt": [
              0,
              0,
              -8
            ],
            "alternateOffset": [
              0,
              1,
              0
            ],
            "alternateLookAt": [
              0,
              1,
              -100
            ],
            "switchKey": "",
            "smoothing": 5,
            "far": 10000,
            "pointerLock": false
          },
          "menu": [
            {
              "label": "Difficulty",
              "options": [
                {
                  "label": "Normal",
                  "description": "",
                  "set": {
                    "speed": 8
                  }
                },
                {
                  "label": "Fast",
                  "description": "",
                  "set": {
                    "speed": 12
                  }
                }
              ]
            }
          ],
          "hud": [
            {
              "label": "Distance",
              "value": "-z",
              "decimals": 0,
              "suffix": "m"
            },
            {
              "label": "Time",
              "value": "time",
              "decimals": 1,
              "suffix": ""
            }
          ],
          "messages": [
            {
              "when": "crashed",
              "text": "Collision. Restart to try another route."
            },
            {
              "when": "won",
              "text": "Track complete!"
            }
          ],
          "points": [],
          "boxes": [
            [
              -2.7,
              0,
              -12.7,
              -1.3,
              2,
              -11.3
            ],
            [
              1.3,
              0,
              -22.7,
              2.7,
              2,
              -21.3
            ],
            [
              -0.7,
              0,
              -32.7,
              0.7,
              2,
              -31.3
            ],
            [
              -2.7,
              0,
              -42.7,
              -1.3,
              2,
              -41.3
            ],
            [
              1.3,
              0,
              -52.7,
              2.7,
              2,
              -51.3
            ]
          ],
          "controls": [
            {
              "label": "Left",
              "code": "KeyA"
            },
            {
              "label": "Right",
              "code": "KeyD"
            }
          ],
          "pauseWhen": "crashed || won"
        }
      }
    }
  ]
}