pxt-common-packages 9.5.3 → 9.5.6

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 (40) hide show
  1. package/built/common-sim.d.ts +5 -0
  2. package/built/common-sim.js +52 -22
  3. package/libs/controller/built/debug/binary.js +39 -39
  4. package/libs/controller---none/built/debug/binary.js +39 -39
  5. package/libs/game/built/debug/binary.js +39 -39
  6. package/libs/game/docs/reference/sprites/sprite/follow.md +66 -0
  7. package/libs/game/docs/reference/sprites/sprite/set-bounce-on-wall.md +2 -2
  8. package/libs/game/docs/reference/sprites/sprite-kind.md +70 -0
  9. package/libs/game/docs/reference/tiles/get-neighboring-location.md +123 -0
  10. package/libs/game/docs/reference/tiles/get-tile-location.md +71 -30
  11. package/libs/game/docs/reference/tiles/get-tiles-by-type.md +66 -32
  12. package/libs/game/docs/reference/tiles/location.md +246 -0
  13. package/libs/game/docs/reference/tiles/place-on-random-tile.md +54 -21
  14. package/libs/game/docs/reference/tiles/place-on-tile.md +88 -0
  15. package/libs/game/docs/reference/tiles/set-current-tilemap.md +90 -0
  16. package/libs/game/docs/reference/tiles/set-tile-at.md +47 -30
  17. package/libs/game/docs/reference/tiles/set-tilemap.md +90 -0
  18. package/libs/game/docs/reference/tiles/set-wall-at.md +67 -68
  19. package/libs/game/docs/reference/tiles/tile-at-location-equals.md +97 -0
  20. package/libs/game/docs/reference/tiles/tile-at-location-is-wall.md +98 -0
  21. package/libs/game/docs/reference/tiles/tilemap.md +145 -0
  22. package/libs/game/sprite.ts +2 -1
  23. package/libs/game/spritekind.ts +1 -0
  24. package/libs/game/tilemap.ts +12 -11
  25. package/libs/matrix-keypad/built/debug/binary.js +8 -8
  26. package/libs/net-game/built/debug/binary.js +39 -39
  27. package/libs/palette/built/debug/binary.js +39 -39
  28. package/libs/radio/_locales/radio-jsdoc-strings.json +2 -0
  29. package/libs/radio/_locales/radio-strings.json +4 -1
  30. package/libs/radio/radio.cpp +56 -3
  31. package/libs/radio/radio.ts +13 -2
  32. package/libs/radio/shims.d.ts +16 -1
  33. package/libs/radio/sim/radio.ts +18 -5
  34. package/libs/radio/sim/state.ts +37 -17
  35. package/libs/radio-broadcast/_locales/radio-broadcast-strings.json +2 -1
  36. package/libs/radio-broadcast/built/debug/binary.js +8 -8
  37. package/libs/radio-broadcast/radio-broadcast.ts +2 -0
  38. package/libs/sprite-scaling/built/debug/binary.js +6782 -6782
  39. package/libs/storyboard/built/debug/binary.js +39 -39
  40. package/package.json +2 -2
@@ -4842,7 +4842,7 @@ switch (step) {
4842
4842
  return leaveAccessor(s, r0)
4843
4843
  default: oops()
4844
4844
  } } }
4845
- Sprite_height__P138949.info = {"start":11642,"length":61,"line":413,"column":4,"endLine":415,"endColumn":5,"fileName":"sprite.ts","functionName":"height","argumentNames":["this"]}
4845
+ Sprite_height__P138949.info = {"start":11668,"length":61,"line":413,"column":4,"endLine":415,"endColumn":5,"fileName":"sprite.ts","functionName":"height","argumentNames":["this"]}
4846
4846
  Sprite_height__P138949.isGetter = true;
4847
4847
 
4848
4848
  function Sprite_height__P138949_mk(s) {
@@ -5056,7 +5056,7 @@ switch (step) {
5056
5056
  return leave(s, r0)
5057
5057
  default: oops()
5058
5058
  } } }
5059
- Sprite_top__P138955.info = {"start":12788,"length":256,"line":454,"column":4,"endLine":464,"endColumn":5,"fileName":"sprite.ts","functionName":"top","argumentNames":["this","value"]}
5059
+ Sprite_top__P138955.info = {"start":12814,"length":256,"line":454,"column":4,"endLine":464,"endColumn":5,"fileName":"sprite.ts","functionName":"top","argumentNames":["this","value"]}
5060
5060
 
5061
5061
  function Sprite_top__P138955_mk(s) {
5062
5062
  checkStack(s.depth);
@@ -5172,7 +5172,7 @@ switch (step) {
5172
5172
  return leaveAccessor(s, r0)
5173
5173
  default: oops()
5174
5174
  } } }
5175
- Sprite_top__P138954.info = {"start":12645,"length":53,"line":449,"column":4,"endLine":451,"endColumn":5,"fileName":"sprite.ts","functionName":"top","argumentNames":["this"]}
5175
+ Sprite_top__P138954.info = {"start":12671,"length":53,"line":449,"column":4,"endLine":451,"endColumn":5,"fileName":"sprite.ts","functionName":"top","argumentNames":["this"]}
5176
5176
  Sprite_top__P138954.isGetter = true;
5177
5177
 
5178
5178
  function Sprite_top__P138954_mk(s) {
@@ -16522,7 +16522,7 @@ switch (step) {
16522
16522
  return leave(s, r0)
16523
16523
  default: oops()
16524
16524
  } } }
16525
- Sprite_destroy__P138979.info = {"start":30100,"length":293,"line":963,"column":4,"endLine":972,"endColumn":5,"fileName":"sprite.ts","functionName":"destroy","argumentNames":["this","effect","duration"]}
16525
+ Sprite_destroy__P138979.info = {"start":30126,"length":293,"line":963,"column":4,"endLine":972,"endColumn":5,"fileName":"sprite.ts","functionName":"destroy","argumentNames":["this","effect","duration"]}
16526
16526
 
