Made the slow berry work
All of the berries work now which is nice. I need to add jumping tho and that sounds annoying.
This commit is contained in:
1 parent
388c838d25
commit
870ede5eab
3 files changed
+13
-1
No files matched your search
@@ -29,6 +29,14 @@ public partial class BerryLogic : Node2D {
|
|||||||
if (BerryType == "poison") {
|
if (BerryType == "poison") {
|
||||||
Globals.EffectTimer = 0f;
|
Globals.EffectTimer = 0f;
|
||||||
Globals.Score = 0;
|
Globals.Score = 0;
|
||||||
|
} else if (BerryType == "slow") {
|
||||||
|
if (Globals.ActiveEffect == "slow") {
|
||||||
|
Globals.EffectTimer += 10f;
|
||||||
|
} else {
|
||||||
|
Globals.EffectTimer = 10f;
|
||||||
|
}
|
||||||
|
|
||||||
|
Globals.ActiveEffect = "slow";
|
||||||
} else if (BerryType == "ultra") {
|
} else if (BerryType == "ultra") {
|
||||||
if (Globals.ActiveEffect == "ultra") {
|
if (Globals.ActiveEffect == "ultra") {
|
||||||
Globals.EffectTimer += 10f;
|
Globals.EffectTimer += 10f;
|
||||||
|
|||||||
+3
-1
@@ -41,8 +41,10 @@ public partial class Player : Node2D {
|
|||||||
|
|
||||||
if (Globals.ActiveEffect == "none") {
|
if (Globals.ActiveEffect == "none") {
|
||||||
Globals.MovementSpeed = Globals.DefaultMovementSpeed;
|
Globals.MovementSpeed = Globals.DefaultMovementSpeed;
|
||||||
} if (Globals.ActiveEffect == "ultra") {
|
} else if (Globals.ActiveEffect == "ultra") {
|
||||||
Globals.MovementSpeed = Globals.DefaultMovementSpeed * 2f;
|
Globals.MovementSpeed = Globals.DefaultMovementSpeed * 2f;
|
||||||
|
} else if (Globals.ActiveEffect == "slow") {
|
||||||
|
Globals.MovementSpeed = Globals.DefaultMovementSpeed / 2f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,8 @@ public partial class ScoreText : Control {
|
|||||||
string EffectTimerType = "";
|
string EffectTimerType = "";
|
||||||
if (Globals.ActiveEffect == "ultra") {
|
if (Globals.ActiveEffect == "ultra") {
|
||||||
EffectTimerType = "Boost";
|
EffectTimerType = "Boost";
|
||||||
|
} else if (Globals.ActiveEffect == "slow") {
|
||||||
|
EffectTimerType = "Slowness";
|
||||||
}
|
}
|
||||||
EffectTimerText.Text = EffectTimerType + " " + "expires in: " + Math.Floor(Globals.EffectTimer * 10) / 10 + "s";
|
EffectTimerText.Text = EffectTimerType + " " + "expires in: " + Math.Floor(Globals.EffectTimer * 10) / 10 + "s";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user