Behavior · Published v1

SpreadCheese

SpreadCheese from Golden Fondue.

From Golden Fondue · v2. Edit this definition in its source simulation.

Source

behavior SpreadCheese for FondueMatter {
	update {
		let incoming = (neighbors[FondueMatter using VonNeumann, +X].left else 0.0)
			+ (neighbors[FondueMatter using VonNeumann, -X].right else 0.0)
			+ (neighbors[FondueMatter using VonNeumann, +Y].front else 0.0)
			+ (neighbors[FondueMatter using VonNeumann, -Y].back else 0.0);
		set self.mass = clamp(self.mass - self.left - self.right - self.front - self.back + incoming, 0.0, 1.0);
	}
}

Building blocks

These exact versions are included when you reuse this artifact.

PropertyFondueMatter@hyle · v1