Skip to content

Instantly share code, notes, and snippets.

@RemyPorter
Created April 21, 2020 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RemyPorter/71d5abf49443fa0728bff3eadbe23f82 to your computer and use it in GitHub Desktop.
Save RemyPorter/71d5abf49443fa0728bff3eadbe23f82 to your computer and use it in GitHub Desktop.
Just an interesting rule config for VisualPhaser
sim = builder(15, 3.3, 1)
.rule(new RuleStep() {
public float f(float x, float y, PhaseField field) {
return (x * 1.6 - y * 0.9) * sin(field.dc(x, y)/(width+height)*8*PI) * 0.01 + PI;
}
}, 1)
.rule(new RuleStep() {
public float f(float x, float y, PhaseField field) {
return pow(x*x+y*y, 0.5);
}
}, 0.05)
.useColor(#FFFFFF, #E0E0E0)
//.sinWeight(0.25)
.build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment