@almadar/std 16.188.0 → 16.190.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/behaviors/lolo/ui/core/.hand-authored.json +0 -4
  2. package/behaviors/lolo/ui/core/atoms/std-calendar.lolo +20 -8
  3. package/behaviors/lolo/ui/core/atoms/std-record-detail.lolo +428 -26
  4. package/behaviors/lolo/ui/core/atoms/std-related.lolo +5 -1
  5. package/behaviors/lolo/ui/core/atoms/std-version-history.lolo +1 -1
  6. package/behaviors/lolo/ui/core/molecules/ui-document-details.lolo +80 -0
  7. package/behaviors/lolo/ui/core/molecules/ui-document-panel.lolo +213 -0
  8. package/behaviors/lolo/ui/core/molecules/{ui-rich-block-editor.lolo → ui-rich-text-editor.lolo} +25 -25
  9. package/behaviors/lolo/ui/game/atoms/std-choice-gate.lolo +100 -0
  10. package/behaviors/lolo/ui/game/atoms/std-coef-pad.lolo +114 -0
  11. package/behaviors/lolo/ui/game/atoms/std-curve-fog.lolo +50 -0
  12. package/behaviors/lolo/ui/game/atoms/std-pad-lock.lolo +5 -1
  13. package/behaviors/lolo/ui/game/atoms/std-platformer-body.lolo +29 -3
  14. package/behaviors/lolo/ui/game/atoms/std-zone-card.lolo +95 -0
  15. package/behaviors/lolo/ui/game/organisms/std-platformer-board-2d.lolo +9 -0
  16. package/behaviors/registry/ui/core/atoms/std-calendar.orb +51 -27
  17. package/behaviors/registry/ui/core/atoms/std-record-detail.orb +2399 -180
  18. package/behaviors/registry/ui/core/atoms/std-related.orb +23 -1
  19. package/behaviors/registry/ui/core/atoms/std-version-history.orb +1 -1
  20. package/behaviors/registry/ui/core/molecules/ui-document-details.orb +342 -0
  21. package/behaviors/registry/ui/core/molecules/ui-document-panel.orb +655 -0
  22. package/behaviors/registry/ui/core/molecules/{ui-rich-block-editor.orb → ui-rich-text-editor.orb} +84 -97
  23. package/behaviors/registry/ui/game/atoms/std-choice-gate.orb +855 -0
  24. package/behaviors/registry/ui/game/atoms/std-coef-pad.orb +928 -0
  25. package/behaviors/registry/ui/game/atoms/std-curve-fog.orb +337 -0
  26. package/behaviors/registry/ui/game/atoms/std-pad-lock.orb +31 -1
  27. package/behaviors/registry/ui/game/atoms/std-platformer-body.orb +847 -401
  28. package/behaviors/registry/ui/game/atoms/std-zone-card.orb +642 -0
  29. package/behaviors/registry/ui/game/organisms/std-platformer-board-2d.orb +38 -6
  30. package/dist/behaviors/exports-reader.js +6491 -6163
  31. package/dist/behaviors/functions/index.d.ts +669 -300
  32. package/dist/behaviors/functions/index.js +6469 -6152
  33. package/dist/behaviors/index.d.ts +1 -1
  34. package/dist/behaviors/index.js +6492 -6164
  35. package/dist/behaviors/query.js +6491 -6163
  36. package/dist/behaviors-embeddings.hash.json +3 -3
  37. package/dist/behaviors-embeddings.json +367 -375
  38. package/dist/behaviors-registry.json +4104 -2597
  39. package/dist/index.d.ts +1 -1
  40. package/dist/index.js +6492 -6164
  41. package/dist/knob-embeddings.hash.json +3 -3
  42. package/dist/knob-embeddings.json +1 -1
  43. package/dist/registry/factory-signatures.json +1 -1
  44. package/package.json +4 -4
  45. package/behaviors/lolo/ui/core/atoms/std-rich-editor.lolo +0 -790
  46. package/behaviors/registry/ui/core/atoms/std-rich-editor.orb +0 -2225
