Handle random backdrop

This commit is contained in:
Kenny2github 2018-05-05 18:25:18 +08:00
parent 16c6868779
commit 4419014421

View file

@ -343,6 +343,8 @@ class Scratch3LooksBlocks {
} else if (requestedCostume === 'next costume' ||
requestedCostume === 'next backdrop') {
target.setCostume(target.currentCostume + 1);
} else if (requestedCostume === 'random backdrop') {
target.setCostume(Math.floor(Math.random() * target.getCostumes().length));
} else {
const forcedNumber = Number(requestedCostume);
if (!isNaN(forcedNumber)) {