diff --git a/Arcade/FlxInvaders/source/PlayState.hx b/Arcade/FlxInvaders/source/PlayState.hx index 46c17e657..06ac0963b 100644 --- a/Arcade/FlxInvaders/source/PlayState.hx +++ b/Arcade/FlxInvaders/source/PlayState.hx @@ -213,7 +213,9 @@ class PlayState extends FlxState function stuffHitStuff(Object1:FlxObject, Object2:FlxObject):Void { var wallSound:FlxSound = FlxG.sound.play("assets/wall_break.wav"); + #if FLX_PITCH wallSound.pitch = FlxG.random.float(0.9, 1.1); + #end Object1.kill(); Object2.kill(); } diff --git a/Arcade/FlxInvaders/source/PlayerShip.hx b/Arcade/FlxInvaders/source/PlayerShip.hx index cbb04c4f4..9f4953eb1 100644 --- a/Arcade/FlxInvaders/source/PlayerShip.hx +++ b/Arcade/FlxInvaders/source/PlayerShip.hx @@ -65,7 +65,9 @@ class PlayerShip extends FlxSprite { // Play a sound effect when the player shoots with slight random pitch var shootSound:FlxSound = FlxG.sound.play("assets/player_shoot.wav", 0.5); + #if FLX_PITCH shootSound.pitch = FlxG.random.float(0.9, 1.1); + #end // Space bar was pressed! FIRE A BULLET var playState:PlayState = cast FlxG.state; var bullet:FlxSprite = playState.playerBullets.recycle();