move playsound function to target
This commit is contained in:
1 parent
d5e0d433aa
commit
4e57ab561d
2 files changed
+5
-2
No files matched your search
@@ -39,12 +39,12 @@ Scratch3SoundBlocks.prototype.getPrimitives = function () {
|
||||
|
||||
Scratch3SoundBlocks.prototype.playSound = function (args, util) {
|
||||
var index = this._getSoundIndex(args.SOUND_MENU, util);
|
||||
util.target.audioPlayer.playSound(index);
|
||||
util.target.playSound(index);
|
||||
};
|
||||
|
||||
Scratch3SoundBlocks.prototype.playSoundAndWait = function (args, util) {
|
||||
var index = this._getSoundIndex(args.SOUND_MENU, util);
|
||||
return util.target.audioPlayer.playSound(index);
|
||||
return util.target.playSound(index);
|
||||
};
|
||||
|
||||
Scratch3SoundBlocks.prototype._getSoundIndex = function (soundName, util) {
|
||||
|
||||
@@ -465,6 +465,9 @@ RenderedTarget.prototype.updateAllDrawableProperties = function () {
|
||||
this.runtime.spriteInfoReport(this);
|
||||
};
|
||||
|
||||
RenderedTarget.prototype.playSound = function (index) {
|
||||
return this.audioPlayer.playSound(this.sprite.sounds[index].md5);
|
||||
};
|
||||
/**
|
||||
* Return the human-readable name for this rendered target, e.g., the sprite's name.
|
||||
* @override
|
||||
|
||||
Reference in new issue
Block a user