how can i make this?
in
Programming Questions
•
5 months ago
hi
now i want to put on and off one of this 3
Zyklus by keys
maybe this is a very simple problem.
here is my code:
(i m beginner)
import ddf.minim.*;
int t=43;
int a=200;
int d=2;
Minim minim;
AudioInput input;
void setup () {
size(1280, 800);
minim = new Minim (this);
input = minim.getLineIn (Minim.STEREO, 256);
}
void draw ()
{
noCursor();
noStroke();
fill(0, 15);
rect(0, 0, width, height);
strokeWeight(10);
smooth();
float dim = input.mix.level () * width*2;
// liniendicke weisser kreis
if (keyPressed) {
if (key == 'x')
d+=d;
if (key == 'y')
d-=d ;
if (d <= 1) d = 2;
}
strokeWeight(d);
ellipseMode (CENTER);
stroke(196, 194, 194, 100);
ellipse (650, 300, dim *2.5, dim * 2.5);
//kreis fixpunkt
if (keyPressed) {
if (key == 'b')
t =t+10;
if (t >= 250) t = 250;
if (key == 'n')
t = t - 10;
if (t <= 1) t = 0;
}
strokeWeight(5);
stroke(t, 252, 43);
ellipseMode (CENTER);
ellipse (width/2, height/2, dim, dim);
// kreis mousegesteuert
if (keyPressed) {
if (key == 'c')
a = a + 10;
if (a >= 250) a = 250;
if (key == 'v')
a = a - 10;
if (a <= 1) a = 0;
}
strokeWeight(10);
ellipseMode (CENTER);
stroke(a, 173, 244);
ellipse (mouseX, mouseY, dim *1.5, dim );
}
1