# meta
```json
{
  "id": "inside-window-bouncer",
  "name": "Inside window bouncer",
  "tickRate": 30,
  "permissions": ["overlay.entities", "desktop.windows"]
}
```

# select
```json
{
  "entity": { "visible": true },
  "targetWindow": { "window": { "foreground": true } }
}
```

# state
```json
{
  "entity": {
    "speed": 110,
    "direction": { "choice": [-1, 1] }
  }
}
```

# tick
```json
[
  {
    "forEach": "entity",
    "do": [
      { "moveX": "state.direction * state.speed * dt" },
      { "bounceInWindow": { "window": "targetWindow", "area": "client", "flip": "state.direction", "clip": true } },
      { "containInWindow": { "window": "targetWindow", "area": "client", "clip": true } },
      { "animation": { "direction": "state.direction", "left": "running-left", "right": "running-right" } }
    ]
  }
]
```
