SlideShare una empresa de Scribd logo
1 de 14
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;
numbers[0]


                              numbers[1]


                              numbers[2]
int[] numbers = new int[5];
                              numbers[3]


                              numbers[4]


                              numbers[5]
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);
	   }
}
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]);
Kwp2 091217

Más contenido relacionado

La actualidad más candente

R scatter plots
R scatter plotsR scatter plots
R scatter plotsAbhik Seal
 
Programa expresiones regulares
Programa expresiones regularesPrograma expresiones regulares
Programa expresiones regularesAnel Sosa
 
Gauss in java
Gauss in javaGauss in java
Gauss in javabaxter89
 
PYTHON PROGRAMS FOR BEGINNERS
PYTHON PROGRAMS FOR BEGINNERSPYTHON PROGRAMS FOR BEGINNERS
PYTHON PROGRAMS FOR BEGINNERSJEETPRATAPSINGH
 
Plot3D Package and Example in R.-Data visualizat,on
Plot3D Package and Example in R.-Data visualizat,onPlot3D Package and Example in R.-Data visualizat,on
Plot3D Package and Example in R.-Data visualizat,onDr. Volkan OBAN
 
MIDP: Form Custom and Image Items
MIDP: Form Custom and Image ItemsMIDP: Form Custom and Image Items
MIDP: Form Custom and Image ItemsJussi Pohjolainen
 
Interpolation graph c++
Interpolation graph c++Interpolation graph c++
Interpolation graph c++rpiitcbme
 
ARTDM 170, Week13: Processing
ARTDM 170, Week13: ProcessingARTDM 170, Week13: Processing
ARTDM 170, Week13: ProcessingGilbert Guerrero
 
Presentation: Plotting Systems in R
Presentation: Plotting Systems in RPresentation: Plotting Systems in R
Presentation: Plotting Systems in RIlya Zhbannikov
 
Interactive Mouse (Report On Processing)
Interactive Mouse (Report On Processing)Interactive Mouse (Report On Processing)
Interactive Mouse (Report On Processing)TongXu520
 
Cryptocurrency ecosystem(together society)
Cryptocurrency ecosystem(together society)Cryptocurrency ecosystem(together society)
Cryptocurrency ecosystem(together society)jihong yang
 
Know more processing
Know more processingKnow more processing
Know more processingYukiAizawa1
 
Program to sort the n names in an alphabetical order
Program to sort the n names in an alphabetical orderProgram to sort the n names in an alphabetical order
Program to sort the n names in an alphabetical orderSamsil Arefin
 
Visualising Big Data
Visualising Big DataVisualising Big Data
Visualising Big DataAmit Kapoor
 

La actualidad más candente (17)

R scatter plots
R scatter plotsR scatter plots
R scatter plots
 
Programa expresiones regulares
Programa expresiones regularesPrograma expresiones regulares
Programa expresiones regulares
 
Gauss in java
Gauss in javaGauss in java
Gauss in java
 
Advanced Concepts in Python
Advanced Concepts in PythonAdvanced Concepts in Python
Advanced Concepts in Python
 
PYTHON PROGRAMS FOR BEGINNERS
PYTHON PROGRAMS FOR BEGINNERSPYTHON PROGRAMS FOR BEGINNERS
PYTHON PROGRAMS FOR BEGINNERS
 
Plot3D Package and Example in R.-Data visualizat,on
Plot3D Package and Example in R.-Data visualizat,onPlot3D Package and Example in R.-Data visualizat,on
Plot3D Package and Example in R.-Data visualizat,on
 
Computer graphics
Computer graphics   Computer graphics
Computer graphics
 
MIDP: Form Custom and Image Items
MIDP: Form Custom and Image ItemsMIDP: Form Custom and Image Items
MIDP: Form Custom and Image Items
 
Interpolation graph c++
Interpolation graph c++Interpolation graph c++
Interpolation graph c++
 
R
RR
R
 
ARTDM 170, Week13: Processing
ARTDM 170, Week13: ProcessingARTDM 170, Week13: Processing
ARTDM 170, Week13: Processing
 
Presentation: Plotting Systems in R
Presentation: Plotting Systems in RPresentation: Plotting Systems in R
Presentation: Plotting Systems in R
 
Interactive Mouse (Report On Processing)
Interactive Mouse (Report On Processing)Interactive Mouse (Report On Processing)
Interactive Mouse (Report On Processing)
 
Cryptocurrency ecosystem(together society)
Cryptocurrency ecosystem(together society)Cryptocurrency ecosystem(together society)
Cryptocurrency ecosystem(together society)
 
Know more processing
Know more processingKnow more processing
Know more processing
 
Program to sort the n names in an alphabetical order
Program to sort the n names in an alphabetical orderProgram to sort the n names in an alphabetical order
Program to sort the n names in an alphabetical order
 
Visualising Big Data
Visualising Big DataVisualising Big Data
Visualising Big Data
 

Destacado (9)

Kwp2 100114
Kwp2 100114Kwp2 100114
Kwp2 100114
 
Kwp2 1022
Kwp2 1022Kwp2 1022
Kwp2 1022
 
Kwp2 091210
Kwp2 091210Kwp2 091210
Kwp2 091210
 
Busipro091008
Busipro091008Busipro091008
Busipro091008
 
Sbaw091130
Sbaw091130Sbaw091130
Sbaw091130
 
Kwp2 100121
Kwp2 100121Kwp2 100121
Kwp2 100121
 
Kwp2 091203
Kwp2 091203Kwp2 091203
Kwp2 091203
 
Sbaw091013
Sbaw091013Sbaw091013
Sbaw091013
 
Sbaw091006
Sbaw091006Sbaw091006
Sbaw091006
 

