pxt-common-packages 10.3.12 → 10.3.13

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 (33) hide show
  1. package/libs/azureiot/built/debug/binary.js +461 -461
  2. package/libs/color/built/debug/binary.js +8 -8
  3. package/libs/color-sensor/built/debug/binary.js +8 -8
  4. package/libs/controller/built/debug/binary.js +7069 -7069
  5. package/libs/controller---none/built/debug/binary.js +7049 -7049
  6. package/libs/datalogger/built/debug/binary.js +63 -63
  7. package/libs/edge-connector/built/debug/binary.js +8 -8
  8. package/libs/esp32/built/debug/binary.js +462 -462
  9. package/libs/game/_locales/game-jsdoc-strings.json +2 -2
  10. package/libs/game/_locales/game-strings.json +1 -1
  11. package/libs/game/built/debug/binary.js +6988 -6988
  12. package/libs/game/game.ts +9 -2
  13. package/libs/lcd/built/debug/binary.js +8 -8
  14. package/libs/light-spectrum-sensor/built/debug/binary.js +8 -8
  15. package/libs/lora/built/debug/binary.js +8 -8
  16. package/libs/matrix-keypad/built/debug/binary.js +8 -8
  17. package/libs/mixer/instrument.ts +7 -0
  18. package/libs/mixer/melody.ts +1 -0
  19. package/libs/mqtt/built/debug/binary.js +176 -176
  20. package/libs/net/built/debug/binary.js +176 -176
  21. package/libs/net-game/built/debug/binary.js +8577 -8577
  22. package/libs/palette/built/debug/binary.js +6987 -6987
  23. package/libs/pixel/built/debug/binary.js +8 -8
  24. package/libs/power/built/debug/binary.js +8 -8
  25. package/libs/proximity/built/debug/binary.js +8 -8
  26. package/libs/radio/built/debug/binary.js +8 -8
  27. package/libs/radio-broadcast/built/debug/binary.js +8 -8
  28. package/libs/rotary-encoder/built/debug/binary.js +8 -8
  29. package/libs/screen/built/debug/binary.js +50 -50
  30. package/libs/servo/built/debug/binary.js +8 -8
  31. package/libs/sprite-scaling/built/debug/binary.js +6987 -6987
  32. package/libs/storyboard/built/debug/binary.js +6987 -6987
  33. package/package.json +1 -1
