Upcoming SlideShare
×

# Proga 0518

1,389 views

Published on

1 Like
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total views
1,389
On SlideShare
0
From Embeds
0
Number of Embeds
228
Actions
Shares
0
11
0
Likes
1
Embeds 0
No embeds

No notes for slide

• ### Proga 0518

1. 1. numbers[0] numbers[1] numbers[2] int[] numbers = new int[5]; numbers[3] numbers[4] numbers[5]
2. 2. int BALL_NUM = 100; // float[] x = new float[BALL_NUM]; void draw(){ float[] y = new float[BALL_NUM]; background(0,0,20); float[] xSpeed = new float[BALL_NUM]; for(int i=0; i<BALL_NUM; i++){ float[] ySpeed = new float[BALL_NUM]; fill(bColor[i]); float[] bSize = new float[BALL_NUM]; ellipse(x[i],y[i],bSize[i],bSize[i]); color[] bColor = new color[BALL_NUM]; x[i] += xSpeed[i]; y[i] += ySpeed[i]; // if(x[i] > width || x[i] < 0){ void setup(){ xSpeed[i] *= -1; size(480,480); } smooth(); if(y[i] > height || y[i] < 0){ frameRate(30); ySpeed[i] *= -1; colorMode(HSB,360,100,100,100); } 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); } }
3. 3. 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]);
4. 4. float x, y, cx, cy; ellipse(x, y, bSize, bSize); float angle, radius, aSpeed, bSize; } // // void setup(){ void drawFade(){ size(480,480); noStroke(); colorMode(HSB, 360,100,100,100); fill(0,0,0,5); background(0); rect(0,0,width,height); noFill(); } frameRate(30); smooth(); cx = width/2; cy = height/2; angle = 0; radius = 160; aSpeed = 2; bSize = 20; } // void draw(){ drawFade(); // x = cx + (radius * sin(radians(angle))); y = cx + (radius * cos(radians(angle))); angle += aSpeed; noFill(); stroke(240,100,100);
5. 5. int NUM = 32; y[i] = cx + (radius * cos(radians(angle[i]))); float cx, cy, radius, maxSpeed, maxSize; angle[i] += thisSpeed; float[] x = new float[NUM]; noFill(); float[] y = new float[NUM]; stroke(240,100,100); float[] angle = new float[NUM]; ellipse(x[i], y[i], thisSize, thisSize); } void setup(){ } size(480,480); colorMode(HSB, 360,100,100,100); void drawFade(){ background(0); noStroke(); noFill(); fill(0,0,0,10); frameRate(30); rect(0,0,width,height); smooth(); } cx = width/2; cy = height/2; radius = 100; maxSpeed = 3; maxSize = 200; for(int i=0; i<NUM; i++){ angle[i] = 0; } } void draw(){ drawFade(); for(int i=0; i<NUM; i++){ float thisSpeed = (maxSpeed / NUM) * i; float thisSize = (maxSize / NUM) * i; x[i] = cx + (radius * sin(radians(angle[i])));
6. 6. int NUM = 256; x[i] = cx + (radius * float cx, cy, radius, maxSpeed, maxSize; sin(radians(angle[i]))); float[] x = new float[NUM]; y[i] = cx + (radius * float[] y = new float[NUM]; cos(radians(angle[i]))); float[] angle = new float[NUM]; angle[i] += thisSpeed; noFill(); void setup(){ stroke(240,100,100,5); size(480,480); ellipse(x[i], y[i], thisSize, thisSize); colorMode(HSB, 360,100,100,100); } background(0); } noFill(); frameRate(30); void drawFade(){ smooth(); noStroke(); cx = width/2; fill(0,0,0,5); cy = height/2; rect(0,0,width,height); radius = 100; } maxSpeed = 1; maxSize = 200; for(int i=0; i<NUM; i++){ angle[i] = 0; } } void draw(){ drawFade(); for(int i=0; i<NUM; i++){ float thisSpeed = (maxSpeed / NUM) * i+ maxSpeed/5; float thisSize = (maxSize / NUM) * i;