Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

2.5 KB
Raw Blame
{
  "version": "1.0",
  "name": "Wave",
  "variables": [
    {
      "name": "elapsed",
      "type": "number",
      "default": 0
    }
  ],
  "nodes": [
    {
      "id": "update",
      "kind": "event.update",
      "x": 0,
      "y": 60
    },
    {
      "id": "getT",
      "kind": "var.get",
      "x": -182,
      "y": 440,
      "literals": {
        "name": "elapsed"
      }
    },
    {
      "id": "rate",
      "kind": "call",
      "ref": "math.multiply",
      "x": -182,
      "y": 630,
      "literals": {
        "b": 110
      }
    },
    {
      "id": "advance",
      "kind": "call",
      "ref": "math.add",
      "x": 34,
      "y": 250
    },
    {
      "id": "setT",
      "kind": "var.set",
      "x": 250,
      "y": 60,
      "literals": {
        "name": "elapsed"
      }
    },
    {
      "id": "wave",
      "kind": "call",
      "ref": "demo.pingPong",
      "x": 68,
      "y": 440,
      "literals": {
        "range": 140
      }
    },
    {
      "id": "lift",
      "kind": "call",
      "ref": "math.add",
      "x": 284,
      "y": 250,
      "literals": {
        "b": -70
      }
    },
    {
      "id": "write",
      "kind": "call",
      "ref": "property.set",
      "x": 500,
      "y": 60,
      "literals": {
        "path": "Transform.position.y"
      }
    },
    {
      "id": "getT_1",
      "kind": "var.get",
      "x": -148,
      "y": 630,
      "literals": {
        "name": "elapsed"
      }
    }
  ],
  "edges": [
    {
      "id": "e1",
      "from": "update",
      "fromPort": "then",
      "to": "setT",
      "toPort": ""
    },
    {
      "id": "e2",
      "from": "getT",
      "fromPort": "value",
      "to": "advance",
      "toPort": "a"
    },
    {
      "id": "e3",
      "from": "update",
      "fromPort": "dt",
      "to": "rate",
      "toPort": "a"
    },
    {
      "id": "e4",
      "from": "advance",
      "fromPort": "result",
      "to": "setT",
      "toPort": "value"
    },
    {
      "id": "getT_1.value->wave.t",
      "from": "getT_1",
      "fromPort": "value",
      "to": "wave",
      "toPort": "t"
    },
    {
      "id": "e6",
      "from": "wave",
      "fromPort": "value",
      "to": "lift",
      "toPort": "a"
    },
    {
      "id": "e7",
      "from": "lift",
      "fromPort": "result",
      "to": "write",
      "toPort": "value"
    },
    {
      "id": "e8",
      "from": "setT",
      "fromPort": "then",
      "to": "write",
      "toPort": ""
    },
    {
      "id": "e3b",
      "from": "rate",
      "fromPort": "result",
      "to": "advance",
      "toPort": "b"
    }
  ]
}