package/libs/game/game.ts CHANGED
@@ -248,7 +248,7 @@ namespace game {
248
248
  * @param win whether the sound should play on a win (true) or lose (false)
249
249
  * @param effect
250
250
  */
251
- //% blockId=game_setgameoversound
251
+ //% blockId=game_setgameoverplayable
252
252
  //% block="use $sound looping $looping for $win"
253
253
  //% sound.shadow=music_melody_playable
254
254
  //% sound.defl=music.powerUp
@@ -260,12 +260,19 @@ namespace game {
260
260
  //% weight=80
261
261
  //% blockGap=8
262
262
  //% help=game/set-game-over-sound
263
- export function setGameOverSound(win: boolean, sound: music.Playable, looping: boolean) {
263
+ export function setGameOverPlayable(win: boolean, sound: music.Playable, looping: boolean) {
264
264
  init();
265
265
  const goc = game.gameOverConfig();
266
266
  goc.setSound(win, sound, looping, true);
267
267
  }
268
268
 
269
+ // Legacy api. Older extensions may still use this.
270
+ export function setGameOverSound(win: boolean, sound: music.Melody) {
271
+ init();
272
+ const goc = game.gameOverConfig();
273
+ goc.setSound(win, music.melodyPlayable(sound), false, true);
274
+ }
275
+
269
276
  /**
270
277
  * Set the message that displays when the game is over
271
278
  * @param win whether the message should show on a win (true) or lose (false)
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
56
56
  const pxsim_numops = pxsim.numops;
57
57
 
58
58
 
59
- function _main___P48755(s) {
59
+ function _main___P48757(s) {
60
60
  let r0 = s.r0, step = s.pc;
61
61
  s.pc = -1;
62
62
 
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
66
66
  switch (step) {
67
67
  case 0:
68
68
 
69
- globals._intervals___48998 = (undefined);
70
- globals._pollEventQueue___49011 = (undefined);
69
+ globals._intervals___49000 = (undefined);
70
+ globals._pollEventQueue___49013 = (undefined);
71
71
  r0 = undefined;
72
72
  return leave(s, r0)
73
73
  default: oops()
74
74
  } } }
75
- _main___P48755.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"characterlcd.ts","functionName":"<main>","argumentNames":[]}
76
- _main___P48755.continuations = [ ]
75
+ _main___P48757.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"characterlcd.ts","functionName":"<main>","argumentNames":[]}
76
+ _main___P48757.continuations = [ ]
77
77
 
78
- function _main___P48755_mk(s) {
78
+ function _main___P48757_mk(s) {
79
79
  checkStack(s.depth);
80
80
  return {
81
- parent: s, fn: _main___P48755, depth: s.depth + 1,
81
+ parent: s, fn: _main___P48757, depth: s.depth + 1,
82
82
  pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
83
83
  } }
84
84
 
@@ -88,5 +88,5 @@ function _main___P48755_mk(s) {
88
88
 
89
89
  const breakpoints = setupDebugger(1, [])
90
90
 
91
- return _main___P48755
91
+ return _main___P48757
92
92
  })
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
56
56
  const pxsim_numops = pxsim.numops;
57
57
 
58
58
 
59
- function _main___P98597(s) {
59
+ function _main___P98603(s) {
60
60
  let r0 = s.r0, step = s.pc;
61
61
  s.pc = -1;
62
62
 
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
66
66
  switch (step) {
67
67
  case 0:
68
68
 
69
- globals._intervals___98840 = (undefined);
70
- globals._pollEventQueue___98853 = (undefined);
69
+ globals._intervals___98846 = (undefined);
70
+ globals._pollEventQueue___98859 = (undefined);
71
71
  r0 = undefined;
72
72
  return leave(s, r0)
73
73
  default: oops()
74
74
  } } }
75
- _main___P98597.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"tsl2591.ts","functionName":"<main>","argumentNames":[]}
76
- _main___P98597.continuations = [ ]
75
+ _main___P98603.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"tsl2591.ts","functionName":"<main>","argumentNames":[]}
76
+ _main___P98603.continuations = [ ]
77
77
 
78
- function _main___P98597_mk(s) {
78
+ function _main___P98603_mk(s) {
79
79
  checkStack(s.depth);
80
80
  return {
81
- parent: s, fn: _main___P98597, depth: s.depth + 1,
81
+ parent: s, fn: _main___P98603, depth: s.depth + 1,
82
82
  pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
83
83
  } }
84
84
 
@@ -88,5 +88,5 @@ function _main___P98597_mk(s) {
88
88
 
89
89
  const breakpoints = setupDebugger(1, [])
90
90
 
91
- return _main___P98597
91
+ return _main___P98603
92
92
  })
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
56
56
  const pxsim_numops = pxsim.numops;
57
57
 
58
58
 
59
- function _main___P60057(s) {
59
+ function _main___P60059(s) {
60
60
  let r0 = s.r0, step = s.pc;
61
61
  s.pc = -1;
62
62
 
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
66
66
  switch (step) {
67
67
  case 0:
68
68
 
69
- globals._intervals___60300 = (undefined);
70
- globals._pollEventQueue___60313 = (undefined);
69
+ globals._intervals___60302 = (undefined);
70
+ globals._pollEventQueue___60315 = (undefined);
71
71
  r0 = undefined;
72
72
  return leave(s, r0)
73
73
  default: oops()
74
74
  } } }
75
- _main___P60057.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"lora.ts","functionName":"<main>","argumentNames":[]}
76
- _main___P60057.continuations = [ ]
75
+ _main___P60059.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"lora.ts","functionName":"<main>","argumentNames":[]}
76
+ _main___P60059.continuations = [ ]
77
77
 
78
- function _main___P60057_mk(s) {
78
+ function _main___P60059_mk(s) {
79
79
  checkStack(s.depth);
80
80
  return {
81
- parent: s, fn: _main___P60057, depth: s.depth + 1,
81
+ parent: s, fn: _main___P60059, depth: s.depth + 1,
82
82
  pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
83
83
  } }
84
84
 
@@ -88,5 +88,5 @@ function _main___P60057_mk(s) {
88
88
 
89
89
  const breakpoints = setupDebugger(1, [])
90
90
 
91
- return _main___P60057
91
+ return _main___P60059
92
92
  })
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
56
56
  const pxsim_numops = pxsim.numops;
57
57
 
58
58
 
59
- function _main___P191805(s) {
59
+ function _main___P191819(s) {
60
60
  let r0 = s.r0, step = s.pc;
61
61
  s.pc = -1;
62
62
 
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
66
66
  switch (step) {
67
67
  case 0:
68
68
 
69
- globals._intervals___192048 = (undefined);
70
- globals._pollEventQueue___192061 = (undefined);
69
+ globals._intervals___192062 = (undefined);
70
+ globals._pollEventQueue___192075 = (undefined);
71
71
  r0 = undefined;
72
72
  return leave(s, r0)
73
73
  default: oops()
74
74
  } } }
75
- _main___P191805.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"keypad.ts","functionName":"<main>","argumentNames":[]}
76
- _main___P191805.continuations = [ ]
75
+ _main___P191819.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"keypad.ts","functionName":"<main>","argumentNames":[]}
76
+ _main___P191819.continuations = [ ]
77
77
 
78
- function _main___P191805_mk(s) {
78
+ function _main___P191819_mk(s) {
79
79
  checkStack(s.depth);
80
80
  return {
81
- parent: s, fn: _main___P191805, depth: s.depth + 1,
81
+ parent: s, fn: _main___P191819, depth: s.depth + 1,
82
82
  pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
83
83
  } }
84
84
 
@@ -88,5 +88,5 @@ function _main___P191805_mk(s) {
88
88
 
89
89
  const breakpoints = setupDebugger(1, [])
90
90
 
91
- return _main___P191805
91
+ return _main___P191819
92
92
  })
@@ -811,4 +811,11 @@ namespace music.sequencer {
811
811
  // Use cosine to smooth out the value somewhat
812
812
  return Math.cos(((time / 1000) * lfo.frequency) * 2 * Math.PI) * lfo.amplitude
813
813
  }
814
+
815
+ export function _stopAllSongs() {
816
+ if (currentSequencer) {
817
+ currentSequencer.stop();
818
+ currentSequencer = undefined;
819
+ }
820
+ }
814
821
  }
@@ -184,6 +184,7 @@ namespace music {
184
184
  Melody.stopAll();
185
185
  stopPlaying();
186
186
  _stopPlayables();
187
+ sequencer._stopAllSongs();
187
188
  }
188
189
 
189
190
  //% fixedInstances