16527
16527
  function Sprite_destroy__P138979_mk(s) {
16528
16528
  checkStack(s.depth);
@@ -16657,7 +16657,7 @@ switch (step) {
16657
16657
  return leave(s, r0)
16658
16658
  default: oops()
16659
16659
  } } }
16660
- Sprite__destroyCore__P138980.info = {"start":30399,"length":522,"line":974,"column":4,"endLine":986,"endColumn":5,"fileName":"sprite.ts","functionName":"_destroyCore","argumentNames":["this"]}
16660
+ Sprite__destroyCore__P138980.info = {"start":30425,"length":522,"line":974,"column":4,"endLine":986,"endColumn":5,"fileName":"sprite.ts","functionName":"_destroyCore","argumentNames":["this"]}
16661
16661
 
16662
16662
  function Sprite__destroyCore__P138980_mk(s) {
16663
16663
  checkStack(s.depth);
@@ -16702,7 +16702,7 @@ switch (step) {
16702
16702
  return leave(s, r0)
16703
16703
  default: oops()
16704
16704
  } } }
16705
- forEach_inline__P144721.info = {"start":30844,"length":26,"line":984,"column":20,"endLine":984,"endColumn":46,"fileName":"sprite.ts","functionName":"inline","argumentNames":["h"]}
16705
+ forEach_inline__P144721.info = {"start":30870,"length":26,"line":984,"column":20,"endLine":984,"endColumn":46,"fileName":"sprite.ts","functionName":"inline","argumentNames":["h"]}
16706
16706
 
16707
16707
  function forEach_inline__P144721_mk(s) {
16708
16708
  checkStack(s.depth);
@@ -16750,7 +16750,7 @@ switch (step) {
16750
16750
  return leave(s, r0)
16751
16751
  default: oops()
16752
16752
  } } }
16753
- Sprite__destroyCore_inline__P144728.info = {"start":30893,"length":20,"line":985,"column":21,"endLine":985,"endColumn":41,"fileName":"sprite.ts","functionName":"inline","argumentNames":["h"]}
16753
+ Sprite__destroyCore_inline__P144728.info = {"start":30919,"length":20,"line":985,"column":21,"endLine":985,"endColumn":41,"fileName":"sprite.ts","functionName":"inline","argumentNames":["h"]}
16754
16754
 
16755
16755
  function Sprite__destroyCore_inline__P144728_mk(s) {
16756
16756
  checkStack(s.depth);
@@ -16882,7 +16882,7 @@ switch (step) {
16882
16882
  return leave(s, r0)
16883
16883
  default: oops()
16884
16884
  } } }
16885
- Sprite_kind__P138958.info = {"start":13674,"length":41,"line":486,"column":4,"endLine":488,"endColumn":5,"fileName":"sprite.ts","functionName":"kind","argumentNames":["this"]}
16885
+ Sprite_kind__P138958.info = {"start":13700,"length":41,"line":486,"column":4,"endLine":488,"endColumn":5,"fileName":"sprite.ts","functionName":"kind","argumentNames":["this"]}
16886
16886
 
16887
16887
  function Sprite_kind__P138958_mk(s) {
16888
16888
  checkStack(s.depth);
@@ -17402,7 +17402,7 @@ switch (step) {
17402
17402
  return leave(s, r0)
17403
17403
  default: oops()
17404
17404
  } } }
17405
- Sprite_setImage__P138940.info = {"start":9273,"length":131,"line":332,"column":4,"endLine":336,"endColumn":5,"fileName":"sprite.ts","functionName":"setImage","argumentNames":["this","img"]}
17405
+ Sprite_setImage__P138940.info = {"start":9299,"length":131,"line":332,"column":4,"endLine":336,"endColumn":5,"fileName":"sprite.ts","functionName":"setImage","argumentNames":["this","img"]}
17406
17406
 
17407
17407
  function Sprite_setImage__P138940_mk(s) {
17408
17408
  checkStack(s.depth);
@@ -17482,7 +17482,7 @@ switch (step) {
17482
17482
  return leave(s, r0)
17483
17483
  default: oops()
17484
17484
  } } }
17485
- Sprite_recalcSize__P138946.info = {"start":11085,"length":176,"line":396,"column":4,"endLine":400,"endColumn":5,"fileName":"sprite.ts","functionName":"recalcSize","argumentNames":["this"]}
17485
+ Sprite_recalcSize__P138946.info = {"start":11111,"length":176,"line":396,"column":4,"endLine":400,"endColumn":5,"fileName":"sprite.ts","functionName":"recalcSize","argumentNames":["this"]}
17486
17486
 
17487
17487
  function Sprite_recalcSize__P138946_mk(s) {
17488
17488
  checkStack(s.depth);
@@ -17530,7 +17530,7 @@ switch (step) {
17530
17530
  return leave(s, r0)
17531
17531
  default: oops()
17532
17532
  } } }
17533
- Sprite_resetHitbox__P138942.info = {"start":9532,"length":76,"line":342,"column":4,"endLine":345,"endColumn":5,"fileName":"sprite.ts","functionName":"resetHitbox","argumentNames":["this"]}
17533
+ Sprite_resetHitbox__P138942.info = {"start":9558,"length":76,"line":342,"column":4,"endLine":345,"endColumn":5,"fileName":"sprite.ts","functionName":"resetHitbox","argumentNames":["this"]}
17534
17534
 
17535
17535
  function Sprite_resetHitbox__P138942_mk(s) {
17536
17536
  checkStack(s.depth);
@@ -17698,7 +17698,7 @@ switch (step) {
17698
17698
  return leave(s, r0)
17699
17699
  default: oops()
17700
17700
  } } }
