{
 "pack": 1,
 "id": "c4c:beh:stand_up_bird",
 "type": "behaviour",
 "version": "1.0.0",
 "name": "Stand up (bird)",
 "description": "A bird stands up from sitting, straightening its legs and giving its wings a shake.",
 "author": {
  "id": "c4c",
  "name": "Crafts4Class"
 },
 "license": "c4c-free",
 "remixable": true,
 "derived_from": [],
 "preview": {
  "moves": [
   "stand_up_bird"
  ],
  "seconds": 3
 },
 "content_hash": "sha256:3d1544d7f9ff5054ad0d090c998d5c536d77ff3417d2de5efd3837f458220d62",
 "content": {
  "v": 1,
  "kind": "behaviour",
  "name": "stand_up_bird",
  "params": {
   "h": 540,
   "leg": 0.05,
   "on": 0
  },
  "scripts": [
   {
    "hat": {
     "on": "start"
    },
    "body": [
     {
      "op": "view",
      "to": "side"
     },
     {
      "op": "set",
      "to": {
       "part:leg:-1": 45,
       "part:leg:1": 45,
       "part:foot:-1": -45,
       "part:foot:1": -45,
       "dx": "=-h*leg*sin((45)*pi/180)",
       "dy": "=h*leg*(1 - cos((45)*pi/180))",
       "part:arm:-1": 0,
       "part:arm:1": 0,
       "part:head": -4,
       "part:tail": -14
      }
     },
     {
      "op": "together",
      "branches": [
       [
        {
         "op": "ramp",
         "to": {
          "part:leg:-1": 0,
          "part:leg:1": 0,
          "part:foot:-1": 0,
          "part:foot:1": 0,
          "part:head": 0,
          "part:tail": 0
         },
         "over": 0.6,
         "ease": "smooth"
        }
       ],
       [
        {
         "op": "set",
         "to": {
          "dx": 0,
          "dy": 0
         }
        },
        {
         "op": "for",
         "s": 0.6,
         "body": [
          {
           "op": "drive",
           "ch": "dy",
           "value": "=h*leg*(1 - cos(((45 + -45*smoothstep(min(local/0.6, 1))))*pi/180))"
          },
          {
           "op": "drive",
           "ch": "dx",
           "value": "=-h*leg*sin(((45 + -45*smoothstep(min(local/0.6, 1))))*pi/180)"
          }
         ]
        }
       ]
      ]
     },
     {
      "op": "set",
      "to": {
       "dx": "=-h*leg*sin((0)*pi/180)",
       "dy": "=h*leg*(1 - cos((0)*pi/180))"
      }
     },
     {
      "op": "for",
      "s": 0.3,
      "body": [
       {
        "op": "wave",
        "ch": "part:arm:-1",
        "shape": "sin",
        "every": 0.15,
        "amp": -14
       },
       {
        "op": "wave",
        "ch": "part:arm:1",
        "shape": "sin",
        "every": 0.15,
        "amp": 14
       }
      ]
     }
    ]
   }
  ]
 }
}