@@ -1,5 +1,5 @@
1
1
  {
2
- "description": "Headless run/jump platformer-physics authority: the SOLE writer of body + fell + hazardId + goalId on side-view boards. Where std-motion-body owns free 2D drift (no collision), this atom owns the platformer contract: every 33ms physics tick it integrates gravity into the body's vertical velocity, steps position in per-second units, and collides the body rect against the config platforms with one-way semantics — a body moving in the gravity direction that overlaps a ground/platform tile lands on its anti-gravity face (vy zeroed, grounded set), while a body moving against gravity passes through, so jumping up through a platform and walking up a staircase both just work. The sign of gravity IS the vertical convention: positive pulls toward +y (screen boards, y down — sprite canvases), negative toward −y (math canvases, y up); jumps always fire against it. Intents: STEER sets horizontal velocity (dir −1/0/1 × moveSpeed, hold-to-run: keydown steers, keyup steers 0), JUMP kicks vertical velocity when grounded, PLACE teleports (spawns, hazard respawns), RESTART reseeds. Emits BODY_MOVED every tick for the render layer (boards that don't subscribe pay nothing), plus the sparse rule signals a board needs to score: BODY_JUMPED, BODY_LANDED (with impact speed), BODY_HAZARD (once per hazard entry, re-arms on exit), BODY_GOAL (same arming), BODY_FELL (once per fall past killY, re-armed by PLACE/RESTART). Drift regions: config.driftRegions lists axis-aligned rects each carrying a constant acceleration (ax, ay) applied with the same 0.033s dt whenever the body's center is inside (empty list = zero behavior change). Curve skating: when config.skate is on and the grounded body comes within skateSnap of the config.skateCurve surface, the body rides the curve — y snaps to the interpolated surface and tangential gravity (g·slope/(1+slope²)) accelerates vx, so the body slides downhill along the graph itself and launches ballistically off its ends; jumping kicks free. Sparse BODY_SKATE_START/BODY_SKATE_END signals fire on engage/disengage so boards can layer fx. Lives, score, and win/lose stay downstream — this atom simulates, it never judges. Renders nothing.",
2
+ "description": "Headless run/jump platformer-physics authority: the SOLE writer of body + fell + hazardId + goalId on side-view boards. Where std-motion-body owns free 2D drift (no collision), this atom owns the platformer contract: every 33ms physics tick it integrates gravity into the body's vertical velocity, steps position in per-second units, and collides the body rect against the config platforms with one-way semantics — a body moving in the gravity direction that overlaps a ground/platform tile lands on its anti-gravity face (vy zeroed, grounded set), while a body moving against gravity passes through, so jumping up through a platform and walking up a staircase both just work. The sign of gravity IS the vertical convention: positive pulls toward +y (screen boards, y down — sprite canvases), negative toward −y (math canvases, y up); jumps always fire against it. Intents: STEER sets horizontal velocity (dir −1/0/1 × moveSpeed, hold-to-run: keydown steers, keyup steers 0), JUMP kicks vertical velocity when grounded, PLACE teleports (spawns, hazard respawns), RESTART reseeds. Emits BODY_MOVED every tick for the render layer (boards that don't subscribe pay nothing), plus the sparse rule signals a board needs to score: BODY_JUMPED, BODY_LANDED (with impact speed), BODY_HAZARD (once per hazard entry, re-arms on exit), BODY_GOAL (same arming), BODY_FELL (once per fall past killY, re-armed by PLACE/RESTART). Drift regions: config.driftRegions lists axis-aligned rects each carrying a constant acceleration (ax, ay) applied with the same 0.033s dt whenever the body's center is inside (empty list = zero behavior change). Curve skating: when config.skate is on and the grounded body comes within skateSnap of the config.skateCurve surface, the body rides the curve — y snaps to the interpolated surface and tangential gravity (g·slope/(1+slope²)) accelerates vx, and the vertical velocity is the tangential projection (s = vx·cos θ, vy = s·sin θ — no discontinuous jumps at sample boundaries), so the body slides downhill along the graph itself and launches ballistically off its ends; jumping kicks free. Sparse BODY_SKATE_START/BODY_SKATE_END signals fire on engage/disengage so boards can layer fx. Lives, score, and win/lose stay downstream — this atom simulates, it never judges. Renders nothing.",
3
3
  "ledger": {
4
4
  "entries": {
5
5
  "ent_01M0H2SJBB5TG61D238AWJW3KC": {
@@ -127,6 +127,15 @@
127
127
  "parent": "trt_01M0H2SJBBCZW9WSQ3YBCVRKM2",
128
128
  "renames": []
129
129
  },
130
+ "evt_01M14AHPKY631TP2R26RP8T02W": {
131
+ "bakedName": "CURVE_MOD_ADD",
132
+ "curName": "CURVE_MOD_ADD",
133
+ "id": "evt_01M14AHPKY631TP2R26RP8T02W",
134
+ "kind": "event",
135
+ "owner": "workspace",
136
+ "parent": "trt_01M0H2SJBBCZW9WSQ3YBCVRKM2",
137
+ "renames": []
138
+ },
130
139
  "orb_01M0H2SJBB6B28C7NXBC5BWW23": {
131
140
  "bakedName": "PlatformerBodyOrbital",
132
141
  "curName": "PlatformerBodyOrbital",
@@ -230,6 +239,41 @@
230
239
  "name": "hazardId",
231
240
  "type": "string"
232
241
  },
242
+ {
243
+ "default": [],
244
+ "items": {
245
+ "properties": {
246
+ "a": {
247
+ "name": "a",
248
+ "required": true,
249
+ "type": "number"
250
+ },
251
+ "h": {
252
+ "name": "h",
253
+ "required": true,
254
+ "type": "number"
255
+ },
256
+ "k": {
257
+ "name": "k",
258
+ "required": true,
259
+ "type": "number"
260
+ },
261
+ "x0": {
262
+ "name": "x0",
263
+ "required": true,
264
+ "type": "number"
265
+ },
266
+ "x1": {
267
+ "name": "x1",
268
+ "required": true,
269
+ "type": "number"
270
+ }
271
+ },
272
+ "type": "object"
273
+ },
274
+ "name": "curveMods",
275
+ "type": "array"
276
+ },
233
277
  {
234
278
  "default": "",
235
279
  "name": "goalId",
@@ -265,6 +309,13 @@
265
309
  {
266
310
  "category": "lifecycle",
267
311
  "config": {
312
+ "curveModsEnabled": {
313
+ "default": false,
314
+ "description": "When true, entity.curveMods reshape the skate surface inside each mod's x-range: the road samples the base curve at (x − h) and applies a·y + k (slope scales by a) — coefficient pads lift/tilt the segment the player is riding. Default off: boards without coef pads pay nothing.",
315
+ "label": "Curve Mods Enabled",
316
+ "tier": "domain",
317
+ "type": "boolean"
318
+ },
268
319
  "driftRegions": {
269
320
  "default": [],
270
321
  "description": "Axis-aligned rects (x0..x1, y0..y1 in world units) each carrying a constant acceleration (ax, ay in units/s²) applied with the physics dt whenever the body's center is inside — winds, currents, gradient pushes. Empty list = zero behavior change.",
@@ -713,6 +764,7 @@
713
764
  "entityContract": {
714
765
  "provides": [
715
766
  "body",
767
+ "curveMods",
716
768
  "fell",
717
769
  "goalId",
718
770
  "hazardId",
@@ -776,6 +828,38 @@
776
828
  }
777
829
  ]
778
830
  },
831
+ {
832
+ "id": "evt_01M14AHPKY631TP2R26RP8T02W",
833
+ "key": "CURVE_MOD_ADD",
834
+ "name": "Curve Mod Add",
835
+ "payloadSchema": [
836
+ {
837
+ "name": "x0",
838
+ "required": true,
839
+ "type": "number"
840
+ },
841
+ {
842
+ "name": "x1",
843
+ "required": true,
844
+ "type": "number"
845
+ },
846
+ {
847
+ "name": "a",
848
+ "required": true,
849
+ "type": "number"
850
+ },
851
+ {
852
+ "name": "h",
853
+ "required": true,
854
+ "type": "number"
855
+ },
856
+ {
857
+ "name": "k",
858
+ "required": true,
859
+ "type": "number"
860
+ }
861
+ ]
862
+ },
779
863
  {
780
864
  "id": "evt_01M0H2SJBBSCEAJH5FZN8AAX45",
781
865
  "key": "RESTART",
@@ -1151,6 +1235,30 @@
1151
1235
  "from": "active",
1152
1236
  "to": "active"
1153
1237
  },
1238
+ {
1239
+ "effects": [
1240
+ [
1241
+ "set",
1242
+ "@entity.curveMods",
1243
+ [
1244
+ "array/append",
1245
+ "@entity.curveMods",
1246
+ {
1247
+ "a": "@payload.a",
1248
+ "h": "@payload.h",
1249
+ "k": "@payload.k",
1250
+ "x0": "@payload.x0",
1251
+ "x1": "@payload.x1"
1252
+ }
1253
+ ]
1254
+ ]
1255
+ ],
1256
+ "event": "CURVE_MOD_ADD",
1257
+ "eventId": "evt_01M14AHPKY631TP2R26RP8T02W",
1258
+ "from": "active",
1259
+ "guard": "@config.curveModsEnabled",
1260
+ "to": "active"
1261
+ },
1154
1262
  {
1155
1263
  "effects": [
1156
1264
  [
@@ -1158,6 +1266,11 @@
1158
1266
  "@entity.body",
1159
1267
  "@config.spawn"
1160
1268
  ],
1269
+ [
1270
+ "set",
1271
+ "@entity.curveMods",
1272
+ []
1273
+ ],
1161
1274
  [
1162
1275
  "set",
1163
1276
  "@entity.fell",
@@ -1784,57 +1897,69 @@
1784
1897
  "let",
1785
1898
  [
1786
1899
  [
1787
- "movingUp",
1900
+ "curveMod",
1788
1901
  [
1789
- "<",
1902
+ "if",
1790
1903
  [
1791
- "*",
1792
- "@vy1",
1793
- "@gdir"
1904
+ "and",
1905
+ "@config.curveModsEnabled",
1906
+ "@inRange"
1794
1907
  ],
1795
- -0.01
1796
- ]
1797
- ]
1798
- ],
1799
- [
1800
- "let",
1801
- [
1802
- [
1803
- "skateNow",
1804
1908
  [
1805
- "and",
1806
- "@inRange",
1909
+ "array/find",
1910
+ "@entity.curveMods",
1807
1911
  [
1808
- "and",
1912
+ "fn",
1913
+ "m",
1809
1914
  [
1810
- "<=",
1915
+ "and",
1811
1916
  [
1812
- "math/abs",
1917
+ ">=",
1918
+ "@cx",
1813
1919
  [
1814
- "-",
1815
- "@ny2",
1816
- "@curveY"
1920
+ "object/get",
1921
+ "@m",
1922
+ "x0"
1817
1923
  ]
1818
1924
  ],
1819
- "@config.skateSnap"
1820
- ],
1821
- [
1822
- "and",
1823
- [
1824
- "or",
1825
- "@landed",
1826
- "@entity.skating"
1827
- ],
1828
1925
  [
1829
- "or",
1830
- "@entity.body.grounded",
1926
+ "<=",
1927
+ "@cx",
1831
1928
  [
1832
- "not",
1833
- "@movingUp"
1929
+ "object/get",
1930
+ "@m",
1931
+ "x1"
1834
1932
  ]
1835
1933
  ]
1836
1934
  ]
1837
1935
  ]
1936
+ ],
1937
+ null
1938
+ ]
1939
+ ]
1940
+ ],
1941
+ [
1942
+ "let",
1943
+ [
1944
+ [
1945
+ "modX",
1946
+ [
1947
+ "if",
1948
+ [
1949
+ "==",
1950
+ "@curveMod",
1951
+ null
1952
+ ],
1953
+ "@cx",
1954
+ [
1955
+ "-",
1956
+ "@cx",
1957
+ [
1958
+ "object/get",
1959
+ "@curveMod",
1960
+ "h"
1961
+ ]
1962
+ ]
1838
1963
  ]
1839
1964
  ]
1840
1965
  ],
@@ -1842,45 +1967,41 @@
1842
1967
  "let",
1843
1968
  [
1844
1969
  [
1845
- "vx2",
1970
+ "modInRange",
1846
1971
  [
1847
- "if",
1848
- "@skateNow",
1972
+ "and",
1849
1973
  [
1850
- "math/clamp",
1974
+ "!=",
1975
+ "@curveMod",
1976
+ null
1977
+ ],
1978
+ [
1979
+ "and",
1851
1980
  [
1852
- "+",
1853
- "@entity.body.vx",
1981
+ ">=",
1982
+ "@modX",
1854
1983
  [
1855
- "*",
1984
+ "object/get",
1856
1985
  [
1857
- "/",
1858
- [
1859
- "*",
1860
- "@config.gravity",
1861
- "@slope"
1862
- ],
1863
- [
1864
- "+",
1865
- 1.0,
1866
- [
1867
- "*",
1868
- "@slope",
1869
- "@slope"
1870
- ]
1871
- ]
1986
+ "array/first",
1987
+ "@config.skateCurve"
1872
1988
  ],
1873
- 0.033
1989
+ "x"
1874
1990
  ]
1875
1991
  ],
1876
1992
  [
1877
- "-",
1878
- 0.0,
1879
- "@config.maxFallSpeed"
1880
- ],
1881
- "@config.maxFallSpeed"
1882
- ],
1883
- "@entity.body.vx"
1993
+ "<",
1994
+ "@modX",
1995
+ [
1996
+ "object/get",
1997
+ [
1998
+ "array/last",
1999
+ "@config.skateCurve"
2000
+ ],
2001
+ "x"
2002
+ ]
2003
+ ]
2004
+ ]
1884
2005
  ]
1885
2006
  ]
1886
2007
  ],
@@ -1888,33 +2009,31 @@
1888
2009
  "let",
1889
2010
  [
1890
2011
  [
1891
- "vx3",
2012
+ "modLeft",
1892
2013
  [
1893
2014
  "if",
2015
+ "@modInRange",
1894
2016
  [
1895
- "==",
1896
- "@drift",
1897
- null
1898
- ],
1899
- "@vx2",
1900
- [
1901
- "math/clamp",
2017
+ "array/last",
1902
2018
  [
1903
- "+",
1904
- "@vx2",
2019
+ "array/filter",
2020
+ "@config.skateCurve",
1905
2021
  [
1906
- "*",
1907
- "@dax",
1908
- 0.033
2022
+ "fn",
2023
+ "s",
2024
+ [
2025
+ "<=",
2026
+ [
2027
+ "object/get",
2028
+ "@s",
2029
+ "x"
2030
+ ],
2031
+ "@modX"
2032
+ ]
1909
2033
  ]
1910
- ],
1911
- [
1912
- "-",
1913
- 0.0,
1914
- "@config.maxFallSpeed"
1915
- ],
1916
- "@config.maxFallSpeed"
1917
- ]
2034
+ ]
2035
+ ],
2036
+ "@leftSamp"
1918
2037
  ]
1919
2038
  ]
1920
2039
  ],
@@ -1922,33 +2041,31 @@
1922
2041
  "let",
1923
2042
  [
1924
2043
  [
1925
- "fy",
1926
- [
1927
- "if",
1928
- "@skateNow",
1929
- "@curveY",
1930
- "@ny2"
1931
- ]
1932
- ],
1933
- [
1934
- "fvy",
2044
+ "modRight",
1935
2045
  [
1936
2046
  "if",
1937
- "@skateNow",
2047
+ "@modInRange",
1938
2048
  [
1939
- "*",
1940
- "@slope",
1941
- "@vx2"
2049
+ "array/first",
2050
+ [
2051
+ "array/filter",
2052
+ "@config.skateCurve",
2053
+ [
2054
+ "fn",
2055
+ "s",
2056
+ [
2057
+ ">",
2058
+ [
2059
+ "object/get",
2060
+ "@s",
2061
+ "x"
2062
+ ],
2063
+ "@modX"
2064
+ ]
2065
+ ]
2066
+ ]
1942
2067
  ],
1943
- "@vy2"
1944
- ]
1945
- ],
1946
- [
1947
- "fgrounded",
1948
- [
1949
- "or",
1950
- "@landed",
1951
- "@skateNow"
2068
+ "@rightSamp"
1952
2069
  ]
1953
2070
  ]
1954
2071
  ],
@@ -1956,36 +2073,40 @@
1956
2073
  "let",
1957
2074
  [
1958
2075
  [
1959
- "hazardHit",
2076
+ "modSlope",
1960
2077
  [
1961
- "array/find",
1962
- "@config.platforms",
2078
+ "if",
2079
+ "@modInRange",
1963
2080
  [
1964
- "fn",
1965
- "p",
2081
+ "/",
1966
2082
  [
1967
- "and",
2083
+ "-",
1968
2084
  [
1969
- "==",
1970
- [
1971
- "object/get",
1972
- "@p",
1973
- "type"
1974
- ],
1975
- "hazard"
2085
+ "object/get",
2086
+ "@modRight",
2087
+ "y"
1976
2088
  ],
1977
2089
  [
1978
- "geo/aabb-overlap",
1979
- "@rect",
1980
- {
1981
- "h": "@p.height",
1982
- "w": "@p.width",
1983
- "x": "@p.x",
1984
- "y": "@p.y"
1985
- }
2090
+ "object/get",
2091
+ "@modLeft",
2092
+ "y"
2093
+ ]
2094
+ ],
2095
+ [
2096
+ "-",
2097
+ [
2098
+ "object/get",
2099
+ "@modRight",
2100
+ "x"
2101
+ ],
2102
+ [
2103
+ "object/get",
2104
+ "@modLeft",
2105
+ "x"
1986
2106
  ]
1987
2107
  ]
1988
- ]
2108
+ ],
2109
+ "@slope"
1989
2110
  ]
1990
2111
  ]
1991
2112
  ],
@@ -1993,36 +2114,32 @@
1993
2114
  "let",
1994
2115
  [
1995
2116
  [
1996
- "goalHit",
2117
+ "modCurveY",
1997
2118
  [
1998
- "array/find",
1999
- "@config.platforms",
2119
+ "if",
2120
+ "@modInRange",
2000
2121
  [
2001
- "fn",
2002
- "p",
2122
+ "+",
2123
+ [
2124
+ "object/get",
2125
+ "@modLeft",
2126
+ "y"
2127
+ ],
2003
2128
  [
2004
- "and",
2129
+ "*",
2130
+ "@modSlope",
2005
2131
  [
2006
- "==",
2132
+ "-",
2133
+ "@modX",
2007
2134
  [
2008
2135
  "object/get",
2009
- "@p",
2010
- "type"
2011
- ],
2012
- "goal"
2013
- ],
2014
- [
2015
- "geo/aabb-overlap",
2016
- "@rect",
2017
- {
2018
- "h": "@p.height",
2019
- "w": "@p.width",
2020
- "x": "@p.x",
2021
- "y": "@p.y"
2022
- }
2136
+ "@modLeft",
2137
+ "x"
2138
+ ]
2023
2139
  ]
2024
2140
  ]
2025
- ]
2141
+ ],
2142
+ "@curveY"
2026
2143
  ]
2027
2144
  ]
2028
2145
  ],
@@ -2030,292 +2147,621 @@
2030
2147
  "let",
2031
2148
  [
2032
2149
  [
2033
- "fellNow",
2150
+ "slope",
2034
2151
  [
2035
2152
  "if",
2036
2153
  [
2037
- ">",
2038
- "@gdir",
2039
- 0.0
2040
- ],
2041
- [
2042
- ">",
2043
- "@fy",
2044
- "@config.killY"
2154
+ "==",
2155
+ "@curveMod",
2156
+ null
2045
2157
  ],
2158
+ "@slope",
2046
2159
  [
2047
- "<",
2048
- "@fy",
2049
- "@config.killY"
2160
+ "*",
2161
+ [
2162
+ "object/get",
2163
+ "@curveMod",
2164
+ "a"
2165
+ ],
2166
+ "@modSlope"
2050
2167
  ]
2051
2168
  ]
2052
2169
  ]
2053
2170
  ],
2054
2171
  [
2055
- "do",
2172
+ "let",
2056
2173
  [
2057
- "set",
2058
- "@entity.body",
2059
2174
  [
2060
- "object/merge",
2061
- "@entity.body",
2062
- {
2063
- "grounded": "@fgrounded",
2064
- "vx": [
2065
- "if",
2175
+ "curveY",
2176
+ [
2177
+ "if",
2178
+ [
2179
+ "==",
2180
+ "@curveMod",
2181
+ null
2182
+ ],
2183
+ "@curveY",
2184
+ [
2185
+ "+",
2066
2186
  [
2067
- "or",
2187
+ "*",
2068
2188
  [
2069
- "==",
2070
- "@nx",
2071
- "@config.xMin"
2189
+ "object/get",
2190
+ "@curveMod",
2191
+ "a"
2072
2192
  ],
2073
- [
2074
- "==",
2075
- "@nx",
2076
- "@config.xMax"
2077
- ]
2193
+ "@modCurveY"
2078
2194
  ],
2079
- 0.0,
2080
- "@vx3"
2081
- ],
2082
- "vy": "@fvy",
2083
- "x": "@nx",
2084
- "y": "@fy"
2085
- }
2086
- ]
2087
- ],
2088
- [
2089
- "set",
2090
- "@entity.skating",
2091
- "@skateNow"
2092
- ],
2093
- [
2094
- "if",
2095
- [
2096
- "and",
2097
- "@skateNow",
2098
- [
2099
- "==",
2100
- "@entity.skating",
2101
- false
2102
- ]
2103
- ],
2104
- [
2105
- "emit",
2106
- "BODY_SKATE_START",
2107
- {
2108
- "slope": "@slope",
2109
- "x": "@nx",
2110
- "y": "@fy"
2111
- }
2112
- ],
2113
- null
2114
- ],
2115
- [
2116
- "if",
2117
- [
2118
- "and",
2119
- [
2120
- "==",
2121
- "@skateNow",
2122
- false
2123
- ],
2124
- [
2125
- "==",
2126
- "@entity.skating",
2127
- true
2128
- ]
2129
- ],
2130
- [
2131
- "emit",
2132
- "BODY_SKATE_END",
2133
- {
2134
- "x": "@nx",
2135
- "y": "@fy"
2136
- }
2137
- ],
2138
- null
2139
- ],
2140
- [
2141
- "if",
2142
- [
2143
- "and",
2144
- "@landed",
2145
- [
2146
- "==",
2147
- "@entity.body.grounded",
2148
- false
2149
- ]
2150
- ],
2151
- [
2152
- "emit",
2153
- "BODY_LANDED",
2154
- {
2155
- "impact": [
2156
- "*",
2157
- "@vy1",
2158
- "@gdir"
2159
- ],
2160
- "x": "@nx",
2161
- "y": "@fy"
2162
- }
2163
- ],
2164
- null
2165
- ],
2166
- [
2167
- "if",
2168
- [
2169
- "!=",
2170
- "@hazardHit",
2171
- null
2172
- ],
2173
- [
2174
- "if",
2175
- [
2176
- "!=",
2177
- "@entity.hazardId",
2178
- [
2179
- "object/get",
2180
- "@hazardHit",
2181
- "id",
2182
- ""
2183
- ]
2184
- ],
2185
- [
2186
- "do",
2187
- [
2188
- "set",
2189
- "@entity.hazardId",
2190
2195
  [
2191
2196
  "object/get",
2192
- "@hazardHit",
2193
- "id",
2194
- ""
2197
+ "@curveMod",
2198
+ "k"
2195
2199
  ]
2196
- ],
2197
- [
2198
- "emit",
2199
- "BODY_HAZARD",
2200
- {
2201
- "id": [
2202
- "object/get",
2203
- "@hazardHit",
2204
- "id",
2205
- ""
2206
- ],
2207
- "x": "@nx",
2208
- "y": "@fy"
2209
- }
2210
2200
  ]
2211
- ],
2212
- null
2213
- ],
2214
- [
2215
- "set",
2216
- "@entity.hazardId",
2217
- ""
2201
+ ]
2218
2202
  ]
2219
2203
  ],
2220
2204
  [
2221
- "if",
2205
+ "let",
2222
2206
  [
2223
- "!=",
2224
- "@goalHit",
2225
- null
2207
+ [
2208
+ "movingUp",
2209
+ [
2210
+ "<",
2211
+ [
2212
+ "*",
2213
+ "@vy1",
2214
+ "@gdir"
2215
+ ],
2216
+ -0.01
2217
+ ]
2218
+ ]
2226
2219
  ],
2227
2220
  [
2228
- "if",
2221
+ "let",
2229
2222
  [
2230
- "!=",
2231
- "@entity.goalId",
2232
2223
  [
2233
- "object/get",
2234
- "@goalHit",
2235
- "id",
2236
- ""
2224
+ "skateNow",
2225
+ [
2226
+ "and",
2227
+ "@inRange",
2228
+ [
2229
+ "and",
2230
+ [
2231
+ "<=",
2232
+ [
2233
+ "math/abs",
2234
+ [
2235
+ "-",
2236
+ "@ny2",
2237
+ "@curveY"
2238
+ ]
2239
+ ],
2240
+ "@config.skateSnap"
2241
+ ],
2242
+ [
2243
+ "and",
2244
+ [
2245
+ "or",
2246
+ "@landed",
2247
+ "@entity.skating"
2248
+ ],
2249
+ [
2250
+ "or",
2251
+ "@entity.body.grounded",
2252
+ [
2253
+ "not",
2254
+ "@movingUp"
2255
+ ]
2256
+ ]
2257
+ ]
2258
+ ]
2259
+ ]
2237
2260
  ]
2238
2261
  ],
2239
2262
  [
2240
- "do",
2263
+ "let",
2241
2264
  [
2242
- "set",
2243
- "@entity.goalId",
2244
2265
  [
2245
- "object/get",
2246
- "@goalHit",
2247
- "id",
2248
- ""
2266
+ "vx2",
2267
+ [
2268
+ "if",
2269
+ "@skateNow",
2270
+ [
2271
+ "math/clamp",
2272
+ [
2273
+ "+",
2274
+ "@entity.body.vx",
2275
+ [
2276
+ "*",
2277
+ [
2278
+ "/",
2279
+ [
2280
+ "*",
2281
+ "@config.gravity",
2282
+ "@slope"
2283
+ ],
2284
+ [
2285
+ "+",
2286
+ 1.0,
2287
+ [
2288
+ "*",
2289
+ "@slope",
2290
+ "@slope"
2291
+ ]
2292
+ ]
2293
+ ],
2294
+ 0.033
2295
+ ]
2296
+ ],
2297
+ [
2298
+ "-",
2299
+ 0.0,
2300
+ "@config.maxFallSpeed"
2301
+ ],
2302
+ "@config.maxFallSpeed"
2303
+ ],
2304
+ "@entity.body.vx"
2305
+ ]
2249
2306
  ]
2250
2307
  ],
2251
2308
  [
2252
- "emit",
2253
- "BODY_GOAL",
2254
- {
2255
- "id": [
2256
- "object/get",
2257
- "@goalHit",
2258
- "id",
2259
- ""
2309
+ "let",
2310
+ [
2311
+ [
2312
+ "vx3",
2313
+ [
2314
+ "if",
2315
+ [
2316
+ "==",
2317
+ "@drift",
2318
+ null
2319
+ ],
2320
+ "@vx2",
2321
+ [
2322
+ "math/clamp",
2323
+ [
2324
+ "+",
2325
+ "@vx2",
2326
+ [
2327
+ "*",
2328
+ "@dax",
2329
+ 0.033
2330
+ ]
2331
+ ],
2332
+ [
2333
+ "-",
2334
+ 0.0,
2335
+ "@config.maxFallSpeed"
2336
+ ],
2337
+ "@config.maxFallSpeed"
2338
+ ]
2339
+ ]
2340
+ ]
2341
+ ],
2342
+ [
2343
+ "let",
2344
+ [
2345
+ [
2346
+ "fy",
2347
+ [
2348
+ "if",
2349
+ "@skateNow",
2350
+ "@curveY",
2351
+ "@ny2"
2352
+ ]
2353
+ ],
2354
+ [
2355
+ "fvy",
2356
+ [
2357
+ "if",
2358
+ "@skateNow",
2359
+ [
2360
+ "*",
2361
+ [
2362
+ "*",
2363
+ "@vx2",
2364
+ [
2365
+ "math/cos",
2366
+ [
2367
+ "math/atan",
2368
+ "@slope"
2369
+ ]
2370
+ ]
2371
+ ],
2372
+ [
2373
+ "math/sin",
2374
+ [
2375
+ "math/atan",
2376
+ "@slope"
2377
+ ]
2378
+ ]
2379
+ ],
2380
+ "@vy2"
2381
+ ]
2382
+ ],
2383
+ [
2384
+ "fgrounded",
2385
+ [
2386
+ "or",
2387
+ "@landed",
2388
+ "@skateNow"
2389
+ ]
2390
+ ]
2260
2391
  ],
2261
- "x": "@nx",
2262
- "y": "@fy"
2263
- }
2392
+ [
2393
+ "let",
2394
+ [
2395
+ [
2396
+ "hazardHit",
2397
+ [
2398
+ "array/find",
2399
+ "@config.platforms",
2400
+ [
2401
+ "fn",
2402
+ "p",
2403
+ [
2404
+ "and",
2405
+ [
2406
+ "==",
2407
+ [
2408
+ "object/get",
2409
+ "@p",
2410
+ "type"
2411
+ ],
2412
+ "hazard"
2413
+ ],
2414
+ [
2415
+ "geo/aabb-overlap",
2416
+ "@rect",
2417
+ {
2418
+ "h": "@p.height",
2419
+ "w": "@p.width",
2420
+ "x": "@p.x",
2421
+ "y": "@p.y"
2422
+ }
2423
+ ]
2424
+ ]
2425
+ ]
2426
+ ]
2427
+ ]
2428
+ ],
2429
+ [
2430
+ "let",
2431
+ [
2432
+ [
2433
+ "goalHit",
2434
+ [
2435
+ "array/find",
2436
+ "@config.platforms",
2437
+ [
2438
+ "fn",
2439
+ "p",
2440
+ [
2441
+ "and",
2442
+ [
2443
+ "==",
2444
+ [
2445
+ "object/get",
2446
+ "@p",
2447
+ "type"
2448
+ ],
2449
+ "goal"
2450
+ ],
2451
+ [
2452
+ "geo/aabb-overlap",
2453
+ "@rect",
2454
+ {
2455
+ "h": "@p.height",
2456
+ "w": "@p.width",
2457
+ "x": "@p.x",
2458
+ "y": "@p.y"
2459
+ }
2460
+ ]
2461
+ ]
2462
+ ]
2463
+ ]
2464
+ ]
2465
+ ],
2466
+ [
2467
+ "let",
2468
+ [
2469
+ [
2470
+ "fellNow",
2471
+ [
2472
+ "if",
2473
+ [
2474
+ ">",
2475
+ "@gdir",
2476
+ 0.0
2477
+ ],
2478
+ [
2479
+ ">",
2480
+ "@fy",
2481
+ "@config.killY"
2482
+ ],
2483
+ [
2484
+ "<",
2485
+ "@fy",
2486
+ "@config.killY"
2487
+ ]
2488
+ ]
2489
+ ]
2490
+ ],
2491
+ [
2492
+ "do",
2493
+ [
2494
+ "set",
2495
+ "@entity.body",
2496
+ [
2497
+ "object/merge",
2498
+ "@entity.body",
2499
+ {
2500
+ "grounded": "@fgrounded",
2501
+ "vx": [
2502
+ "if",
2503
+ [
2504
+ "or",
2505
+ [
2506
+ "==",
2507
+ "@nx",
2508
+ "@config.xMin"
2509
+ ],
2510
+ [
2511
+ "==",
2512
+ "@nx",
2513
+ "@config.xMax"
2514
+ ]
2515
+ ],
2516
+ 0.0,
2517
+ "@vx3"
2518
+ ],
2519
+ "vy": "@fvy",
2520
+ "x": "@nx",
2521
+ "y": "@fy"
2522
+ }
2523
+ ]
2524
+ ],
2525
+ [
2526
+ "set",
2527
+ "@entity.skating",
2528
+ "@skateNow"
2529
+ ],
2530
+ [
2531
+ "if",
2532
+ [
2533
+ "and",
2534
+ "@skateNow",
2535
+ [
2536
+ "==",
2537
+ "@entity.skating",
2538
+ false
2539
+ ]
2540
+ ],
2541
+ [
2542
+ "emit",
2543
+ "BODY_SKATE_START",
2544
+ {
2545
+ "slope": "@slope",
2546
+ "x": "@nx",
2547
+ "y": "@fy"
2548
+ }
2549
+ ],
2550
+ null
2551
+ ],
2552
+ [
2553
+ "if",
2554
+ [
2555
+ "and",
2556
+ [
2557
+ "==",
2558
+ "@skateNow",
2559
+ false
2560
+ ],
2561
+ [
2562
+ "==",
2563
+ "@entity.skating",
2564
+ true
2565
+ ]
2566
+ ],
2567
+ [
2568
+ "emit",
2569
+ "BODY_SKATE_END",
2570
+ {
2571
+ "x": "@nx",
2572
+ "y": "@fy"
2573
+ }
2574
+ ],
2575
+ null
2576
+ ],
2577
+ [
2578
+ "if",
2579
+ [
2580
+ "and",
2581
+ "@landed",
2582
+ [
2583
+ "==",
2584
+ "@entity.body.grounded",
2585
+ false
2586
+ ]
2587
+ ],
2588
+ [
2589
+ "emit",
2590
+ "BODY_LANDED",
2591
+ {
2592
+ "impact": [
2593
+ "*",
2594
+ "@vy1",
2595
+ "@gdir"
2596
+ ],
2597
+ "x": "@nx",
2598
+ "y": "@fy"
2599
+ }
2600
+ ],
2601
+ null
2602
+ ],
2603
+ [
2604
+ "if",
2605
+ [
2606
+ "!=",
2607
+ "@hazardHit",
2608
+ null
2609
+ ],
2610
+ [
2611
+ "if",
2612
+ [
2613
+ "!=",
2614
+ "@entity.hazardId",
2615
+ [
2616
+ "object/get",
2617
+ "@hazardHit",
2618
+ "id",
2619
+ ""
2620
+ ]
2621
+ ],
2622
+ [
2623
+ "do",
2624
+ [
2625
+ "set",
2626
+ "@entity.hazardId",
2627
+ [
2628
+ "object/get",
2629
+ "@hazardHit",
2630
+ "id",
2631
+ ""
2632
+ ]
2633
+ ],
2634
+ [
2635
+ "emit",
2636
+ "BODY_HAZARD",
2637
+ {
2638
+ "id": [
2639
+ "object/get",
2640
+ "@hazardHit",
2641
+ "id",
2642
+ ""
2643
+ ],
2644
+ "x": "@nx",
2645
+ "y": "@fy"
2646
+ }
2647
+ ]
2648
+ ],
2649
+ null
2650
+ ],
2651
+ [
2652
+ "set",
2653
+ "@entity.hazardId",
2654
+ ""
2655
+ ]
2656
+ ],
2657
+ [
2658
+ "if",
2659
+ [
2660
+ "!=",
2661
+ "@goalHit",
2662
+ null
2663
+ ],
2664
+ [
2665
+ "if",
2666
+ [
2667
+ "!=",
2668
+ "@entity.goalId",
2669
+ [
2670
+ "object/get",
2671
+ "@goalHit",
2672
+ "id",
2673
+ ""
2674
+ ]
2675
+ ],
2676
+ [
2677
+ "do",
2678
+ [
2679
+ "set",
2680
+ "@entity.goalId",
2681
+ [
2682
+ "object/get",
2683
+ "@goalHit",
2684
+ "id",
2685
+ ""
2686
+ ]
2687
+ ],
2688
+ [
2689
+ "emit",
2690
+ "BODY_GOAL",
2691
+ {
2692
+ "id": [
2693
+ "object/get",
2694
+ "@goalHit",
2695
+ "id",
2696
+ ""
2697
+ ],
2698
+ "x": "@nx",
2699
+ "y": "@fy"
2700
+ }
2701
+ ]
2702
+ ],
2703
+ null
2704
+ ],
2705
+ [
2706
+ "set",
2707
+ "@entity.goalId",
2708
+ ""
2709
+ ]
2710
+ ],
2711
+ [
2712
+ "if",
2713
+ [
2714
+ "and",
2715
+ "@fellNow",
2716
+ [
2717
+ "==",
2718
+ "@entity.fell",
2719
+ false
2720
+ ]
2721
+ ],
2722
+ [
2723
+ "do",
2724
+ [
2725
+ "set",
2726
+ "@entity.fell",
2727
+ true
2728
+ ],
2729
+ [
2730
+ "emit",
2731
+ "BODY_FELL",
2732
+ {
2733
+ "x": "@nx",
2734
+ "y": "@fy"
2735
+ }
2736
+ ]
2737
+ ],
2738
+ null
2739
+ ],
2740
+ [
2741
+ "emit",
2742
+ "BODY_MOVED",
2743
+ {
2744
+ "grounded": "@fgrounded",
2745
+ "skating": "@skateNow",
2746
+ "speed": [
2747
+ "math/hypot",
2748
+ "@entity.body.vx",
2749
+ "@fvy"
2750
+ ],
2751
+ "vx": "@entity.body.vx",
2752
+ "vy": "@fvy",
2753
+ "x": "@nx",
2754
+ "y": "@fy"
2755
+ }
2756
+ ]
2757
+ ]
2758
+ ]
2759
+ ]
2760
+ ]
2761
+ ]
2264
2762
  ]
2265
- ],
2266
- null
2267
- ],
2268
- [
2269
- "set",
2270
- "@entity.goalId",
2271
- ""
2272
- ]
2273
- ],
2274
- [
2275
- "if",
2276
- [
2277
- "and",
2278
- "@fellNow",
2279
- [
2280
- "==",
2281
- "@entity.fell",
2282
- false
2283
2763
  ]
2284
- ],
2285
- [
2286
- "do",
2287
- [
2288
- "set",
2289
- "@entity.fell",
2290
- true
2291
- ],
2292
- [
2293
- "emit",
2294
- "BODY_FELL",
2295
- {
2296
- "x": "@nx",
2297
- "y": "@fy"
2298
- }
2299
- ]
2300
- ],
2301
- null
2302
- ],
2303
- [
2304
- "emit",
2305
- "BODY_MOVED",
2306
- {
2307
- "grounded": "@fgrounded",
2308
- "skating": "@skateNow",
2309
- "speed": [
2310
- "math/hypot",
2311
- "@entity.body.vx",
2312
- "@fvy"
2313
- ],
2314
- "vx": "@entity.body.vx",
2315
- "vy": "@fvy",
2316
- "x": "@nx",
2317
- "y": "@fy"
2318
- }
2764
+ ]
2319
2765
  ]
2320
2766
  ]
2321
2767
  ]