17701
- Sprite_setHitbox__P138943.info = {"start":9614,"length":1324,"line":347,"column":4,"endLine":386,"endColumn":5,"fileName":"sprite.ts","functionName":"setHitbox","argumentNames":["this"]}
17701
+ Sprite_setHitbox__P138943.info = {"start":9640,"length":1324,"line":347,"column":4,"endLine":386,"endColumn":5,"fileName":"sprite.ts","functionName":"setHitbox","argumentNames":["this"]}
17702
17702
 
17703
17703
  function Sprite_setHitbox__P138943_mk(s) {
17704
17704
  checkStack(s.depth);
@@ -17857,7 +17857,7 @@ switch (step) {
17857
17857
  return leave(s, r0)
17858
17858
  default: oops()
17859
17859
  } } }
17860
- Sprite_calcDimensionalHash__P138941.info = {"start":9410,"length":116,"line":338,"column":4,"endLine":340,"endColumn":5,"fileName":"sprite.ts","functionName":"calcDimensionalHash","argumentNames":["this"]}
17860
+ Sprite_calcDimensionalHash__P138941.info = {"start":9436,"length":116,"line":338,"column":4,"endLine":340,"endColumn":5,"fileName":"sprite.ts","functionName":"calcDimensionalHash","argumentNames":["this"]}
17861
17861
 
17862
17862
  function Sprite_calcDimensionalHash__P138941_mk(s) {
17863
17863
  checkStack(s.depth);
@@ -18433,7 +18433,7 @@ switch (step) {
18433
18433
  return leaveAccessor(s, r0)
18434
18434
  default: oops()
18435
18435
  } } }
18436
- Sprite_image__P138939.info = {"start":8997,"length":54,"line":322,"column":4,"endLine":324,"endColumn":5,"fileName":"sprite.ts","functionName":"image","argumentNames":["this"]}
18436
+ Sprite_image__P138939.info = {"start":9023,"length":54,"line":322,"column":4,"endLine":324,"endColumn":5,"fileName":"sprite.ts","functionName":"image","argumentNames":["this"]}
18437
18437
  Sprite_image__P138939.isGetter = true;
18438
18438
 
18439
18439
  function Sprite_image__P138939_mk(s) {
@@ -18668,7 +18668,7 @@ switch (step) {
18668
18668
  return leave(s, r0)
18669
18669
  default: oops()
18670
18670
  } } }
18671
- Sprite_setFlag__P138970.info = {"start":24029,"length":130,"line":784,"column":4,"endLine":787,"endColumn":5,"fileName":"sprite.ts","functionName":"setFlag","argumentNames":["this","flag","on"]}
18671
+ Sprite_setFlag__P138970.info = {"start":24055,"length":130,"line":784,"column":4,"endLine":787,"endColumn":5,"fileName":"sprite.ts","functionName":"setFlag","argumentNames":["this","flag","on"]}
18672
18672
 
18673
18673
  function Sprite_setFlag__P138970_mk(s) {
18674
18674
  checkStack(s.depth);
@@ -18976,7 +18976,7 @@ switch (step) {
18976
18976
  return leaveAccessor(s, r0)
18977
18977
  default: oops()
18978
18978
  } } }
18979
- Sprite_width__P138948.info = {"start":11475,"length":59,"line":408,"column":4,"endLine":410,"endColumn":5,"fileName":"sprite.ts","functionName":"width","argumentNames":["this"]}
18979
+ Sprite_width__P138948.info = {"start":11501,"length":59,"line":408,"column":4,"endLine":410,"endColumn":5,"fileName":"sprite.ts","functionName":"width","argumentNames":["this"]}
18980
18980
  Sprite_width__P138948.isGetter = true;
18981
18981
 
18982
18982
  function Sprite_width__P138948_mk(s) {
@@ -19037,7 +19037,7 @@ switch (step) {
19037
19037
  return leave(s, r0)
19038
19038
  default: oops()
19039
19039
  } } }
19040
- Sprite_left__P138951.info = {"start":11954,"length":257,"line":424,"column":4,"endLine":434,"endColumn":5,"fileName":"sprite.ts","functionName":"left","argumentNames":["this","value"]}
19040
+ Sprite_left__P138951.info = {"start":11980,"length":257,"line":424,"column":4,"endLine":434,"endColumn":5,"fileName":"sprite.ts","functionName":"left","argumentNames":["this","value"]}
19041
19041
 
19042
19042
  function Sprite_left__P138951_mk(s) {
19043
19043
  checkStack(s.depth);
@@ -19079,7 +19079,7 @@ switch (step) {
19079
19079
  return leaveAccessor(s, r0)
19080
19080
  default: oops()
19081
19081
  } } }
19082
- Sprite_left__P138950.info = {"start":11810,"length":53,"line":419,"column":4,"endLine":421,"endColumn":5,"fileName":"sprite.ts","functionName":"left","argumentNames":["this"]}
19082
+ Sprite_left__P138950.info = {"start":11836,"length":53,"line":419,"column":4,"endLine":421,"endColumn":5,"fileName":"sprite.ts","functionName":"left","argumentNames":["this"]}
19083
19083
  Sprite_left__P138950.isGetter = true;
19084
19084
 
19085
19085
  function Sprite_left__P138950_mk(s) {
@@ -19704,7 +19704,7 @@ switch (step) {
19704
19704
  return leave(s, r0)
19705
19705
  default: oops()
19706
19706
  } } }
19707
- Sprite_setKind__P138959.info = {"start":13942,"length":663,"line":497,"column":4,"endLine":517,"endColumn":5,"fileName":"sprite.ts","functionName":"setKind","argumentNames":["this","value"]}
19707
+ Sprite_setKind__P138959.info = {"start":13968,"length":663,"line":497,"column":4,"endLine":517,"endColumn":5,"fileName":"sprite.ts","functionName":"setKind","argumentNames":["this","value"]}
19708
19708
 
19709
19709
  function Sprite_setKind__P138959_mk(s) {
19710
19710
  checkStack(s.depth);
@@ -25296,7 +25296,7 @@ switch (step) {
25296
25296
  return leave(s, r0)
25297
25297
  default: oops()
25298
25298
  } } }
