imrpvoed water behavior
This commit is contained in:
@@ -158,9 +158,6 @@ public class Chunk {
|
||||
swapTo.Moved();
|
||||
if (swapTo.IsEmpty())
|
||||
swapTo.ActivateNeighbors();
|
||||
|
||||
// TODO:
|
||||
// if either "what" or "swapTo" is empty, re-activate all neighbors of the now empty ones
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
|
||||
@@ -29,10 +29,10 @@ public abstract class Liquid : Element {
|
||||
else if (Chunk.IsEmpty(Position + randomDirection * VERTICAL_OPPOSITE))
|
||||
Chunk.Swap(this, Position + randomDirection * VERTICAL_OPPOSITE);
|
||||
|
||||
else if (Chunk.IsEmpty(Position + randomDirection))
|
||||
Chunk.Swap(this, Position + Vector2I.Right + randomDirection);
|
||||
else if (Chunk.IsEmpty(Position - randomDirection))
|
||||
Chunk.Swap(this, Position + Vector2I.Right + randomDirection * VERTICAL_OPPOSITE);
|
||||
else if (Chunk.IsEmpty(Position + 2 * randomDirection))
|
||||
Chunk.Swap(this, Position + 2 * randomDirection);
|
||||
else if (Chunk.IsEmpty(Position - 2 * randomDirection * VERTICAL_OPPOSITE))
|
||||
Chunk.Swap(this, Position - 2 * randomDirection * VERTICAL_OPPOSITE);
|
||||
}
|
||||
|
||||
public override void ActivateNeighbors() {
|
||||
|
||||
Reference in New Issue
Block a user