Fix loopSound
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# @install: lix --silent download "gh://github.com/kiss-lang/hollywoo#847f2aea739488f5686e33394e649c6e44e44d8b" into hollywoo/0.0.0/github/847f2aea739488f5686e33394e649c6e44e44d8b
|
||||
# @run: haxelib run-dir hollywoo "${HAXE_LIBCACHE}/hollywoo/0.0.0/github/847f2aea739488f5686e33394e649c6e44e44d8b"
|
||||
# @install: lix --silent download "gh://github.com/kiss-lang/hollywoo#9efdacd6d9a1985ba764a2a9477bbefe8b701d2b" into hollywoo/0.0.0/github/9efdacd6d9a1985ba764a2a9477bbefe8b701d2b
|
||||
# @run: haxelib run-dir hollywoo "${HAXE_LIBCACHE}/hollywoo/0.0.0/github/9efdacd6d9a1985ba764a2a9477bbefe8b701d2b"
|
||||
-lib kiss
|
||||
-lib kiss-tools
|
||||
-cp ${HAXE_LIBCACHE}/hollywoo/0.0.0/github/847f2aea739488f5686e33394e649c6e44e44d8b/src/
|
||||
-cp ${HAXE_LIBCACHE}/hollywoo/0.0.0/github/9efdacd6d9a1985ba764a2a9477bbefe8b701d2b/src/
|
||||
-D hollywoo=0.0.0
|
@@ -43,6 +43,7 @@ import openfl.geom.Point;
|
||||
import flixel.input.mouse.FlxMouseButton;
|
||||
import flixel.input.mouse.FlxMouseEventManager;
|
||||
import flixel.input.gamepad.*;
|
||||
import hollywoo_flixel.HFlxSound;
|
||||
|
||||
@:build(kiss.Kiss.build())
|
||||
class FlxDirector implements Director<FlxSprite, ActorFlxSprite, FlxSound, FlxSound, FlxSprite, FlxSound, FlxCamera, FlxLightSource> {
|
||||
|
23
src/hollywoo_flixel/HFlxSound.hx
Normal file
23
src/hollywoo_flixel/HFlxSound.hx
Normal file
@@ -0,0 +1,23 @@
|
||||
package hollywoo_flixel;
|
||||
|
||||
import flixel.sound.FlxSound;
|
||||
|
||||
class HFlxSound extends FlxSound {
|
||||
public function new() {
|
||||
super();
|
||||
}
|
||||
|
||||
// To accomodate hollywoo's sound looping, onComplete() needs to come AFTER cleanup():
|
||||
override function stopped(?_) {
|
||||
if (looped)
|
||||
{
|
||||
cleanup(false);
|
||||
play(false, loopTime, endTime);
|
||||
}
|
||||
else
|
||||
cleanup(autoDestroy);
|
||||
|
||||
if (onComplete != null)
|
||||
onComplete();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user