25299
- SpriteKind_create__P139020.info = {"start":750,"length":112,"line":25,"column":4,"endLine":28,"endColumn":5,"fileName":"spritekind.ts","functionName":"create","argumentNames":[]}
25299
+ SpriteKind_create__P139020.info = {"start":783,"length":112,"line":26,"column":4,"endLine":29,"endColumn":5,"fileName":"spritekind.ts","functionName":"create","argumentNames":[]}
25300
25300
 
25301
25301
  function SpriteKind_create__P139020_mk(s) {
25302
25302
  checkStack(s.depth);
@@ -27132,7 +27132,7 @@ switch (step) {
27132
27132
  return leave(s, r0)
27133
27133
  default: oops()
27134
27134
  } } }
27135
- Sprite_isStatic__P138944.info = {"start":10944,"length":57,"line":388,"column":4,"endLine":390,"endColumn":5,"fileName":"sprite.ts","functionName":"isStatic","argumentNames":["this"]}
27135
+ Sprite_isStatic__P138944.info = {"start":10970,"length":57,"line":388,"column":4,"endLine":390,"endColumn":5,"fileName":"sprite.ts","functionName":"isStatic","argumentNames":["this"]}
27136
27136
 
27137
27137
  function Sprite_isStatic__P138944_mk(s) {
27138
27138
  checkStack(s.depth);
@@ -29004,7 +29004,7 @@ switch (step) {
29004
29004
  return leave(s, r0)
29005
29005
  default: oops()
29006
29006
  } } }
29007
- tiles_getTileImage__P139316.info = {"start":21828,"length":207,"line":673,"column":4,"endLine":677,"endColumn":5,"fileName":"tilemap.ts","functionName":"getTileImage","argumentNames":["loc"]}
29007
+ tiles_getTileImage__P139316.info = {"start":21835,"length":207,"line":673,"column":4,"endLine":677,"endColumn":5,"fileName":"tilemap.ts","functionName":"getTileImage","argumentNames":["loc"]}
29008
29008
 
29009
29009
  function tiles_getTileImage__P139316_mk(s) {
29010
29010
  checkStack(s.depth);
@@ -29790,7 +29790,7 @@ switch (step) {
29790
29790
  return leave(s, r0)
29791
29791
  default: oops()
29792
29792
  } } }
29793
- Sprite_registerObstacle__P138977.info = {"start":28620,"length":965,"line":922,"column":4,"endLine":942,"endColumn":5,"fileName":"sprite.ts","functionName":"registerObstacle","argumentNames":["this","direction","other","tm"]}
29793
+ Sprite_registerObstacle__P138977.info = {"start":28646,"length":965,"line":922,"column":4,"endLine":942,"endColumn":5,"fileName":"sprite.ts","functionName":"registerObstacle","argumentNames":["this","direction","other","tm"]}
29794
29794
 
29795
29795
  function Sprite_registerObstacle__P138977_mk(s) {
29796
29796
  checkStack(s.depth);
@@ -29841,7 +29841,7 @@ switch (step) {
29841
29841
  return leave(s, r0)
29842
29842
  default: oops()
29843
29843
  } } }
29844
- forEach_inline__P148279.info = {"start":29018,"length":26,"line":929,"column":24,"endLine":929,"endColumn":50,"fileName":"sprite.ts","functionName":"inline","argumentNames":["h"]}
29844
+ forEach_inline__P148279.info = {"start":29044,"length":26,"line":929,"column":24,"endLine":929,"endColumn":50,"fileName":"sprite.ts","functionName":"inline","argumentNames":["h"]}
29845
29845
 
29846
29846
  function forEach_inline__P148279_mk(s) {
29847
29847
  checkStack(s.depth);
@@ -29889,7 +29889,7 @@ switch (step) {
29889
29889
  return leave(s, r0)
29890
29890
  default: oops()
29891
29891
  } } }
29892
- Sprite_registerObstacle_inline__P148285.info = {"start":29071,"length":20,"line":930,"column":25,"endLine":930,"endColumn":45,"fileName":"sprite.ts","functionName":"inline","argumentNames":["h"]}
29892
+ Sprite_registerObstacle_inline__P148285.info = {"start":29097,"length":20,"line":930,"column":25,"endLine":930,"endColumn":45,"fileName":"sprite.ts","functionName":"inline","argumentNames":["h"]}
29893
29893
 
29894
29894
  function Sprite_registerObstacle_inline__P148285_mk(s) {
29895
29895
  checkStack(s.depth);
@@ -29926,7 +29926,7 @@ switch (step) {
29926
29926
  return leave(s, r0)
29927
29927
  default: oops()
29928
29928
  } } }
29929
- wallHandlersToRun_inline__P148298.info = {"start":29277,"length":32,"line":935,"column":24,"endLine":935,"endColumn":56,"fileName":"sprite.ts","functionName":"inline","argumentNames":["h"]}
29929
+ wallHandlersToRun_inline__P148298.info = {"start":29303,"length":32,"line":935,"column":24,"endLine":935,"endColumn":56,"fileName":"sprite.ts","functionName":"inline","argumentNames":["h"]}
29930
29930
 
29931
29931
  function wallHandlersToRun_inline__P148298_mk(s) {
29932
29932
  checkStack(s.depth);
@@ -29975,7 +29975,7 @@ switch (step) {
29975
29975
  return leave(s, r0)
29976
29976
  default: oops()
29977
29977
  } } }
29978
- Sprite_registerObstacle_inline__P148327.info = {"start":29517,"length":36,"line":939,"column":29,"endLine":939,"endColumn":65,"fileName":"sprite.ts","functionName":"inline","argumentNames":["h"]}
29978
+ Sprite_registerObstacle_inline__P148327.info = {"start":29543,"length":36,"line":939,"column":29,"endLine":939,"endColumn":65,"fileName":"sprite.ts","functionName":"inline","argumentNames":["h"]}
29979
29979
 
