Made ultra berries give you +5 score instead of +1
progress ahahaha (making the actual boost is gonna be so fun trust)
This commit is contained in:
1 parent
80646fadbf
commit
b0af899416
1 file changed
+14
-2
+14
-2
@@ -2,10 +2,22 @@ using Godot;
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
public partial class BerryLogic : Node2D {
|
public partial class BerryLogic : Node2D {
|
||||||
|
string BerryType = "";
|
||||||
|
|
||||||
private void _on_hitbox_area_entered(Area2D area) {
|
private void _on_hitbox_area_entered(Area2D area) {
|
||||||
Globals.Score += 1;
|
Texture2D Sprite = GetNode<Sprite2D>("Sprite").Texture;
|
||||||
|
|
||||||
|
string BerryTexturesFolder = "res://Textures/Berries/";
|
||||||
|
if (Sprite == GD.Load(BerryTexturesFolder + "Berry.png")) {
|
||||||
|
BerryType = "normal";
|
||||||
|
} else if (Sprite == GD.Load(BerryTexturesFolder + "UltraBerry.png")) {
|
||||||
|
BerryType = "ultra";
|
||||||
|
}
|
||||||
|
|
||||||
|
int ScoreAdder = (BerryType == "normal") ? 1 : 5;
|
||||||
|
Globals.Score += ScoreAdder;
|
||||||
if (Globals.Score > Globals.HighScore) {
|
if (Globals.Score > Globals.HighScore) {
|
||||||
Globals.HighScore += 1;
|
Globals.HighScore += ScoreAdder;
|
||||||
}
|
}
|
||||||
|
|
||||||
QueueFree();
|
QueueFree();
|
||||||
|
|||||||
Reference in new issue
Block a user