Similar a Kwp2 091217

ARTDM 170, Week 13: Text Elements + Arrays
ARTDM 170, Week 13: Text Elements + ArraysARTDM 170, Week 13: Text Elements + Arrays
ARTDM 170, Week 13: Text Elements + ArraysGilbert Guerrero
 
[3] 프로세싱과 아두이노
[3] 프로세싱과 아두이노[3] 프로세싱과 아두이노
[3] 프로세싱과 아두이노Chiwon Song
 
ARTDM 170, Week10: Arrays + Using Randomization
ARTDM 170, Week10: Arrays + Using RandomizationARTDM 170, Week10: Arrays + Using Randomization
ARTDM 170, Week10: Arrays + Using RandomizationGilbert Guerrero
 
Artdm170 Week10 Arrays Math
Artdm170 Week10 Arrays MathArtdm170 Week10 Arrays Math
Artdm170 Week10 Arrays MathGilbert Guerrero
 
#include stdio.h #include string.h #include stdlib.h #in.pdf
#include stdio.h #include string.h #include stdlib.h #in.pdf#include stdio.h #include string.h #include stdlib.h #in.pdf
#include stdio.h #include string.h #include stdlib.h #in.pdfsinghanubhav1234
 
Exploring Canvas
Exploring CanvasExploring Canvas
Exploring CanvasKevin Hoyt
 

Similar a Kwp2 091217 (11)

ARTDM 170, Week 13: Text Elements + Arrays
ARTDM 170, Week 13: Text Elements + ArraysARTDM 170, Week 13: Text Elements + Arrays
ARTDM 170, Week 13: Text Elements + Arrays
 
[3] 프로세싱과 아두이노
[3] 프로세싱과 아두이노[3] 프로세싱과 아두이노
[3] 프로세싱과 아두이노
 
Proga 0706
Proga 0706Proga 0706
Proga 0706
 
ARTDM 170, Week10: Arrays + Using Randomization
ARTDM 170, Week10: Arrays + Using RandomizationARTDM 170, Week10: Arrays + Using Randomization
ARTDM 170, Week10: Arrays + Using Randomization
 
Artdm170 Week10 Arrays Math
Artdm170 Week10 Arrays MathArtdm170 Week10 Arrays Math
Artdm170 Week10 Arrays Math
 
Proga 0622
Proga 0622Proga 0622
Proga 0622
 
graphics Assidnment
graphics Assidnmentgraphics Assidnment
graphics Assidnment
 
Include
IncludeInclude
Include
 
#include stdio.h #include string.h #include stdlib.h #in.pdf
#include stdio.h #include string.h #include stdlib.h #in.pdf#include stdio.h #include string.h #include stdlib.h #in.pdf
#include stdio.h #include string.h #include stdlib.h #in.pdf
 
Kwp2 100107
Kwp2 100107Kwp2 100107
Kwp2 100107
 
Exploring Canvas
Exploring CanvasExploring Canvas
Exploring Canvas
 

Más de Atsushi Tadokoro

「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望Atsushi Tadokoro
 
プログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめようプログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめようAtsushi Tadokoro
 
Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2Atsushi Tadokoro
 
coma Creators session vol.2
coma Creators session vol.2coma Creators session vol.2
coma Creators session vol.2Atsushi Tadokoro
 
Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1Atsushi Tadokoro
 
Interactive Music II Processingによるアニメーション
Interactive Music II ProcessingによるアニメーションInteractive Music II Processingによるアニメーション
Interactive Music II ProcessingによるアニメーションAtsushi Tadokoro
 
Interactive Music II Processing基本
Interactive Music II Processing基本Interactive Music II Processing基本
Interactive Music II Processing基本Atsushi Tadokoro
 
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携Atsushi Tadokoro
 
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス Atsushi Tadokoro
 
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)Atsushi Tadokoro
 
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描くiTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描くAtsushi Tadokoro
 
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリメディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリAtsushi Tadokoro
 
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web)  第8回: CSSフレームワークを使う芸術情報演習デザイン(Web)  第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使うAtsushi Tadokoro
 
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2Atsushi Tadokoro
 
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得Atsushi Tadokoro
 
Webデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3DプログラミングWebデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3DプログラミングAtsushi Tadokoro
 
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1Atsushi Tadokoro
 
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画するiTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画するAtsushi Tadokoro
 
Media Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替えMedia Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替えAtsushi Tadokoro
 

Más de Atsushi Tadokoro (20)

「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
 
プログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめようプログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめよう
 
Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2
 
coma Creators session vol.2
coma Creators session vol.2coma Creators session vol.2
coma Creators session vol.2
 
Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1
 
Interactive Music II Processingによるアニメーション
Interactive Music II ProcessingによるアニメーションInteractive Music II Processingによるアニメーション
Interactive Music II Processingによるアニメーション
 
Interactive Music II Processing基本
Interactive Music II Processing基本Interactive Music II Processing基本
Interactive Music II Processing基本
 
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
 
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
 
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
 
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描くiTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
 
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリメディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
 
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web)  第8回: CSSフレームワークを使う芸術情報演習デザイン(Web)  第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使う
 
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
 
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
 
Tamabi media131118
Tamabi media131118Tamabi media131118
Tamabi media131118
 
Webデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3DプログラミングWebデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
 
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
 
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画するiTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
 
Media Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替えMedia Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替え
 

Kwp2 091217

  • 1.
  • 2.
  • 3.
  • 4. 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;
  • 5.
  • 6. numbers[0] numbers[1] numbers[2] int[] numbers = new int[5]; numbers[3] numbers[4] numbers[5]
  • 7.
  • 8.
  • 9.
  • 10. 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); } }
  • 11.
  • 12.
  • 13. 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]);