pxt-common-packages 12.3.5 → 12.3.25
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.
- package/built/common-sim.d.ts +12 -2
- package/built/common-sim.js +45 -4
- package/libs/azureiot/built/debug/binary.js +461 -461
- package/libs/browser-events/browserEvents.cpp +4 -0
- package/libs/browser-events/browserEvents.ts +115 -36
- package/libs/browser-events/keyboard.ts +147 -41
- package/libs/browser-events/shims.d.ts +2 -0
- package/libs/browser-events/sim/keyboard.ts +36 -3
- package/libs/browser-events/sim/mouseState.ts +15 -1
- package/libs/color/built/debug/binary.js +8 -8
- package/libs/color-sensor/built/debug/binary.js +8 -8
- package/libs/controller/built/debug/binary.js +8560 -8315
- package/libs/controller---none/built/debug/binary.js +8539 -8294
- package/libs/datalogger/built/debug/binary.js +63 -63
- package/libs/edge-connector/built/debug/binary.js +8 -8
- package/libs/esp32/built/debug/binary.js +462 -462
- package/libs/game/built/debug/binary.js +8452 -8207
- package/libs/game/game.ts +5 -2
- package/libs/lcd/built/debug/binary.js +8 -8
- package/libs/light-spectrum-sensor/built/debug/binary.js +8 -8
- package/libs/lora/built/debug/binary.js +8 -8
- package/libs/matrix-keypad/built/debug/binary.js +8 -8
- package/libs/mixer/playable.ts +6 -2
- package/libs/mixer/soundEffect.ts +2 -2
- package/libs/mqtt/built/debug/binary.js +176 -176
- package/libs/net/built/debug/binary.js +176 -176
- package/libs/net-game/built/debug/binary.js +10394 -10149
- package/libs/palette/built/debug/binary.js +8451 -8206
- package/libs/pixel/built/debug/binary.js +8 -8
- package/libs/power/built/debug/binary.js +8 -8
- package/libs/proximity/built/debug/binary.js +8 -8
- package/libs/radio/built/debug/binary.js +8 -8
- package/libs/radio-broadcast/built/debug/binary.js +8 -8
- package/libs/rotary-encoder/built/debug/binary.js +8 -8
- package/libs/screen/built/debug/binary.js +50 -50
- package/libs/screen---st7735/screen.cpp +2 -2
- package/libs/servo/built/debug/binary.js +8 -8
- package/libs/sprite-scaling/built/debug/binary.js +8451 -8206
- package/libs/storyboard/built/debug/binary.js +8451 -8206
- package/package.json +2 -2
package/libs/game/game.ts
CHANGED
|
@@ -174,7 +174,10 @@ namespace game {
|
|
|
174
174
|
const oldScene = game.currentScene()
|
|
175
175
|
particles.clearAll();
|
|
176
176
|
particles.disableAll();
|
|
177
|
-
if (!_sceneStack)
|
|
177
|
+
if (!_sceneStack) {
|
|
178
|
+
_sceneStack = [];
|
|
179
|
+
music._initializeSceneStack(game.addScenePushHandler, game.addScenePopHandler);
|
|
180
|
+
}
|
|
178
181
|
_sceneStack.push(_scene);
|
|
179
182
|
init(/** forceNewScene **/ true);
|
|
180
183
|
|
|
@@ -300,7 +303,7 @@ namespace game {
|
|
|
300
303
|
/**
|
|
301
304
|
* Set the message that displays when the game is over
|
|
302
305
|
* @param win whether the message should show on a win (true) or lose (false)
|
|
303
|
-
* @param message
|
|
306
|
+
* @param message
|
|
304
307
|
*/
|
|
305
308
|
//% blockId=game_setgameovermessage
|
|
306
309
|
//% block="use message $message for $win"
|
|
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
|
|
|
56
56
|
const pxsim_numops = pxsim.numops;
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
function
|
|
59
|
+
function _main___P49482(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.
|
|
70
|
-
globals.
|
|
69
|
+
globals._intervals___49725 = (undefined);
|
|
70
|
+
globals._pollEventQueue___49738 = (undefined);
|
|
71
71
|
r0 = undefined;
|
|
72
72
|
return leave(s, r0)
|
|
73
73
|
default: oops()
|
|
74
74
|
} } }
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
_main___P49482.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"characterlcd.ts","functionName":"<main>","argumentNames":[]}
|
|
76
|
+
_main___P49482.continuations = [ ]
|
|
77
77
|
|
|
78
|
-
function
|
|
78
|
+
function _main___P49482_mk(s) {
|
|
79
79
|
checkStack(s.depth);
|
|
80
80
|
return {
|
|
81
|
-
parent: s, fn:
|
|
81
|
+
parent: s, fn: _main___P49482, 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___P49445_mk(s) {
|
|
|
88
88
|
|
|
89
89
|
const breakpoints = setupDebugger(1, [])
|
|
90
90
|
|
|
91
|
-
return
|
|
91
|
+
return _main___P49482
|
|
92
92
|
})
|
|
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
|
|
|
56
56
|
const pxsim_numops = pxsim.numops;
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
function
|
|
59
|
+
function _main___P100795(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.
|
|
70
|
-
globals.
|
|
69
|
+
globals._intervals___101038 = (undefined);
|
|
70
|
+
globals._pollEventQueue___101051 = (undefined);
|
|
71
71
|
r0 = undefined;
|
|
72
72
|
return leave(s, r0)
|
|
73
73
|
default: oops()
|
|
74
74
|
} } }
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
_main___P100795.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"tsl2591.ts","functionName":"<main>","argumentNames":[]}
|
|
76
|
+
_main___P100795.continuations = [ ]
|
|
77
77
|
|
|
78
|
-
function
|
|
78
|
+
function _main___P100795_mk(s) {
|
|
79
79
|
checkStack(s.depth);
|
|
80
80
|
return {
|
|
81
|
-
parent: s, fn:
|
|
81
|
+
parent: s, fn: _main___P100795, 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___P100684_mk(s) {
|
|
|
88
88
|
|
|
89
89
|
const breakpoints = setupDebugger(1, [])
|
|
90
90
|
|
|
91
|
-
return
|
|
91
|
+
return _main___P100795
|
|
92
92
|
})
|
|
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
|
|
|
56
56
|
const pxsim_numops = pxsim.numops;
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
function
|
|
59
|
+
function _main___P60801(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.
|
|
70
|
-
globals.
|
|
69
|
+
globals._intervals___61044 = (undefined);
|
|
70
|
+
globals._pollEventQueue___61057 = (undefined);
|
|
71
71
|
r0 = undefined;
|
|
72
72
|
return leave(s, r0)
|
|
73
73
|
default: oops()
|
|
74
74
|
} } }
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
_main___P60801.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"lora.ts","functionName":"<main>","argumentNames":[]}
|
|
76
|
+
_main___P60801.continuations = [ ]
|
|
77
77
|
|
|
78
|
-
function
|
|
78
|
+
function _main___P60801_mk(s) {
|
|
79
79
|
checkStack(s.depth);
|
|
80
80
|
return {
|
|
81
|
-
parent: s, fn:
|
|
81
|
+
parent: s, fn: _main___P60801, 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___P60764_mk(s) {
|
|
|
88
88
|
|
|
89
89
|
const breakpoints = setupDebugger(1, [])
|
|
90
90
|
|
|
91
|
-
return
|
|
91
|
+
return _main___P60801
|
|
92
92
|
})
|
|
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
|
|
|
56
56
|
const pxsim_numops = pxsim.numops;
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
function
|
|
59
|
+
function _main___P197221(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.
|
|
70
|
-
globals.
|
|
69
|
+
globals._intervals___197464 = (undefined);
|
|
70
|
+
globals._pollEventQueue___197477 = (undefined);
|
|
71
71
|
r0 = undefined;
|
|
72
72
|
return leave(s, r0)
|
|
73
73
|
default: oops()
|
|
74
74
|
} } }
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
_main___P197221.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"keypad.ts","functionName":"<main>","argumentNames":[]}
|
|
76
|
+
_main___P197221.continuations = [ ]
|
|
77
77
|
|
|
78
|
-
function
|
|
78
|
+
function _main___P197221_mk(s) {
|
|
79
79
|
checkStack(s.depth);
|
|
80
80
|
return {
|
|
81
|
-
parent: s, fn:
|
|
81
|
+
parent: s, fn: _main___P197221, 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___P196962_mk(s) {
|
|
|
88
88
|
|
|
89
89
|
const breakpoints = setupDebugger(1, [])
|
|
90
90
|
|
|
91
|
-
return
|
|
91
|
+
return _main___P197221
|
|
92
92
|
})
|
package/libs/mixer/playable.ts
CHANGED
|
@@ -32,12 +32,16 @@ namespace music {
|
|
|
32
32
|
function _init() {
|
|
33
33
|
if (stateStack) return;
|
|
34
34
|
stateStack = [new PlayableState()];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function _initializeSceneStack(addScenePushHandler: (handler: () => void) => void, addScenePopHandler: (handler: () => void) => void) {
|
|
38
|
+
_init();
|
|
35
39
|
|
|
36
|
-
|
|
40
|
+
addScenePushHandler(() => {
|
|
37
41
|
stateStack.push(new PlayableState());
|
|
38
42
|
});
|
|
39
43
|
|
|
40
|
-
|
|
44
|
+
addScenePopHandler(() => {
|
|
41
45
|
stateStack.pop();
|
|
42
46
|
if (stateStack.length === 0) stateStack.push(new PlayableState());
|
|
43
47
|
});
|
|
@@ -307,7 +307,7 @@ namespace music {
|
|
|
307
307
|
if (res.waveShape === WaveShape.Noise) {
|
|
308
308
|
// The primary waveforms don't produce sounds that are similar to noise,
|
|
309
309
|
// but adding an effect sorta does
|
|
310
|
-
if (Math.
|
|
310
|
+
if (Math.random() < 0.2) {
|
|
311
311
|
res.waveShape = randomWave();
|
|
312
312
|
res.effect = randomEffect();
|
|
313
313
|
}
|
|
@@ -317,7 +317,7 @@ namespace music {
|
|
|
317
317
|
|
|
318
318
|
// Adding an effect can drastically alter the sound, so keep it
|
|
319
319
|
// at a low percent chance unless there already is one
|
|
320
|
-
if (res.effect !== SoundExpressionEffect.None || Math.
|
|
320
|
+
if (res.effect !== SoundExpressionEffect.None || Math.random() < 0.1) {
|
|
321
321
|
res.effect = randomEffect();
|
|
322
322
|
}
|
|
323
323
|
}
|