processing
[νλ‘μΈμ± μνλλΉ] μνμ λμ¬λ§ νκ²λ€ μ 리
Meaning_
2022. 6. 12. 21:59
728x90
λ°μν
λΆκ½λμ΄ π
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
void setup(){
size(600,600);
}
void draw(){
background(0);
int n=0;
strokeWeight(3);
while(n<10){
stroke(random(255),random(255),random(255));
line(mouseX,mouseY,random(width),random(height));
n++;
}
}
|
cs |
μΆ©λνλ©΄ μ¬λΌμ Έ~ π¦π¦π¦
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
int []bricks=new int[10];
boolean []alive=new boolean[10];
void setup(){
size(600,600);
for(int i=0;i<bricks.length;i++){
bricks[i]=i*100+50;
alive[i]=true;
}
fill(#FF0000);
noStroke();
}
void draw(){
background(0);
for(int i=0;i<bricks.length;i++){
if(alive[i]){
ellipse(bricks[i],width/2,100,100);
}
}
fill(#FFFF00);
ellipse(mouseX,mouseY,30,30);
fill(#FF0000);
for(int i=0;i<bricks.length;i++){
if(dist(mouseX,mouseY,bricks[i],width/2)<50+15){
alive[i]=false;
}
}
}
|
cs |
ν겨λκ°κΈ°π₯
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | float x,y; float easing=0.1; void setup(){ size(600,600); } void draw(){ background(128); float dx=mouseX-x; x+=dx*easing; float dy=mouseY-y; y+=dy*easing; ellipse(x,y,100,100); } | cs |
728x90
λ°μν