Kwp2 091217

742 views

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
742
On SlideShare
0
From Embeds
0
Number of Embeds
15
Actions
Shares
0
Downloads
10
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Kwp2 091217

    1. 1. float x, y, xSpeed, ySpeed; // void setup(){ size(480,480); frameRate(30); colorMode(HSB,360,100,100,100); noStroke(); fill(180,100,80,80); x = random(width); y = random(height); xSpeed = random(-10,10); ySpeed = random(-10,10); } // void draw(){ background(0); ellipse(x,y,40,40); x += xSpeed; y += ySpeed; if(x > width || x < 0){ xSpeed *= -1; } if(y > height || y < 0){ ySpeed *= -1;
    2. 2. numbers[0] numbers[1] numbers[2] int[] numbers = new int[5]; numbers[3] numbers[4] numbers[5]
    3. 3. int BALL_NUM = 100; float[] x = new float[BALL_NUM]; // float[] y = new float[BALL_NUM]; void draw(){ float[] xSpeed = new float[BALL_NUM]; background(0,0,20); float[] ySpeed = new float[BALL_NUM]; for(int i=0; i<BALL_NUM; i++){ float[] bSize = new float[BALL_NUM]; fill(bColor[i]); color[] bColor = new color[BALL_NUM]; ellipse(x[i],y[i],bSize[i],bSize[i]); x[i] += xSpeed[i]; // y[i] += ySpeed[i]; void setup(){ if(x[i] > width || x[i] < 0){ size(480,480); xSpeed[i] *= -1; smooth(); } frameRate(30); if(y[i] > height || y[i] < 0){ colorMode(HSB,360,100,100,100); ySpeed[i] *= -1; noStroke(); } for(int i=0; i<BALL_NUM; i++){ } x[i] = random(width); } y[i] = random(height); xSpeed[i] = random(-10,10); ySpeed[i] = random(-10,10); bSize[i] = random(20,60); bColor[i] = color(random(200,240),random(80,100),random(80,1 00),70); } }
    4. 4. int BAR_NUM = 100; rect(x[i],0,bWidth[i],height); float[] x = new float[BAR_NUM]; x[i] += xSpeed[i]; float[] xSpeed = new float[BAR_NUM]; if(x[i] > width || x[i] < -bWidth[i]){ float[] bWidth = new float[BAR_NUM]; xSpeed[i] *= -1; color[] bColor = new color[BAR_NUM]; } } // } void setup(){ size(640,240); frameRate(30); smooth(); colorMode(HSB,360,100,100,100); noStroke(); for(int i=0; i<BAR_NUM; i++){ x[i] = random(width); xSpeed[i] = random(-1,1); bWidth[i] = random(2,200); bColor[i] = color(random(360),random(90,100),random(50,100), 20); } } // void draw(){ background(0); for(int i=0; i<BAR_NUM; i++){ fill(bColor[i]);

    ×