Added the speedy berry
yes ik I have only added stuff from the original bd so far but at some point I do I want to add some original stuff
This commit is contained in:
1 parent
e42d348986
commit
4593f4f122
9 files changed
+92
-6
No files matched your search
+16
-1
@@ -16,10 +16,13 @@ public partial class BerryLogic : Node2D {
|
||||
BerryType = "poison";
|
||||
} else if (Sprite == GD.Load(BerryTexturesFolder + "SlowBerry.png")) {
|
||||
BerryType = "slow";
|
||||
} else if (Sprite == GD.Load(BerryTexturesFolder + "SpeedyBerry.png")) {
|
||||
BerryType = "speedy";
|
||||
}
|
||||
|
||||
int ScoreAdder = (BerryType == "normal") ? 1 :
|
||||
(BerryType == "poison" || BerryType == "slow") ? 0 : 5;
|
||||
(BerryType == "poison" || BerryType == "slow") ? 0 :
|
||||
(BerryType == "speedy") ? 10 : 0;
|
||||
|
||||
Globals.Score += ScoreAdder;
|
||||
if (Globals.Score > Globals.HighScore) {
|
||||
@@ -64,6 +67,18 @@ public partial class BerryLogic : Node2D {
|
||||
BerrySoundPlayer.Stream = (AudioStream)GD.Load("res://Audio/SFX/Powerup.mp3");
|
||||
BerrySoundPlayer.VolumeDb = Globals.SoundEffectVolume * 0.005f;
|
||||
BerrySoundPlayer.Play();
|
||||
} else if (BerryType == "speedy") {
|
||||
if (Globals.ActiveEffect == "speedy") {
|
||||
Globals.EffectTimer += 10f;
|
||||
} else {
|
||||
Globals.EffectTimer = 10f;
|
||||
}
|
||||
|
||||
Globals.ActiveEffect = "speedy";
|
||||
|
||||
BerrySoundPlayer.Stream = (AudioStream)GD.Load("res://Audio/SFX/SpeedyPowerup.mp3");
|
||||
BerrySoundPlayer.VolumeDb = Globals.SoundEffectVolume * 0.005f;
|
||||
BerrySoundPlayer.Play();
|
||||
}
|
||||
|
||||
QueueFree();
|
||||
|
||||
Reference in new issue
Block a user