mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 23:12:24 -05:00
cast args to numbers
This commit is contained in:
parent
3344c92f7e
commit
76a475c31c
1 changed files with 8 additions and 3 deletions
|
@ -71,15 +71,20 @@ Scratch3SoundBlocks.prototype.stopAllSounds = function (args, util) {
|
||||||
};
|
};
|
||||||
|
|
||||||
Scratch3SoundBlocks.prototype.playNoteForBeats = function (args, util) {
|
Scratch3SoundBlocks.prototype.playNoteForBeats = function (args, util) {
|
||||||
return util.target.audioPlayer.playNoteForBeats(args.NOTE, args.BEATS);
|
var note = Cast.toNumber(args.NOTE);
|
||||||
|
var beats = Cast.toNumber(args.BEATS);
|
||||||
|
return util.target.audioPlayer.playNoteForBeats(note, beats);
|
||||||
};
|
};
|
||||||
|
|
||||||
Scratch3SoundBlocks.prototype.playDrumForBeats = function (args, util) {
|
Scratch3SoundBlocks.prototype.playDrumForBeats = function (args, util) {
|
||||||
return util.target.audioPlayer.playDrumForBeats(args.DRUM, args.BEATS);
|
var drum = Cast.toNumber(args.DRUMTYPE);
|
||||||
|
var beats = Cast.toNumber(args.BEATS);
|
||||||
|
return util.target.audioPlayer.playDrumForBeats(drum, beats);
|
||||||
};
|
};
|
||||||
|
|
||||||
Scratch3SoundBlocks.prototype.restForBeats = function (args, util) {
|
Scratch3SoundBlocks.prototype.restForBeats = function (args, util) {
|
||||||
return util.target.audioPlayer.waitForBeats(args.BEATS);
|
var beats = Cast.toNumber(args.BEATS);
|
||||||
|
return util.target.audioPlayer.waitForBeats(beats);
|
||||||
};
|
};
|
||||||
|
|
||||||
Scratch3SoundBlocks.prototype.setInstrument = function (args, util) {
|
Scratch3SoundBlocks.prototype.setInstrument = function (args, util) {
|
||||||
|
|
Loading…
Reference in a new issue