Added the poison berry and the slow berry
I know these werent in 1.0.2 but I think the game would just be more fun if these were in the game. Also they don't do anything yet but I will add logic for them soon.
This commit is contained in:
1 parent
213dd83e24
commit
fdbbecc83a
6 files changed
+92
-2
No files matched your search
+5
-1
@@ -25,8 +25,12 @@ public partial class Berries : Node2D {
|
||||
|
||||
int BerryChance = new Random().Next(1, 101);
|
||||
|
||||
if (BerryChance <= 80) {
|
||||
if (BerryChance <= 60) {
|
||||
BerrySprite.Texture = (Texture2D)GD.Load("res://Textures/Berries/Berry.png");
|
||||
} else if (BerryChance <= 80) {
|
||||
BerrySprite.Texture = (Texture2D)GD.Load("res://Textures/Berries/PoisonBerry.png");
|
||||
} else if (BerryChance <= 90) {
|
||||
BerrySprite.Texture = (Texture2D)GD.Load("res://Textures/Berries/SlowBerry.png");
|
||||
} else {
|
||||
BerrySprite.Texture = (Texture2D)GD.Load("res://Textures/Berries/UltraBerry.png");
|
||||
}
|
||||
|
||||
@@ -12,9 +12,15 @@ public partial class BerryLogic : Node2D {
|
||||
BerryType = "normal";
|
||||
} else if (Sprite == GD.Load(BerryTexturesFolder + "UltraBerry.png")) {
|
||||
BerryType = "ultra";
|
||||
} else if (Sprite == GD.Load(BerryTexturesFolder + "PoisonBerry.png")) {
|
||||
BerryType = "poison";
|
||||
} else if (Sprite == GD.Load(BerryTexturesFolder + "SlowBerry.png")) {
|
||||
BerryType = "slow";
|
||||
}
|
||||
|
||||
int ScoreAdder = (BerryType == "normal") ? 1 : 5;
|
||||
int ScoreAdder = (BerryType == "normal") ? 1 :
|
||||
(BerryType == "poison" || BerryType == "slow") ? 0 : 5;
|
||||
|
||||
Globals.Score += ScoreAdder;
|
||||
if (Globals.Score > Globals.HighScore) {
|
||||
Globals.HighScore += ScoreAdder;
|
||||
|
||||
Reference in new issue
Block a user