Skip to content

Commit f947b8a

Browse files
authored
Wrap pitch in FLX_PITCH flag (#341)
* wrap pitch * wrap pitch
1 parent 7b62dc5 commit f947b8a

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Arcade/FlxInvaders/source/PlayState.hx

+2
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ class PlayState extends FlxState
213213
function stuffHitStuff(Object1:FlxObject, Object2:FlxObject):Void
214214
{
215215
var wallSound:FlxSound = FlxG.sound.play("assets/wall_break.wav");
216+
#if FLX_PITCH
216217
wallSound.pitch = FlxG.random.float(0.9, 1.1);
218+
#end
217219
Object1.kill();
218220
Object2.kill();
219221
}

Arcade/FlxInvaders/source/PlayerShip.hx

+2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ class PlayerShip extends FlxSprite
6565
{
6666
// Play a sound effect when the player shoots with slight random pitch
6767
var shootSound:FlxSound = FlxG.sound.play("assets/player_shoot.wav", 0.5);
68+
#if FLX_PITCH
6869
shootSound.pitch = FlxG.random.float(0.9, 1.1);
70+
#end
6971
// Space bar was pressed! FIRE A BULLET
7072
var playState:PlayState = cast FlxG.state;
7173
var bullet:FlxSprite = playState.playerBullets.recycle();

0 commit comments

Comments
 (0)