mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 23:12:24 -05:00
Handle random backdrop
This commit is contained in:
parent
16c6868779
commit
4419014421
1 changed files with 2 additions and 0 deletions
|
@ -343,6 +343,8 @@ class Scratch3LooksBlocks {
|
||||||
} else if (requestedCostume === 'next costume' ||
|
} else if (requestedCostume === 'next costume' ||
|
||||||
requestedCostume === 'next backdrop') {
|
requestedCostume === 'next backdrop') {
|
||||||
target.setCostume(target.currentCostume + 1);
|
target.setCostume(target.currentCostume + 1);
|
||||||
|
} else if (requestedCostume === 'random backdrop') {
|
||||||
|
target.setCostume(Math.floor(Math.random() * target.getCostumes().length));
|
||||||
} else {
|
} else {
|
||||||
const forcedNumber = Number(requestedCostume);
|
const forcedNumber = Number(requestedCostume);
|
||||||
if (!isNaN(forcedNumber)) {
|
if (!isNaN(forcedNumber)) {
|
||||||
|
|
Loading…
Reference in a new issue