cleanup
This commit is contained in:
@@ -47,15 +47,14 @@ public class Element {
|
|||||||
protected virtual void Tick() {
|
protected virtual void Tick() {
|
||||||
Vector2I randomDirection = RandomDirectionDown();
|
Vector2I randomDirection = RandomDirectionDown();
|
||||||
|
|
||||||
if (Level.IsEmpty(Position + Vector2I.Down)) {
|
if (Level.IsEmpty(Position + Vector2I.Down))
|
||||||
Level.Swap(this, Position + Vector2I.Down);
|
Level.Swap(this, Position + Vector2I.Down);
|
||||||
|
|
||||||
} else if (Level.IsEmpty(Position + randomDirection)) {
|
else if (Level.IsEmpty(Position + randomDirection))
|
||||||
Level.Swap(this, Position + randomDirection);
|
Level.Swap(this, Position + randomDirection);
|
||||||
|
|
||||||
} else if (Level.IsEmpty(Position + randomDirection * VERTICAL_OPPOSITE)) {
|
else if (Level.IsEmpty(Position + randomDirection * VERTICAL_OPPOSITE))
|
||||||
Level.Swap(this, Position + randomDirection * VERTICAL_OPPOSITE);
|
Level.Swap(this, Position + randomDirection * VERTICAL_OPPOSITE);
|
||||||
}
|
|
||||||
|
|
||||||
if (GD.Randi() % MAX_DIFFUSE_SPEED > DiffuseSpeed) return; // ascend slower
|
if (GD.Randi() % MAX_DIFFUSE_SPEED > DiffuseSpeed) return; // ascend slower
|
||||||
|
|
||||||
|
|||||||
@@ -23,15 +23,13 @@ public class Water : Solid {
|
|||||||
if (randomDirection.Y != 0)
|
if (randomDirection.Y != 0)
|
||||||
randomDirection *= Vector2I.Left * (int)(GD.Randi() % MAX_VERTICAL_SPREAD);
|
randomDirection *= Vector2I.Left * (int)(GD.Randi() % MAX_VERTICAL_SPREAD);
|
||||||
|
|
||||||
if (Level.IsEmpty(Position + Vector2I.Down)) {
|
if (Level.IsEmpty(Position + Vector2I.Down))
|
||||||
Level.Swap(this, Position + Vector2I.Down);
|
Level.Swap(this, Position + Vector2I.Down);
|
||||||
|
|
||||||
} else if (Level.IsEmpty(Position + randomDirection)) {
|
else if (Level.IsEmpty(Position + randomDirection))
|
||||||
Level.Swap(this, Position + Vector2I.Right * randomDirection);
|
Level.Swap(this, Position + Vector2I.Right * randomDirection);
|
||||||
|
|
||||||
} else if (Level.IsEmpty(Position + randomDirection)) {
|
else if (Level.IsEmpty(Position + randomDirection))
|
||||||
Level.Swap(this, Position + Vector2I.Right * randomDirection * VERTICAL_OPPOSITE);
|
Level.Swap(this, Position + Vector2I.Right * randomDirection * VERTICAL_OPPOSITE);
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user