added simple sleep state for elements
refactoring
This commit is contained in:
@@ -5,4 +5,12 @@ namespace FOU.Scripts.Elements;
|
||||
public abstract class Solid : Element {
|
||||
protected Solid(int x, int y, ref Level level) : base(x, y, level) { }
|
||||
|
||||
public override bool Update(int currentFrame) {
|
||||
if (!base.Update(currentFrame)) return false;
|
||||
if (LastMove + STEPS_UNTIL_INACTIVE < currentFrame) Active = false;
|
||||
|
||||
Tick();
|
||||
|
||||
return true; // not necessarily end, subclasses could do some more things
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user