forked from Puppet/berry-dash-godot-remake
Fixed some berries being too loud
This commit is contained in:
1 parent
0fb849e878
commit
d2607bf99a
1 file changed
+9
-8
@@ -4,9 +4,10 @@ public partial class BerryLogic : Node2D {
|
|||||||
string BerryType = "";
|
string BerryType = "";
|
||||||
|
|
||||||
void PlaySound(string path, float volume) {
|
void PlaySound(string path, float volume) {
|
||||||
var player = new AudioStreamPlayer();
|
var player = new AudioStreamPlayer {
|
||||||
player.Stream = (AudioStream)GD.Load(path);
|
Stream = (AudioStream)GD.Load(path),
|
||||||
player.VolumeDb = Globals.SoundEffectVolume * (volume / 1000);
|
VolumeDb = Globals.SoundEffectVolume * volume
|
||||||
|
};
|
||||||
GetNode<Node2D>("/root/Game").AddChild(player);
|
GetNode<Node2D>("/root/Game").AddChild(player);
|
||||||
player.Play();
|
player.Play();
|
||||||
|
|
||||||
@@ -39,14 +40,14 @@ public partial class BerryLogic : Node2D {
|
|||||||
Globals.Score += ScoreAdder;
|
Globals.Score += ScoreAdder;
|
||||||
|
|
||||||
if (BerryType == "normal") {
|
if (BerryType == "normal") {
|
||||||
PlaySound("res://Audio/SFX/Eat.mp3", 80f);
|
PlaySound("res://Audio/SFX/Eat.mp3", 0.05f);
|
||||||
} else if (BerryType == "poison") {
|
} else if (BerryType == "poison") {
|
||||||
Globals.EffectTimer = 0f;
|
Globals.EffectTimer = 0f;
|
||||||
Globals.Score = 0;
|
Globals.Score = 0;
|
||||||
|
|
||||||
BazookaManager.Write(BazookaManager.HighScore, Globals.HighScore.ToString());
|
BazookaManager.Write(BazookaManager.HighScore, Globals.HighScore.ToString());
|
||||||
|
|
||||||
PlaySound("res://Audio/SFX/Death.mp3", 20f);
|
PlaySound("res://Audio/SFX/Death.mp3", 0.05f);
|
||||||
} else if (BerryType == "slow") {
|
} else if (BerryType == "slow") {
|
||||||
if (Globals.ActiveEffect == "slow") {
|
if (Globals.ActiveEffect == "slow") {
|
||||||
Globals.EffectTimer += 10f;
|
Globals.EffectTimer += 10f;
|
||||||
@@ -56,7 +57,7 @@ public partial class BerryLogic : Node2D {
|
|||||||
|
|
||||||
Globals.ActiveEffect = "slow";
|
Globals.ActiveEffect = "slow";
|
||||||
|
|
||||||
PlaySound("res://Audio/SFX/Downgrade.mp3", 5f);
|
PlaySound("res://Audio/SFX/Downgrade.mp3", -0.05f);
|
||||||
} else if (BerryType == "ultra") {
|
} else if (BerryType == "ultra") {
|
||||||
if (Globals.ActiveEffect == "ultra") {
|
if (Globals.ActiveEffect == "ultra") {
|
||||||
Globals.EffectTimer += 10f;
|
Globals.EffectTimer += 10f;
|
||||||
@@ -66,7 +67,7 @@ public partial class BerryLogic : Node2D {
|
|||||||
|
|
||||||
Globals.ActiveEffect = "ultra";
|
Globals.ActiveEffect = "ultra";
|
||||||
|
|
||||||
PlaySound("res://Audio/SFX/Powerup.mp3", 5f);
|
PlaySound("res://Audio/SFX/Powerup.mp3", -0.05f);
|
||||||
} else if (BerryType == "speedy") {
|
} else if (BerryType == "speedy") {
|
||||||
if (Globals.ActiveEffect == "speedy") {
|
if (Globals.ActiveEffect == "speedy") {
|
||||||
Globals.EffectTimer += 10f;
|
Globals.EffectTimer += 10f;
|
||||||
@@ -76,7 +77,7 @@ public partial class BerryLogic : Node2D {
|
|||||||
|
|
||||||
Globals.ActiveEffect = "speedy";
|
Globals.ActiveEffect = "speedy";
|
||||||
|
|
||||||
PlaySound("res://Audio/SFX/SpeedyPowerup.mp3", 5f);
|
PlaySound("res://Audio/SFX/SpeedyPowerup.mp3", -0.05f);
|
||||||
}
|
}
|
||||||
|
|
||||||
QueueFree();
|
QueueFree();
|
||||||
|
|||||||
Reference in new issue
Block a user