Extension to a class (GrayScott)
in
Contributed Library Questions
•
2 years ago
Hi all,
I have a question in regards to extending a class, GrayScott in particular.
I want to extend this class and override method getFCoeffAt.
I want to have it respond to the x coordinates instead of just drawing from a universal integer.
How do I do that?
Not very experienced at this, but still wanting to give it a go.
Here's an attempt at trying to extend it.
Many thanks!
- class JoScott extends toxi.sim.grayscott.GrayScott {
int xf = width/2;
int yf = height/2;
//int f= xcoord; - JoScott(int width, int height, boolean wrap) {
super(width, height, wrap);
float xfcof getFCoeffAt( xf, yf) {
return f*xf;
} - float getFOverride(int xf, int yf){
return this.getFCoeffAt(x,y);
}
}
}
1