29980
29980
  function Sprite_registerObstacle_inline__P148327_mk(s) {
29981
29981
  checkStack(s.depth);
@@ -31868,7 +31868,7 @@ switch (step) {
31868
31868
  return leave(s, r0)
31869
31869
  default: oops()
31870
31870
  } } }
31871
- Sprite_overlapsWith__P138971.info = {"start":24447,"length":1575,"line":797,"column":4,"endLine":844,"endColumn":5,"fileName":"sprite.ts","functionName":"overlapsWith","argumentNames":["this","other"]}
31871
+ Sprite_overlapsWith__P138971.info = {"start":24473,"length":1575,"line":797,"column":4,"endLine":844,"endColumn":5,"fileName":"sprite.ts","functionName":"overlapsWith","argumentNames":["this","other"]}
31872
31872
 
31873
31873
  function Sprite_overlapsWith__P138971_mk(s) {
31874
31874
  checkStack(s.depth);
@@ -32091,7 +32091,7 @@ switch (step) {
32091
32091
  return leave(s, r0)
32092
32092
  default: oops()
32093
32093
  } } }
32094
- Sprite_isScaled__P138947.info = {"start":11267,"length":100,"line":402,"column":4,"endLine":404,"endColumn":5,"fileName":"sprite.ts","functionName":"isScaled","argumentNames":["this"]}
32094
+ Sprite_isScaled__P138947.info = {"start":11293,"length":100,"line":402,"column":4,"endLine":404,"endColumn":5,"fileName":"sprite.ts","functionName":"isScaled","argumentNames":["this"]}
32095
32095
 
32096
32096
  function Sprite_isScaled__P138947_mk(s) {
32097
32097
  checkStack(s.depth);
@@ -32637,7 +32637,7 @@ switch (step) {
32637
32637
  return leaveAccessor(s, r0)
32638
32638
  default: oops()
32639
32639
  } } }
32640
- Sprite_right__P138952.info = {"start":12319,"length":57,"line":438,"column":4,"endLine":440,"endColumn":5,"fileName":"sprite.ts","functionName":"right","argumentNames":["this"]}
32640
+ Sprite_right__P138952.info = {"start":12345,"length":57,"line":438,"column":4,"endLine":440,"endColumn":5,"fileName":"sprite.ts","functionName":"right","argumentNames":["this"]}
32641
32641
  Sprite_right__P138952.isGetter = true;
32642
32642
 
32643
32643
  function Sprite_right__P138952_mk(s) {
@@ -32688,7 +32688,7 @@ switch (step) {
32688
32688
  return leaveAccessor(s, r0)
32689
32689
  default: oops()
32690
32690
  } } }
32691
- Sprite_bottom__P138956.info = {"start":13153,"length":59,"line":468,"column":4,"endLine":470,"endColumn":5,"fileName":"sprite.ts","functionName":"bottom","argumentNames":["this"]}
32691
+ Sprite_bottom__P138956.info = {"start":13179,"length":59,"line":468,"column":4,"endLine":470,"endColumn":5,"fileName":"sprite.ts","functionName":"bottom","argumentNames":["this"]}
32692
32692
  Sprite_bottom__P138956.isGetter = true;
32693
32693
 
32694
32694
  function Sprite_bottom__P138956_mk(s) {
@@ -33422,7 +33422,7 @@ switch (step) {
33422
33422
  return leave(s, r0)
33423
33423
  default: oops()
33424
33424
  } } }
33425
- Sprite_clearObstacles__P138976.info = {"start":28560,"length":54,"line":918,"column":4,"endLine":920,"endColumn":5,"fileName":"sprite.ts","functionName":"clearObstacles","argumentNames":["this"]}
33425
+ Sprite_clearObstacles__P138976.info = {"start":28586,"length":54,"line":918,"column":4,"endLine":920,"endColumn":5,"fileName":"sprite.ts","functionName":"clearObstacles","argumentNames":["this"]}
33426
33426
 
33427
33427
  function Sprite_clearObstacles__P138976_mk(s) {
33428
33428
  checkStack(s.depth);
@@ -35027,7 +35027,7 @@ switch (step) {
35027
35027
  return leave(s, r0)
35028
35028
  default: oops()
35029
35029
  } } }
35030
- Sprite_toString__P138985.info = {"start":37683,"length":93,"line":1169,"column":4,"endLine":1171,"endColumn":5,"fileName":"sprite.ts","functionName":"toString","argumentNames":["this"]}
35030
+ Sprite_toString__P138985.info = {"start":37744,"length":93,"line":1170,"column":4,"endLine":1172,"endColumn":5,"fileName":"sprite.ts","functionName":"toString","argumentNames":["this"]}
35031
35031
 
35032
35032
  function Sprite_toString__P138985_mk(s) {
35033
35033
  checkStack(s.depth);
@@ -35374,7 +35374,7 @@ switch (step) {
35374
35374
  return leave(s, r0)
35375
35375
  default: oops()
35376
35376
  } } }
35377
- Sprite___update__P138967.info = {"start":21606,"length":1363,"line":714,"column":4,"endLine":750,"endColumn":5,"fileName":"sprite.ts","functionName":"__update","argumentNames":["this","camera","dt"]}
35377
+ Sprite___update__P138967.info = {"start":21632,"length":1363,"line":714,"column":4,"endLine":750,"endColumn":5,"fileName":"sprite.ts","functionName":"__update","argumentNames":["this","camera","dt"]}
35378
35378
 
35379
35379
  function Sprite___update__P138967_mk(s) {
35380
35380
  checkStack(s.depth);
@@ -35478,7 +35478,7 @@ switch (step) {
35478
35478
  return leave(s, r0)
35479
35479
  default: oops()
35480
35480
  } } }
