added color variance

This commit is contained in:
2023-10-17 14:33:21 +02:00
parent 31dbbbf070
commit 43d121d4da
4 changed files with 18 additions and 14 deletions

View File

@@ -7,14 +7,15 @@ public class Element {
public Vector2I Position;
protected Level _level;
protected readonly float MaxColorVariance = 0.1f;
protected readonly Level Level;
private int _lastUpdate = -1;
private int lastUpdate = -1;
public Element(int x, int y, ref Level level) {
Position.X = x;
Position.Y = y;
_level = level;
Level = level;
}
/// <summary>
@@ -23,8 +24,8 @@ public class Element {
/// <param name="currentFrame"></param>
/// <returns>false if there is nothing to do</returns>
public virtual bool Update(int currentFrame) {
if (_lastUpdate == currentFrame) return false; // already updated this frame
_lastUpdate = currentFrame;
if (lastUpdate == currentFrame) return false; // already updated this frame
lastUpdate = currentFrame;
return true;
}