Added the ultra berry kinda
it does the exact same thing as the normal berry rn but this is progress
This commit is contained in:
1 parent
9121e18648
commit
03c6381e34
1 file changed
+10
@@ -21,6 +21,16 @@ public partial class Berries : Node2D {
|
|||||||
|
|
||||||
BerryInstance.Position = new Vector2(x: new Random().Next(-(ScreenWidth / 2), ScreenWidth / 2), y: -100 - Position.Y);
|
BerryInstance.Position = new Vector2(x: new Random().Next(-(ScreenWidth / 2), ScreenWidth / 2), y: -100 - Position.Y);
|
||||||
|
|
||||||
|
Sprite2D BerrySprite = BerryInstance.GetNode<Sprite2D>("Sprite");
|
||||||
|
|
||||||
|
int BerryChance = new Random().Next(1, 101);
|
||||||
|
|
||||||
|
if (BerryChance <= 80) {
|
||||||
|
BerrySprite.Texture = (Texture2D)GD.Load("res://Textures/Berries/Berry.png");
|
||||||
|
} else {
|
||||||
|
BerrySprite.Texture = (Texture2D)GD.Load("res://Textures/Berries/UltraBerry.png");
|
||||||
|
}
|
||||||
|
|
||||||
AddChild(BerryInstance);
|
AddChild(BerryInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user