pxt-arcade 1.12.34 → 1.12.36
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 +14 -2
- package/built/common-sim.js +83 -29
- package/built/sim.js +146 -67
- package/built/target-strings.json +1 -1
- package/built/target.js +1 -1
- package/built/target.json +1 -1
- package/built/targetlight.json +1 -1
- package/package.json +4 -4
- package/pxtarget.json +2 -0
package/built/common-sim.d.ts
CHANGED
|
@@ -938,9 +938,15 @@ declare namespace pxsim.input {
|
|
|
938
938
|
}
|
|
939
939
|
declare namespace pxsim {
|
|
940
940
|
interface MicrophoneBoard {
|
|
941
|
-
microphoneState:
|
|
941
|
+
microphoneState: MicrophoneState;
|
|
942
942
|
}
|
|
943
|
-
|
|
943
|
+
class MicrophoneState extends AnalogSensorState {
|
|
944
|
+
onSoundRegistered: boolean;
|
|
945
|
+
soundLevelRequested: boolean;
|
|
946
|
+
private pingUsed;
|
|
947
|
+
pingSoundLevel: () => void;
|
|
948
|
+
}
|
|
949
|
+
function microphoneState(): MicrophoneState;
|
|
944
950
|
}
|
|
945
951
|
declare namespace pxsim.music {
|
|
946
952
|
function playInstructions(b: RefBuffer): Promise<void>;
|
|
@@ -1097,6 +1103,8 @@ declare namespace pxsim {
|
|
|
1097
1103
|
}
|
|
1098
1104
|
}
|
|
1099
1105
|
declare namespace pxsim.ImageMethods {
|
|
1106
|
+
function XX(x: number): number;
|
|
1107
|
+
function YY(x: number): number;
|
|
1100
1108
|
function width(img: RefImage): number;
|
|
1101
1109
|
function height(img: RefImage): number;
|
|
1102
1110
|
function isMono(img: RefImage): boolean;
|
|
@@ -1216,6 +1224,10 @@ declare namespace pxsim.settings {
|
|
|
1216
1224
|
function _userClean(): void;
|
|
1217
1225
|
function _list(prefix: string): RefCollection;
|
|
1218
1226
|
}
|
|
1227
|
+
declare namespace pxsim.ShaderMethods {
|
|
1228
|
+
function _mergeImage(dst: RefImage, src: RefImage, xy: number): void;
|
|
1229
|
+
function _mapImage(dst: RefImage, src: RefImage, xy: number, buf: RefBuffer): void;
|
|
1230
|
+
}
|
|
1219
1231
|
declare namespace pxsim {
|
|
1220
1232
|
class StorageState {
|
|
1221
1233
|
files: pxsim.Map<number[]>;
|
package/built/common-sim.js
CHANGED
|
@@ -3179,8 +3179,30 @@ var pxsim;
|
|
|
3179
3179
|
input.setLoudSoundThreshold = setLoudSoundThreshold;
|
|
3180
3180
|
})(input = pxsim.input || (pxsim.input = {}));
|
|
3181
3181
|
})(pxsim || (pxsim = {}));
|
|
3182
|
+
/// <reference path="../../core/sim/analogSensor.ts" />
|
|
3182
3183
|
var pxsim;
|
|
3183
3184
|
(function (pxsim) {
|
|
3185
|
+
class MicrophoneState extends pxsim.AnalogSensorState {
|
|
3186
|
+
constructor() {
|
|
3187
|
+
super(...arguments);
|
|
3188
|
+
this.onSoundRegistered = false;
|
|
3189
|
+
this.soundLevelRequested = false;
|
|
3190
|
+
this.pingSoundLevel = () => {
|
|
3191
|
+
if (this.onSoundRegistered) {
|
|
3192
|
+
return;
|
|
3193
|
+
}
|
|
3194
|
+
this.soundLevelRequested = true;
|
|
3195
|
+
pxsim.runtime.queueDisplayUpdate();
|
|
3196
|
+
clearTimeout(this.pingUsed);
|
|
3197
|
+
this.pingUsed = setTimeout(() => {
|
|
3198
|
+
this.soundLevelRequested = false;
|
|
3199
|
+
pxsim.runtime.queueDisplayUpdate();
|
|
3200
|
+
this.pingUsed = undefined;
|
|
3201
|
+
}, 100);
|
|
3202
|
+
};
|
|
3203
|
+
}
|
|
3204
|
+
}
|
|
3205
|
+
pxsim.MicrophoneState = MicrophoneState;
|
|
3184
3206
|
function microphoneState() {
|
|
3185
3207
|
return pxsim.board().microphoneState;
|
|
3186
3208
|
}
|
|
@@ -3771,7 +3793,9 @@ var pxsim;
|
|
|
3771
3793
|
var ImageMethods;
|
|
3772
3794
|
(function (ImageMethods) {
|
|
3773
3795
|
function XX(x) { return (x << 16) >> 16; }
|
|
3796
|
+
ImageMethods.XX = XX;
|
|
3774
3797
|
function YY(x) { return x >> 16; }
|
|
3798
|
+
ImageMethods.YY = YY;
|
|
3775
3799
|
function width(img) { return img._width; }
|
|
3776
3800
|
ImageMethods.width = width;
|
|
3777
3801
|
function height(img) { return img._height; }
|
|
@@ -4215,57 +4239,58 @@ var pxsim;
|
|
|
4215
4239
|
}
|
|
4216
4240
|
ImageMethods.drawLine = drawLine;
|
|
4217
4241
|
function drawIcon(img, icon, x, y, color) {
|
|
4218
|
-
const
|
|
4242
|
+
const src = icon.data;
|
|
4219
4243
|
if (!pxsim.image.isValidImage(icon))
|
|
4220
4244
|
return;
|
|
4221
|
-
if (
|
|
4245
|
+
if (src[1] != 1)
|
|
4222
4246
|
return; // only mono
|
|
4223
|
-
let
|
|
4224
|
-
let
|
|
4225
|
-
let byteH = pxsim.image.byteHeight(
|
|
4247
|
+
let width = pxsim.image.bufW(src);
|
|
4248
|
+
let height = pxsim.image.bufH(src);
|
|
4249
|
+
let byteH = pxsim.image.byteHeight(height, 1);
|
|
4226
4250
|
x |= 0;
|
|
4227
4251
|
y |= 0;
|
|
4228
|
-
const
|
|
4229
|
-
const
|
|
4230
|
-
if (x +
|
|
4252
|
+
const destHeight = img._height;
|
|
4253
|
+
const destWidth = img._width;
|
|
4254
|
+
if (x + width <= 0)
|
|
4231
4255
|
return;
|
|
4232
|
-
if (x >=
|
|
4256
|
+
if (x >= destWidth)
|
|
4233
4257
|
return;
|
|
4234
|
-
if (y +
|
|
4258
|
+
if (y + height <= 0)
|
|
4235
4259
|
return;
|
|
4236
|
-
if (y >=
|
|
4260
|
+
if (y >= destHeight)
|
|
4237
4261
|
return;
|
|
4238
4262
|
img.makeWritable();
|
|
4239
|
-
let
|
|
4263
|
+
let srcPointer = 8;
|
|
4240
4264
|
color = img.color(color);
|
|
4241
4265
|
const screen = img.data;
|
|
4242
|
-
for (let i = 0; i <
|
|
4243
|
-
let
|
|
4244
|
-
if (0 <=
|
|
4245
|
-
let
|
|
4246
|
-
let
|
|
4247
|
-
let
|
|
4248
|
-
let
|
|
4266
|
+
for (let i = 0; i < width; ++i) {
|
|
4267
|
+
let destX = x + i;
|
|
4268
|
+
if (0 <= destX && destX < destWidth) {
|
|
4269
|
+
let destIndex = destX + y * destWidth;
|
|
4270
|
+
let srcIndex = srcPointer;
|
|
4271
|
+
let destY = y;
|
|
4272
|
+
let destEnd = Math.min(destHeight, height + y);
|
|
4249
4273
|
if (y < 0) {
|
|
4250
|
-
|
|
4251
|
-
|
|
4274
|
+
srcIndex += ((-y) >> 3);
|
|
4275
|
+
destY += ((-y) >> 3) * 8;
|
|
4276
|
+
destIndex += (destY - y) * destWidth;
|
|
4252
4277
|
}
|
|
4253
4278
|
let mask = 0x01;
|
|
4254
|
-
let
|
|
4255
|
-
while (
|
|
4256
|
-
if (
|
|
4257
|
-
screen[
|
|
4279
|
+
let srcByte = src[srcIndex++];
|
|
4280
|
+
while (destY < destEnd) {
|
|
4281
|
+
if (destY >= 0 && (srcByte & mask)) {
|
|
4282
|
+
screen[destIndex] = color;
|
|
4258
4283
|
}
|
|
4259
4284
|
mask <<= 1;
|
|
4260
4285
|
if (mask == 0x100) {
|
|
4261
4286
|
mask = 0x01;
|
|
4262
|
-
|
|
4287
|
+
srcByte = src[srcIndex++];
|
|
4263
4288
|
}
|
|
4264
|
-
|
|
4265
|
-
|
|
4289
|
+
destIndex += destWidth;
|
|
4290
|
+
destY++;
|
|
4266
4291
|
}
|
|
4267
4292
|
}
|
|
4268
|
-
|
|
4293
|
+
srcPointer += byteH;
|
|
4269
4294
|
}
|
|
4270
4295
|
}
|
|
4271
4296
|
ImageMethods.drawIcon = drawIcon;
|
|
@@ -5108,6 +5133,35 @@ var pxsim;
|
|
|
5108
5133
|
settings._list = _list;
|
|
5109
5134
|
})(settings = pxsim.settings || (pxsim.settings = {}));
|
|
5110
5135
|
})(pxsim || (pxsim = {}));
|
|
5136
|
+
/// <reference path="../../screen/sim/image.ts" />
|
|
5137
|
+
var pxsim;
|
|
5138
|
+
(function (pxsim) {
|
|
5139
|
+
var ShaderMethods;
|
|
5140
|
+
(function (ShaderMethods) {
|
|
5141
|
+
function _mergeImage(dst, src, xy) {
|
|
5142
|
+
mergeImage(dst, src, pxsim.ImageMethods.XX(xy), pxsim.ImageMethods.YY(xy));
|
|
5143
|
+
}
|
|
5144
|
+
ShaderMethods._mergeImage = _mergeImage;
|
|
5145
|
+
function mergeImage(dst, src, x0, y0) {
|
|
5146
|
+
for (let x = 0; x < src._width; x++) {
|
|
5147
|
+
for (let y = 0; y < src._height; y++) {
|
|
5148
|
+
pxsim.ImageMethods.setPixel(dst, x0 + x, y0 + y, Math.min(pxsim.ImageMethods.getPixel(dst, x0 + x, y0 + y), pxsim.ImageMethods.getPixel(src, x, y)));
|
|
5149
|
+
}
|
|
5150
|
+
}
|
|
5151
|
+
}
|
|
5152
|
+
function _mapImage(dst, src, xy, buf) {
|
|
5153
|
+
mapImage(dst, src, pxsim.ImageMethods.XX(xy), pxsim.ImageMethods.YY(xy), buf);
|
|
5154
|
+
}
|
|
5155
|
+
ShaderMethods._mapImage = _mapImage;
|
|
5156
|
+
function mapImage(dst, src, x0, y0, buf) {
|
|
5157
|
+
for (let x = 0; x < src._width; x++) {
|
|
5158
|
+
for (let y = 0; y < src._height; y++) {
|
|
5159
|
+
pxsim.ImageMethods.setPixel(dst, x0 + x, y0 + y, buf.data[pxsim.ImageMethods.getPixel(dst, x0 + x, y0 + y) + (pxsim.ImageMethods.getPixel(src, x, y) << 4)]);
|
|
5160
|
+
}
|
|
5161
|
+
}
|
|
5162
|
+
}
|
|
5163
|
+
})(ShaderMethods = pxsim.ShaderMethods || (pxsim.ShaderMethods = {}));
|
|
5164
|
+
})(pxsim || (pxsim = {}));
|
|
5111
5165
|
var pxsim;
|
|
5112
5166
|
(function (pxsim) {
|
|
5113
5167
|
class StorageState {
|
package/built/sim.js
CHANGED
|
@@ -399,7 +399,7 @@ var pxsim;
|
|
|
399
399
|
this.screenState = new pxsim.ScreenState(null);
|
|
400
400
|
this.audioState = new pxsim.AudioState();
|
|
401
401
|
this.accelerometerState = new pxsim.AccelerometerState(pxsim.runtime);
|
|
402
|
-
this.microphoneState = new pxsim.
|
|
402
|
+
this.microphoneState = new pxsim.MicrophoneState(DAL.DEVICE_ID_MICROPHONE, 0, 255, 50, 120);
|
|
403
403
|
this.controlMessageState = new pxsim.ControlMessageState(this);
|
|
404
404
|
// set all pin ids
|
|
405
405
|
[
|
|
@@ -779,6 +779,10 @@ var pxsim;
|
|
|
779
779
|
microcodeSkin();
|
|
780
780
|
break;
|
|
781
781
|
}
|
|
782
|
+
case "junior": {
|
|
783
|
+
juniorSkin();
|
|
784
|
+
break;
|
|
785
|
+
}
|
|
782
786
|
default:
|
|
783
787
|
break;
|
|
784
788
|
}
|
|
@@ -821,6 +825,27 @@ var pxsim;
|
|
|
821
825
|
aLabel.setAttribute("y", "12");
|
|
822
826
|
}
|
|
823
827
|
}
|
|
828
|
+
function juniorSkin() {
|
|
829
|
+
setSimThemeColor("background-color", "#EB4444");
|
|
830
|
+
setSimThemeColor("button-fill", "#D54322");
|
|
831
|
+
setSimThemeColor("button-stroke", "#670C0C");
|
|
832
|
+
setSimThemeColor("text-color", "#FFFFFF");
|
|
833
|
+
const wrapper = document.getElementById("wrap");
|
|
834
|
+
if (wrapper) {
|
|
835
|
+
wrapper.classList.add("junior", "portrait-only");
|
|
836
|
+
const gameButtonSvg = document.querySelector(".game-button-svg");
|
|
837
|
+
gameButtonSvg.removeAttribute("width");
|
|
838
|
+
gameButtonSvg.removeAttribute("height");
|
|
839
|
+
gameButtonSvg.setAttribute("viewBox", "0 0 100 28");
|
|
840
|
+
const aButton = document.querySelector(".button-a");
|
|
841
|
+
const aLabel = document.querySelector(".label-a");
|
|
842
|
+
aButton.setAttribute("cx", "50");
|
|
843
|
+
aButton.setAttribute("cy", "13");
|
|
844
|
+
aButton.setAttribute("r", "11.5");
|
|
845
|
+
aLabel.setAttribute("x", "50");
|
|
846
|
+
aLabel.setAttribute("y", "13");
|
|
847
|
+
}
|
|
848
|
+
}
|
|
824
849
|
function brownSkin() {
|
|
825
850
|
setSimThemeColor("background-color", "#8B4513");
|
|
826
851
|
setSimThemeColor("button-stroke", "#68320C");
|
|
@@ -1624,7 +1649,9 @@ var pxsim;
|
|
|
1624
1649
|
var ImageMethods;
|
|
1625
1650
|
(function (ImageMethods) {
|
|
1626
1651
|
function XX(x) { return (x << 16) >> 16; }
|
|
1652
|
+
ImageMethods.XX = XX;
|
|
1627
1653
|
function YY(x) { return x >> 16; }
|
|
1654
|
+
ImageMethods.YY = YY;
|
|
1628
1655
|
function width(img) { return img._width; }
|
|
1629
1656
|
ImageMethods.width = width;
|
|
1630
1657
|
function height(img) { return img._height; }
|
|
@@ -2068,57 +2095,58 @@ var pxsim;
|
|
|
2068
2095
|
}
|
|
2069
2096
|
ImageMethods.drawLine = drawLine;
|
|
2070
2097
|
function drawIcon(img, icon, x, y, color) {
|
|
2071
|
-
const
|
|
2098
|
+
const src = icon.data;
|
|
2072
2099
|
if (!pxsim.image.isValidImage(icon))
|
|
2073
2100
|
return;
|
|
2074
|
-
if (
|
|
2101
|
+
if (src[1] != 1)
|
|
2075
2102
|
return; // only mono
|
|
2076
|
-
let
|
|
2077
|
-
let
|
|
2078
|
-
let byteH = pxsim.image.byteHeight(
|
|
2103
|
+
let width = pxsim.image.bufW(src);
|
|
2104
|
+
let height = pxsim.image.bufH(src);
|
|
2105
|
+
let byteH = pxsim.image.byteHeight(height, 1);
|
|
2079
2106
|
x |= 0;
|
|
2080
2107
|
y |= 0;
|
|
2081
|
-
const
|
|
2082
|
-
const
|
|
2083
|
-
if (x +
|
|
2108
|
+
const destHeight = img._height;
|
|
2109
|
+
const destWidth = img._width;
|
|
2110
|
+
if (x + width <= 0)
|
|
2084
2111
|
return;
|
|
2085
|
-
if (x >=
|
|
2112
|
+
if (x >= destWidth)
|
|
2086
2113
|
return;
|
|
2087
|
-
if (y +
|
|
2114
|
+
if (y + height <= 0)
|
|
2088
2115
|
return;
|
|
2089
|
-
if (y >=
|
|
2116
|
+
if (y >= destHeight)
|
|
2090
2117
|
return;
|
|
2091
2118
|
img.makeWritable();
|
|
2092
|
-
let
|
|
2119
|
+
let srcPointer = 8;
|
|
2093
2120
|
color = img.color(color);
|
|
2094
2121
|
const screen = img.data;
|
|
2095
|
-
for (let i = 0; i <
|
|
2096
|
-
let
|
|
2097
|
-
if (0 <=
|
|
2098
|
-
let
|
|
2099
|
-
let
|
|
2100
|
-
let
|
|
2101
|
-
let
|
|
2122
|
+
for (let i = 0; i < width; ++i) {
|
|
2123
|
+
let destX = x + i;
|
|
2124
|
+
if (0 <= destX && destX < destWidth) {
|
|
2125
|
+
let destIndex = destX + y * destWidth;
|
|
2126
|
+
let srcIndex = srcPointer;
|
|
2127
|
+
let destY = y;
|
|
2128
|
+
let destEnd = Math.min(destHeight, height + y);
|
|
2102
2129
|
if (y < 0) {
|
|
2103
|
-
|
|
2104
|
-
|
|
2130
|
+
srcIndex += ((-y) >> 3);
|
|
2131
|
+
destY += ((-y) >> 3) * 8;
|
|
2132
|
+
destIndex += (destY - y) * destWidth;
|
|
2105
2133
|
}
|
|
2106
2134
|
let mask = 0x01;
|
|
2107
|
-
let
|
|
2108
|
-
while (
|
|
2109
|
-
if (
|
|
2110
|
-
screen[
|
|
2135
|
+
let srcByte = src[srcIndex++];
|
|
2136
|
+
while (destY < destEnd) {
|
|
2137
|
+
if (destY >= 0 && (srcByte & mask)) {
|
|
2138
|
+
screen[destIndex] = color;
|
|
2111
2139
|
}
|
|
2112
2140
|
mask <<= 1;
|
|
2113
2141
|
if (mask == 0x100) {
|
|
2114
2142
|
mask = 0x01;
|
|
2115
|
-
|
|
2143
|
+
srcByte = src[srcIndex++];
|
|
2116
2144
|
}
|
|
2117
|
-
|
|
2118
|
-
|
|
2145
|
+
destIndex += destWidth;
|
|
2146
|
+
destY++;
|
|
2119
2147
|
}
|
|
2120
2148
|
}
|
|
2121
|
-
|
|
2149
|
+
srcPointer += byteH;
|
|
2122
2150
|
}
|
|
2123
2151
|
}
|
|
2124
2152
|
ImageMethods.drawIcon = drawIcon;
|
|
@@ -4148,43 +4176,6 @@ var pxsim;
|
|
|
4148
4176
|
pxsim.RadioState = RadioState;
|
|
4149
4177
|
})(pxsim || (pxsim = {}));
|
|
4150
4178
|
var pxsim;
|
|
4151
|
-
(function (pxsim) {
|
|
4152
|
-
var input;
|
|
4153
|
-
(function (input) {
|
|
4154
|
-
function soundLevel() {
|
|
4155
|
-
let b = pxsim.microphoneState();
|
|
4156
|
-
if (!b)
|
|
4157
|
-
return 0;
|
|
4158
|
-
b.setUsed();
|
|
4159
|
-
return b.getLevel();
|
|
4160
|
-
}
|
|
4161
|
-
input.soundLevel = soundLevel;
|
|
4162
|
-
function onLoudSound(body) {
|
|
4163
|
-
let b = pxsim.microphoneState();
|
|
4164
|
-
if (!b)
|
|
4165
|
-
return;
|
|
4166
|
-
b.setUsed();
|
|
4167
|
-
pxsim.pxtcore.registerWithDal(b.id, DAL.LEVEL_THRESHOLD_HIGH, body);
|
|
4168
|
-
}
|
|
4169
|
-
input.onLoudSound = onLoudSound;
|
|
4170
|
-
function setLoudSoundThreshold(value) {
|
|
4171
|
-
let b = pxsim.microphoneState();
|
|
4172
|
-
if (!b)
|
|
4173
|
-
return;
|
|
4174
|
-
b.setUsed();
|
|
4175
|
-
b.setHighThreshold(value);
|
|
4176
|
-
}
|
|
4177
|
-
input.setLoudSoundThreshold = setLoudSoundThreshold;
|
|
4178
|
-
})(input = pxsim.input || (pxsim.input = {}));
|
|
4179
|
-
})(pxsim || (pxsim = {}));
|
|
4180
|
-
var pxsim;
|
|
4181
|
-
(function (pxsim) {
|
|
4182
|
-
function microphoneState() {
|
|
4183
|
-
return pxsim.board().microphoneState;
|
|
4184
|
-
}
|
|
4185
|
-
pxsim.microphoneState = microphoneState;
|
|
4186
|
-
})(pxsim || (pxsim = {}));
|
|
4187
|
-
var pxsim;
|
|
4188
4179
|
(function (pxsim) {
|
|
4189
4180
|
var keyboard;
|
|
4190
4181
|
(function (keyboard) {
|
|
@@ -5417,6 +5408,94 @@ var pxsim;
|
|
|
5417
5408
|
visuals.NeoPixelView = NeoPixelView;
|
|
5418
5409
|
})(visuals = pxsim.visuals || (pxsim.visuals = {}));
|
|
5419
5410
|
})(pxsim || (pxsim = {}));
|
|
5411
|
+
var pxsim;
|
|
5412
|
+
(function (pxsim) {
|
|
5413
|
+
var input;
|
|
5414
|
+
(function (input) {
|
|
5415
|
+
function soundLevel() {
|
|
5416
|
+
let b = pxsim.microphoneState();
|
|
5417
|
+
if (!b)
|
|
5418
|
+
return 0;
|
|
5419
|
+
b.setUsed();
|
|
5420
|
+
return b.getLevel();
|
|
5421
|
+
}
|
|
5422
|
+
input.soundLevel = soundLevel;
|
|
5423
|
+
function onLoudSound(body) {
|
|
5424
|
+
let b = pxsim.microphoneState();
|
|
5425
|
+
if (!b)
|
|
5426
|
+
return;
|
|
5427
|
+
b.setUsed();
|
|
5428
|
+
pxsim.pxtcore.registerWithDal(b.id, DAL.LEVEL_THRESHOLD_HIGH, body);
|
|
5429
|
+
}
|
|
5430
|
+
input.onLoudSound = onLoudSound;
|
|
5431
|
+
function setLoudSoundThreshold(value) {
|
|
5432
|
+
let b = pxsim.microphoneState();
|
|
5433
|
+
if (!b)
|
|
5434
|
+
return;
|
|
5435
|
+
b.setUsed();
|
|
5436
|
+
b.setHighThreshold(value);
|
|
5437
|
+
}
|
|
5438
|
+
input.setLoudSoundThreshold = setLoudSoundThreshold;
|
|
5439
|
+
})(input = pxsim.input || (pxsim.input = {}));
|
|
5440
|
+
})(pxsim || (pxsim = {}));
|
|
5441
|
+
/// <reference path="../../core/sim/analogSensor.ts" />
|
|
5442
|
+
var pxsim;
|
|
5443
|
+
(function (pxsim) {
|
|
5444
|
+
class MicrophoneState extends pxsim.AnalogSensorState {
|
|
5445
|
+
constructor() {
|
|
5446
|
+
super(...arguments);
|
|
5447
|
+
this.onSoundRegistered = false;
|
|
5448
|
+
this.soundLevelRequested = false;
|
|
5449
|
+
this.pingSoundLevel = () => {
|
|
5450
|
+
if (this.onSoundRegistered) {
|
|
5451
|
+
return;
|
|
5452
|
+
}
|
|
5453
|
+
this.soundLevelRequested = true;
|
|
5454
|
+
pxsim.runtime.queueDisplayUpdate();
|
|
5455
|
+
clearTimeout(this.pingUsed);
|
|
5456
|
+
this.pingUsed = setTimeout(() => {
|
|
5457
|
+
this.soundLevelRequested = false;
|
|
5458
|
+
pxsim.runtime.queueDisplayUpdate();
|
|
5459
|
+
this.pingUsed = undefined;
|
|
5460
|
+
}, 100);
|
|
5461
|
+
};
|
|
5462
|
+
}
|
|
5463
|
+
}
|
|
5464
|
+
pxsim.MicrophoneState = MicrophoneState;
|
|
5465
|
+
function microphoneState() {
|
|
5466
|
+
return pxsim.board().microphoneState;
|
|
5467
|
+
}
|
|
5468
|
+
pxsim.microphoneState = microphoneState;
|
|
5469
|
+
})(pxsim || (pxsim = {}));
|
|
5470
|
+
/// <reference path="../../screen/sim/image.ts" />
|
|
5471
|
+
var pxsim;
|
|
5472
|
+
(function (pxsim) {
|
|
5473
|
+
var ShaderMethods;
|
|
5474
|
+
(function (ShaderMethods) {
|
|
5475
|
+
function _mergeImage(dst, src, xy) {
|
|
5476
|
+
mergeImage(dst, src, pxsim.ImageMethods.XX(xy), pxsim.ImageMethods.YY(xy));
|
|
5477
|
+
}
|
|
5478
|
+
ShaderMethods._mergeImage = _mergeImage;
|
|
5479
|
+
function mergeImage(dst, src, x0, y0) {
|
|
5480
|
+
for (let x = 0; x < src._width; x++) {
|
|
5481
|
+
for (let y = 0; y < src._height; y++) {
|
|
5482
|
+
pxsim.ImageMethods.setPixel(dst, x0 + x, y0 + y, Math.min(pxsim.ImageMethods.getPixel(dst, x0 + x, y0 + y), pxsim.ImageMethods.getPixel(src, x, y)));
|
|
5483
|
+
}
|
|
5484
|
+
}
|
|
5485
|
+
}
|
|
5486
|
+
function _mapImage(dst, src, xy, buf) {
|
|
5487
|
+
mapImage(dst, src, pxsim.ImageMethods.XX(xy), pxsim.ImageMethods.YY(xy), buf);
|
|
5488
|
+
}
|
|
5489
|
+
ShaderMethods._mapImage = _mapImage;
|
|
5490
|
+
function mapImage(dst, src, x0, y0, buf) {
|
|
5491
|
+
for (let x = 0; x < src._width; x++) {
|
|
5492
|
+
for (let y = 0; y < src._height; y++) {
|
|
5493
|
+
pxsim.ImageMethods.setPixel(dst, x0 + x, y0 + y, buf.data[pxsim.ImageMethods.getPixel(dst, x0 + x, y0 + y) + (pxsim.ImageMethods.getPixel(src, x, y) << 4)]);
|
|
5494
|
+
}
|
|
5495
|
+
}
|
|
5496
|
+
}
|
|
5497
|
+
})(ShaderMethods = pxsim.ShaderMethods || (pxsim.ShaderMethods = {}));
|
|
5498
|
+
})(pxsim || (pxsim = {}));
|
|
5420
5499
|
const KEY_UP = 2048;
|
|
5421
5500
|
const KEY_DOWN = 2049;
|
|
5422
5501
|
const INTERNAL_KEY_UP = 2050;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"(Diagnostics) Garbage Collection checks.":"(Diagnostics) Garbage Collection checks.","20 pin Edge Connector":"20 pin Edge Connector","A Corgi platformer":"A Corgi platformer","A micro-servo library":"A micro-servo library","A sprite with path projection":"A sprite with path projection","A thermometer driver":"A thermometer driver","Adafruit Feather pinout":"Adafruit Feather pinout","Additional blocks for building multiplayer games":"Additional blocks for building multiplayer games","Additional scaling blocks for sprites":"Additional scaling blocks for sprites","Adds new blocks for message communication in the radio category":"Adds new blocks for message communication in the radio category","Advanced Livestream":"Advanced Livestream","Advanced state based animations for sprites":"Advanced state based animations for sprites","Arcade Compatible Devices":"Arcade Compatible Devices","Arts and Crafts":"Arts and Crafts","Azure IoT - beta":"Azure IoT - beta","Blocks Games":"Blocks Games","Blocks for the color-coded tilemap":"Blocks for the color-coded tilemap","Button A and B drivers":"Button A and B drivers","Color manipulation":"Color manipulation","Community Games":"Community Games","Contains overriden or additional files for the default project template":"Contains overriden or additional files for the default project template","Courses":"Courses","DIY Hardware":"DIY Hardware","Develop your programming skills by quickly creating and modding retro arcade games with Blocks and JavaScript in the MakeCode editor":"Develop your programming skills by quickly creating and modding retro arcade games with Blocks and JavaScript in the MakeCode editor","Docs":"Docs","Driver for rotary encoder":"Driver for rotary encoder","ESP32 over SPI - beta":"ESP32 over SPI - beta","Empty game library - beta":"Empty game library - beta","Extra game controller functionalities":"Extra game controller functionalities","Forum":"Forum","Game Design Concepts":"Game Design Concepts","Game Jam":"Game Jam","Graphics and Math":"Graphics and Math","Hardware":"Hardware","Hardware definition - web-browser only":"Hardware definition - web-browser only","How to Make a Game Videos":"How to Make a Game Videos","JavaScript Games":"JavaScript Games","John Park's Workshop":"John Park's Workshop","Keyboard emulation over HID":"Keyboard emulation over HID","Lessons":"Lessons","Live Coding":"Live Coding","MQTT for MakeCode - beta":"MQTT for MakeCode - beta","Microsoft MakeCode Arcade":"Microsoft MakeCode Arcade","Mouse emulation over HID":"Mouse emulation over HID","Multiplayer Games":"Multiplayer Games","Multiplayer Games!":"Multiplayer Games!","NRF52833 board":"NRF52833 board","NRF52840 board":"NRF52840 board","Networking abstractions":"Networking abstractions","Onboard light level sensor":"Onboard light level sensor","Palette manipulations":"Palette manipulations","Power and sleep management":"Power and sleep management","RP2040 board":"RP2040 board","Raspberry Pi":"Raspberry Pi","SAMD51 board":"SAMD51 board","STM32F4 board":"STM32F4 board","Scene manager":"Scene manager","Settings storage in files":"Settings storage in files","Settings storage in internal flash":"Settings storage in internal flash","Seven segment digit display":"Seven segment digit display","Skillmaps":"Skillmaps","The accelerometer library":"The accelerometer library","The base library":"The base library","The core library for Codal-based targets":"The core library for Codal-based targets","The fantasy game console library":"The fantasy game console library","The game and sprite library - beta":"The game and sprite library - beta","The microphone library":"The microphone library","The music library with a mixer":"The music library with a mixer","The programmable LED (WS2812b,APA102) driver.":"The programmable LED (WS2812b,APA102) driver.","The radio services":"The radio services","The screen library":"The screen library","Try Now":"Try Now","Tutorials":"Tutorials","UART communication":"UART communication","VM":"VM","WiFi support in Arcade - beta":"WiFi support in Arcade - beta","arcade":"arcade","{id:var}myImage":"myImage","{id:var}mySprite":"mySprite"}
|
|
1
|
+
{"(Diagnostics) Garbage Collection checks.":"(Diagnostics) Garbage Collection checks.","20 pin Edge Connector":"20 pin Edge Connector","A Corgi platformer":"A Corgi platformer","A micro-servo library":"A micro-servo library","A sprite with path projection":"A sprite with path projection","A thermometer driver":"A thermometer driver","Adafruit Feather pinout":"Adafruit Feather pinout","Additional blocks for building multiplayer games":"Additional blocks for building multiplayer games","Additional scaling blocks for sprites":"Additional scaling blocks for sprites","Adds new blocks for message communication in the radio category":"Adds new blocks for message communication in the radio category","Advanced Livestream":"Advanced Livestream","Advanced state based animations for sprites":"Advanced state based animations for sprites","Arcade Compatible Devices":"Arcade Compatible Devices","Arts and Crafts":"Arts and Crafts","Azure IoT - beta":"Azure IoT - beta","Blocks Games":"Blocks Games","Blocks for the color-coded tilemap":"Blocks for the color-coded tilemap","Button A and B drivers":"Button A and B drivers","Color manipulation":"Color manipulation","Community Games":"Community Games","Contains overriden or additional files for the default project template":"Contains overriden or additional files for the default project template","Courses":"Courses","DIY Hardware":"DIY Hardware","Develop your programming skills by quickly creating and modding retro arcade games with Blocks and JavaScript in the MakeCode editor":"Develop your programming skills by quickly creating and modding retro arcade games with Blocks and JavaScript in the MakeCode editor","Docs":"Docs","Driver for rotary encoder":"Driver for rotary encoder","ESP32 over SPI - beta":"ESP32 over SPI - beta","Empty game library - beta":"Empty game library - beta","Extra game controller functionalities":"Extra game controller functionalities","Forum":"Forum","Game Design Concepts":"Game Design Concepts","Game Jam":"Game Jam","Graphics and Math":"Graphics and Math","Hardware":"Hardware","Hardware definition - web-browser only":"Hardware definition - web-browser only","How to Make a Game Videos":"How to Make a Game Videos","JavaScript Games":"JavaScript Games","John Park's Workshop":"John Park's Workshop","Keyboard emulation over HID":"Keyboard emulation over HID","Lessons":"Lessons","Live Coding":"Live Coding","MQTT for MakeCode - beta":"MQTT for MakeCode - beta","Microsoft MakeCode Arcade":"Microsoft MakeCode Arcade","Mouse emulation over HID":"Mouse emulation over HID","Multiplayer Games":"Multiplayer Games","Multiplayer Games!":"Multiplayer Games!","NRF52833 board":"NRF52833 board","NRF52840 board":"NRF52840 board","Networking abstractions":"Networking abstractions","Onboard light level sensor":"Onboard light level sensor","Palette manipulations":"Palette manipulations","Power and sleep management":"Power and sleep management","RP2040 board":"RP2040 board","Raspberry Pi":"Raspberry Pi","SAMD51 board":"SAMD51 board","STM32F4 board":"STM32F4 board","Scene manager":"Scene manager","Settings storage in files":"Settings storage in files","Settings storage in internal flash":"Settings storage in internal flash","Seven segment digit display":"Seven segment digit display","Skillmaps":"Skillmaps","The accelerometer library":"The accelerometer library","The base library":"The base library","The core library for Codal-based targets":"The core library for Codal-based targets","The fantasy game console library":"The fantasy game console library","The game and sprite library - beta":"The game and sprite library - beta","The microphone library":"The microphone library","The music library with a mixer":"The music library with a mixer","The programmable LED (WS2812b,APA102) driver.":"The programmable LED (WS2812b,APA102) driver.","The radio services":"The radio services","The screen library":"The screen library","Try Now":"Try Now","Tutorials":"Tutorials","UART communication":"UART communication","Utility methods for shading images":"Utility methods for shading images","VM":"VM","WiFi support in Arcade - beta":"WiFi support in Arcade - beta","arcade":"arcade","{id:var}myImage":"myImage","{id:var}mySprite":"mySprite"}
|