diff --git a/Scripts/Elements/Element.cs b/Scripts/Elements/Element.cs index bb09478..950036b 100644 --- a/Scripts/Elements/Element.cs +++ b/Scripts/Elements/Element.cs @@ -13,8 +13,8 @@ public class Element{ protected const int MAX_DIFFUSE_SPEED = 100; protected const int STEPS_UNTIL_INACTIVE = 500; - protected const float MAX_COLOR_VARIANCE = 0.1f; protected static readonly Vector2I VERTICAL_OPPOSITE = new Vector2I(-1, 1); + private const float MAX_COLOR_VARIANCE = 0.1f; private bool active = false; private int lastUpdate = -1; @@ -32,7 +32,7 @@ public class Element{ Position.X = x; Position.Y = y; Chunk = chunk; - Active = true; + Active = active; } public bool Active { @@ -79,6 +79,9 @@ public class Element{ protected virtual void Tick() { Vector2I randomDirection = RandomDirectionDown(); + // fall speed reduction: + if (GD.Randi() % MAX_DIFFUSE_SPEED > DiffuseSpeed) return; // descend slower + if (Chunk.IsEmpty(Position + Vector2I.Down)) Chunk.Swap(this, Position + Vector2I.Down);