added second element type: snow

added simple snow weather
This commit is contained in:
2023-10-17 15:11:07 +02:00
parent 43d121d4da
commit 7670b2982a
8 changed files with 67 additions and 15 deletions

View File

@@ -12,7 +12,7 @@ public class Element {
private int lastUpdate = -1;
public Element(int x, int y, ref Level level) {
public Element(int x, int y, Level level) {
Position.X = x;
Position.Y = y;
Level = level;
@@ -52,4 +52,14 @@ public class Element {
/// <returns>free position or V2.zero if nothing was found</returns>
protected virtual Vector2I Check(Element source, Vector2I maxDirection) {
return Vector2I.Zero;
}}
}
protected Color AddColorVariance(Color baseColor) {
Color c = baseColor;
c.R += (GD.Randf() - 1) * MaxColorVariance;
c.G += (GD.Randf() - 1) * MaxColorVariance;
c.B += (GD.Randf() - 1) * MaxColorVariance;
return c;
}
}