X-Git-Url: https://git.yukkurigames.com/?p=pwl6.git;a=blobdiff_plain;f=src%2Fyuu%2Fdirector.js;h=7660b26a3ec3e95edacfa7213a394b06382fbb02;hp=051eb539855d01da348b9b63f324cf8a2acb2427;hb=f7850752cb4d643d906f4723008b507961b434ca;hpb=4f825dcb19e107ac82a76f52759c23533ed9936b diff --git a/src/yuu/director.js b/src/yuu/director.js index 051eb53..7660b26 100644 --- a/src/yuu/director.js +++ b/src/yuu/director.js @@ -1,7 +1,7 @@ /* Copyright 2014 Yukkuri Games Licensed under the terms of the GNU GPL v2 or later - @license http://www.gnu.org/licenses/gpl-2.0.html - @source: http://yukkurigames.com/yuu/ + @license https://www.gnu.org/licenses/gpl-2.0.html + @source: https://yukkurigames.com/yuu/ */ (function (yuu) { @@ -140,7 +140,7 @@ // Aside from the performance considerations, deferring // resizing by multiple frames fixes mis-sizing during startup - // and fullscreen transition in node-webkit on Windows. (And + // and fullscreen transition in NW.js on Windows. (And // probably similar bugs in other configurations.) _doresize: yf.debounce(function () { this._resized = true; @@ -305,7 +305,7 @@ return; this._tickCount = 0; this._timerStart = 0; - // GNU/Linux with node-webkit sizes things incorrectly on + // GNU/Linux with NW.js sizes things incorrectly on // startup, so force a recalculating as soon as the render // loop runs. this._resized = true; @@ -686,6 +686,14 @@ var director = yuu.director = new yuu.Director(); /** The standard director */ + if (yuu.audio) { + yuu.Animation.registerOperation(function playSound (sound) { + if (Array.isArray(sound)) + sound = yuu.random.choice(sound); + (new yuu.Instrument(sound)).play(); + }); + } + yuu.registerInitHook(function () { return yuu.ready(director._scenes); });