Skip to content

Commit

Permalink
wrap pitch
Browse files Browse the repository at this point in the history
  • Loading branch information
Geokureli authored Apr 5, 2024
1 parent 7b62dc5 commit 6f0c147
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Arcade/FlxInvaders/source/PlayerShip.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 6f0c147

Please sign in to comment.