35481
- Sprite_bottom__P138957.info = {"start":13305,"length":73,"line":473,"column":4,"endLine":475,"endColumn":5,"fileName":"sprite.ts","functionName":"bottom","argumentNames":["this","value"]}
35481
+ Sprite_bottom__P138957.info = {"start":13331,"length":73,"line":473,"column":4,"endLine":475,"endColumn":5,"fileName":"sprite.ts","functionName":"bottom","argumentNames":["this","value"]}
35482
35482
 
35483
35483
  function Sprite_bottom__P138957_mk(s) {
35484
35484
  checkStack(s.depth);
@@ -35532,7 +35532,7 @@ switch (step) {
35532
35532
  return leave(s, r0)
35533
35533
  default: oops()
35534
35534
  } } }
35535
- Sprite_right__P138953.info = {"start":12468,"length":71,"line":443,"column":4,"endLine":445,"endColumn":5,"fileName":"sprite.ts","functionName":"right","argumentNames":["this","value"]}
35535
+ Sprite_right__P138953.info = {"start":12494,"length":71,"line":443,"column":4,"endLine":445,"endColumn":5,"fileName":"sprite.ts","functionName":"right","argumentNames":["this","value"]}
35536
35536
 
35537
35537
  function Sprite_right__P138953_mk(s) {
35538
35538
  checkStack(s.depth);
@@ -35667,7 +35667,7 @@ switch (step) {
35667
35667
  return leave(s, r0)
35668
35668
  default: oops()
35669
35669
  } } }
35670
- Sprite_isOutOfScreen__P138965.info = {"start":18931,"length":358,"line":640,"column":4,"endLine":644,"endColumn":5,"fileName":"sprite.ts","functionName":"isOutOfScreen","argumentNames":["this","camera"]}
35670
+ Sprite_isOutOfScreen__P138965.info = {"start":18957,"length":358,"line":640,"column":4,"endLine":644,"endColumn":5,"fileName":"sprite.ts","functionName":"isOutOfScreen","argumentNames":["this","camera"]}
35671
35671
 
35672
35672
  function Sprite_isOutOfScreen__P138965_mk(s) {
35673
35673
  checkStack(s.depth);
@@ -38182,7 +38182,7 @@ switch (step) {
38182
38182
  return leave(s, r0)
38183
38183
  default: oops()
38184
38184
  } } }
38185
- Sprite___drawCore__P138966.info = {"start":19295,"length":2305,"line":646,"column":4,"endLine":712,"endColumn":5,"fileName":"sprite.ts","functionName":"__drawCore","argumentNames":["this","camera"]}
38185
+ Sprite___drawCore__P138966.info = {"start":19321,"length":2305,"line":646,"column":4,"endLine":712,"endColumn":5,"fileName":"sprite.ts","functionName":"__drawCore","argumentNames":["this","camera"]}
38186
38186
 
38187
38187
  function Sprite___drawCore__P138966_mk(s) {
38188
38188
  checkStack(s.depth);
@@ -38317,7 +38317,7 @@ switch (step) {
38317
38317
  return leave(s, r0)
38318
38318
  default: oops()
38319
38319
  } } }
38320
- Sprite___visible__P138945.info = {"start":11007,"length":72,"line":392,"column":4,"endLine":394,"endColumn":5,"fileName":"sprite.ts","functionName":"__visible","argumentNames":["this"]}
38320
+ Sprite___visible__P138945.info = {"start":11033,"length":72,"line":392,"column":4,"endLine":394,"endColumn":5,"fileName":"sprite.ts","functionName":"__visible","argumentNames":["this"]}
38321
38321
 
