Understanding element.remove [SOLVED]
in
Contributed Library Questions
•
3 months ago
I am having trouble getting this to work. I want to add drops when an accelerometer is titled and remove drops when it returns to normal. Where am I going wrong? Thanks.
- import maxlink.*;
ArrayList<Rain> drops;
int r = 60;
public float a;
MaxLink link = new MaxLink(this, "bouncer");
void setup()
{
size(600,600);
noStroke();
frameRate(30);
smooth();
drops = new ArrayList<Rain>();
drops.add(new Rain());
link.declareInlet("a");
}
void draw()
{
background(255);
for (int i = drops.size()-1; i >=0; i--){
Rain rain = drops.get(i);
rain.fall();}
if (a > 23.){
drops.add(new Rain());
}
if (a < 23.){
drops.remove(new Rain());
}
}
1