finalized dirt

added base for liquids
This commit is contained in:
2023-10-17 14:29:42 +02:00
parent 9145a6a3f9
commit 31dbbbf070
6 changed files with 113 additions and 29 deletions

View File

@@ -11,10 +11,14 @@ public class Dirt : Solid {
public override bool Update(int currentFrame) {
if (!base.Update(currentFrame)) return false;
if (CheckBelow(X, Y)) {
_level.Swap(this, X, Y+1);
Vector2I freePos = Check(this, Vector2I.Down + Vector2I.Right);
if (freePos != Vector2I.Zero) { // diagonally right
_level.Swap(this, freePos);
return true;
}
return true;
return true; // not necessarily end, subclasses could do some more things
}
}