38322
38322
  function Sprite___visible__P138945_mk(s) {
38323
38323
  checkStack(s.depth);
@@ -0,0 +1,66 @@
1
+ # follow
2
+
3
+ Set a sprite to always move to the position of another target sprite.
4
+
5
+ ```sig
6
+ sprites.create(null).follow(null, 0)
7
+ ```
8
+
9
+ When you set a sprite to follow a target sprite, it will move toward the target by "chasing" it with a certain speed. If the sprite can reach the target before it moves again, the sprite will stop and occupy the same location as the target sprite. When not moving, the sprites overlap each other at their center locations.
10
+
11
+ ## Parameters
12
+
13
+ * **target**: the target [sprite](/types/sprite) to follow.
14
+ * **speed**: the maximum chase speed after accelerating, in pixels per second, when moving toward the target sprite.
15
+ * **turnRate**: (optional) the time to take in making a turn to toward the target sprite. For example, using the default rate, `400`, the sprite will reach **speed** in 125 milleseconds when turing 180 degrees to chase the target.
16
+
17
+ ## Example
18
+
19
+ Create 2 sprites. Set the second sprite to follow the first one. Every second, randomly change the position of the first sprite on the screen so that the second sprite will keep chasing it.
20
+
21
+ ```blocks
22
+ let mySprite = sprites.create(img`
23
+ . . . . . . . . . . . . . . . .
24
+ . . . . . . . . . . . . . . . .
25
+ . . . . . 7 7 7 7 7 7 . . . . .
26
+ . . . 7 7 7 7 7 7 7 7 7 7 . . .
27
+ . . . 7 7 7 7 7 7 7 7 7 7 . . .
28
+ . . 7 7 7 7 7 7 7 7 7 7 7 7 . .
29
+ . . 7 7 7 7 7 7 7 7 7 7 7 7 . .
30
+ . . 7 7 7 7 7 7 7 7 7 7 7 7 . .
31
+ . . 7 7 7 7 7 7 7 7 7 7 7 7 . .
32
+ . . 7 7 7 7 7 7 7 7 7 7 7 7 . .
33
+ . . 7 7 7 7 7 7 7 7 7 7 7 7 . .
34
+ . . . 7 7 7 7 7 7 7 7 7 7 . . .
35
+ . . . 7 7 7 7 7 7 7 7 7 7 . . .
36
+ . . . . . 7 7 7 7 7 7 . . . . .
37
+ . . . . . . . . . . . . . . . .
38
+ . . . . . . . . . . . . . . . .
39
+ `, SpriteKind.Player)
40
+ let mySprite2 = sprites.create(img`
41
+ . . . . . . . . . . . . . . . .
42
+ . . . . . . . . . . . . . . . .
43
+ . . . . . 5 5 5 5 5 5 . . . . .
44
+ . . . 5 5 5 5 5 5 5 5 5 5 . . .
45
+ . . . 5 5 5 5 5 5 5 5 5 5 . . .
46
+ . . 5 5 5 5 5 5 5 5 5 5 5 5 . .
47
+ . . 5 5 5 5 5 5 5 5 5 5 5 5 . .
48
+ . . 5 5 5 5 5 5 5 5 5 5 5 5 . .
49
+ . . 5 5 5 5 5 5 5 5 5 5 5 5 . .
50
+ . . 5 5 5 5 5 5 5 5 5 5 5 5 . .
51
+ . . 5 5 5 5 5 5 5 5 5 5 5 5 . .
52
+ . . . 5 5 5 5 5 5 5 5 5 5 . . .
53
+ . . . 5 5 5 5 5 5 5 5 5 5 . . .
54
+ . . . . . 5 5 5 5 5 5 . . . . .
55
+ . . . . . . . . . . . . . . . .
56
+ . . . . . . . . . . . . . . . .
57
+ `, SpriteKind.Player)
58
+ mySprite2.follow(mySprite, 50,)
59
+ game.onUpdateInterval(1000, function () {
60
+ mySprite.setPosition(randint(0, scene.screenWidth()), randint(0, scene.screenHeight()))
61
+ })
62
+ ```
63
+
64
+ ## See also
65
+
66
+ [overlaps with](/reference/sprites/sprite/overlaps-with)
@@ -43,7 +43,7 @@ mySprite.vx = 50
43
43
  mySprite.vy = 50
44
44
  ```
45
45
 
46
- ### Boucne on the the edge of the screen
46
+ ### Bounce on the the edge of the screen
47
47
 
48
48
  With a scene that has no tilemap set, make a sprite bounce on the edges of the screen.
49
49
 
@@ -97,4 +97,4 @@ mySprite.vy = 50
97
97
 
98
98
  ## See also
99
99
 
100
- [set flag](/reference/sprites/sprite/set-flag), [set stay in screen](/reference/sprites/sprite/set-stay-in-screen)
100
+ [set flag](/reference/sprites/sprite/set-flag), [set stay in screen](/reference/sprites/sprite/set-stay-in-screen)
@@ -0,0 +1,70 @@
1
+ # sprite Kind
2
+
3
+ Get a sprite kind object from a sprite kind identifier.
4
+
5
+ ```sig
6
+ sprites._spriteKind(0)
7
+ ```
8
+
9
+ To keep track of different types of sprites, a _kind_ is assigned to them. This is a value that will help identify them and decide what actions to take when events happen in the game. The sprite kinds in your game might be defined like this:
10
+
11
+ ```typescript-ignore
12
+ namespace SpriteKind {
13
+ export const Player = SpriteKind.create()
14
+ export const Enemy = SpriteKind.create()
15
+ export const Food = SpriteKind.create()
16
+ ...
17
+ }
18
+ ```
19
+
20
+ In blocks, a sprite kind identifier is used to make a sprite kind item that can be assigned to a variable or used as a parameter:
21
+
22
+ ```block
23
+ let enemyKind = SpriteKind.Enemy
24
+ ```
25
+
26
+ ## Parameters
27
+
28
+ * **kind**: the sprite kind identifier to get the kind object for.
29
+
30
+ ## Returns
31
+
32
+ * a sprite [kind](/reference/sprites/sprite/kind) object for a sprite kind identifer.
33
+
34
+ ## Example #example
35
+
36
+ Create several `Food` sprites at random locations on the screen. Use a sprite kind object for the `Food` identifier to destroy all `Food` srprites.
37
+
38
+ ```blocks
39
+ let mySprite: Sprite = null
40
+ let foodKind = SpriteKind.Food
41
+ for (let index = 0; index <= 4; index++) {
42
+ mySprite = sprites.create(img`
43
+ . . . . c c c b b b b b . . . .
44
+ . . c c b 4 4 4 4 4 4 b b b . .
45
+ . c c 4 4 4 4 4 5 4 4 4 4 b c .
46
+ . e 4 4 4 4 4 4 4 4 4 5 4 4 e .
47
+ e b 4 5 4 4 5 4 4 4 4 4 4 4 b c
48
+ e b 4 4 4 4 4 4 4 4 4 4 5 4 4 e
49
+ e b b 4 4 4 4 4 4 4 4 4 4 4 b e
50
+ . e b 4 4 4 4 4 5 4 4 4 4 b e .
51
+ 8 7 e e b 4 4 4 4 4 4 b e e 6 8
52
+ 8 7 2 e e e e e e e e e e 2 7 8
53
+ e 6 6 2 2 2 2 2 2 2 2 2 2 6 c e
54
+ e c 6 7 6 6 7 7 7 6 6 7 6 c c e
55
+ e b e 8 8 c c 8 8 c c c 8 e b e
56
+ e e b e c c e e e e e c e b e e
57
+ . e e b b 4 4 4 4 4 4 4 4 e e .
58
+ . . . c c c c c e e e e e . . .
59
+ `, SpriteKind.Food)
60
+ mySprite.setPosition(randint(0, scene.screenWidth()), randint(0, scene.screenHeight()))
61
+ }
62
+ for (let value of sprites.allOfKind(foodKind)) {
63
+ pause(1000)
64
+ value.destroy()
65
+ }
66
+ ```
67
+
68
+ ## See also #seealso
69
+
70
+ [kind](/reference/sprites/sprite/kind)
@@ -0,0 +1,123 @@
1
+ # get Neighboring Location
2
+
3
+ Get the location of a tile next to this one.
4
+
5
+ ```sig
6
+ tiles.getTileLocation(0, 0).getNeighboringLocation(CollisionDirection.Top)
7
+ ```
8
+
9
+ A neighboring tile is one that is immediately to the `left`, `right`, `top`, or `bottom` side of the current tile. You can specify the side of the neighboring tile you want the location for.
10
+
11
+ ## Parameters
12
+
13
+ * **direction**: the direction side for the neighbor tile from this tile. The directions to choose from are `left`, `right`, `top`, or `bottom`.
14
+
15
+ ## Returns
16
+
17
+ * a [location](/reference/tiles/location) object for the neighbor tile.
18
+
19
+ ## Example #example
20
+
21
+ Rotate a donut sprite around adjacent tiles in a tilemap.
22
+
23
+ ```blocks
24
+ let nextSpot: tiles.Location = null
25
+ let rotation = 0
26
+ tiles.setCurrentTilemap(tilemap`level1`)
27
+ let mySprite = sprites.create(img`
28
+ . . . . . . b b b b a a . . . .
29
+ . . . . b b d d d 3 3 3 a a . .
30
+ . . . b d d d 3 3 3 3 3 3 a a .
31
+ . . b d d 3 3 3 3 3 3 3 3 3 a .
32
+ . b 3 d 3 3 3 3 3 b 3 3 3 3 a b
33
+ . b 3 3 3 3 3 a a 3 3 3 3 3 a b
34
+ b 3 3 3 3 3 a a 3 3 3 3 d a 4 b
35
+ b 3 3 3 3 b a 3 3 3 3 3 d a 4 b
36
+ b 3 3 3 3 3 3 3 3 3 3 d a 4 4 e
37
+ a 3 3 3 3 3 3 3 3 3 d a 4 4 4 e
38
+ a 3 3 3 3 3 3 3 d d a 4 4 4 e .
39
+ a a 3 3 3 d d d a a 4 4 4 e e .
40
+ . e a a a a a a 4 4 4 4 e e . .
41
+ . . e e b b 4 4 4 4 b e e . . .
42
+ . . . e e e e e e e e . . . . .
43
+ . . . . . . . . . . . . . . . .
44
+ `, SpriteKind.Player)
45
+ mySprite.x = mySprite.x - mySprite.width
46
+ game.onUpdateInterval(1000, function () {
47
+ if (rotation == 0) {
48
+ nextSpot = mySprite.tilemapLocation().getNeighboringLocation(CollisionDirection.Right)
49
+ } else if (rotation == 1) {
50
+ nextSpot = mySprite.tilemapLocation().getNeighboringLocation(CollisionDirection.Bottom)
51
+ } else if (rotation == 2) {
52
+ nextSpot = mySprite.tilemapLocation().getNeighboringLocation(CollisionDirection.Left)
53
+ } else {
54
+ nextSpot = mySprite.tilemapLocation().getNeighboringLocation(CollisionDirection.Top)
55
+ }
56
+ mySprite.setPosition(nextSpot.x, nextSpot.y)
57
+ rotation += 1
58
+ if (rotation > 3) {
59
+ rotation = 0
60
+ }
61
+ })
62
+ ```
63
+
64
+ ## See also #seealso
65
+
66
+ [get tile location](/reference/tiles/get-tile-location)
67
+
68
+ ```jres
69
+ {
70
+ "transparency16": {
71
+ "data": "hwQQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
72
+ "mimeType": "image/x-mkcd-f4",
73
+ "tilemapTile": true
74
+ },
75
+ "tile1": {
76
+ "data": "hwQQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
77
+ "mimeType": "image/x-mkcd-f4",
78
+ "tilemapTile": true,
79
+ "displayName": "myTile"
80
+ },
81
+ "tile2": {
82
+ "data": "hwQQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
83
+ "mimeType": "image/x-mkcd-f4",
84
+ "tilemapTile": true,
85
+ "displayName": "myTile0"
86
+ },
87
+ "tile3": {
88
+ "data": "hwQQABAAAABERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERA==",
89
+ "mimeType": "image/x-mkcd-f4",
90
+ "tilemapTile": true,
91
+ "displayName": "myTile1"
92
+ },
93
+ "tile4": {
94
+ "data": "hwQQABAAAAB3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3dw==",
95
+ "mimeType": "image/x-mkcd-f4",
96
+ "tilemapTile": true,
97
+ "displayName": "myTile2"
98
+ },
99
+ "tile5": {
100
+ "data": "hwQQABAAAACqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqg==",
101
+ "mimeType": "image/x-mkcd-f4",
102
+ "tilemapTile": true,
103
+ "displayName": "myTile3"
104
+ },
105
+ "level1": {
106
+ "id": "level1",
107
+ "mimeType": "application/mkcd-tilemap",
108
+ "data": "MTAwYTAwMDgwMDAxMDEwMTAxMDEwMTAxMDEwMTAxMDEwMzAyMDMwMjAzMDIwMzAyMDEwMTAyMDMwMjAzMDIwMzAyMDMwMTAxMDMwMjAzMDIwMzAyMDMwMjAxMDEwMjAzMDIwMzAyMDMwMjAzMDEwMTAzMDIwMzAyMDMwMjAzMDIwMTAxMDIwMzAyMDMwMjAzMDIwMzAxMDEwMTAxMDEwMTAxMDEwMTAxMDEwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMA==",
109
+ "tileset": [
110
+ "myTiles.transparency16",
111
+ "myTiles.tile3",
112
+ "myTiles.tile4",
113
+ "myTiles.tile5"
114
+ ],
115
+ "displayName": "level1"
116
+ },
117
+ "*": {
118
+ "mimeType": "image/x-mkcd-f4",
119
+ "dataEncoding": "base64",
120
+ "namespace": "myTiles"
121
+ }
122
+ }
123
+ ```