

讓黑點繞圓圈

秀出整排
畫圓圈和小黑點建構基本動態圖
製作波浪的基礎圖(SHM)
程式碼:
void setup(){
size(600,600);
}
void draw(){
background(255);
for(int x=0;x<=600;x+=50){
for(int y=0;y<=600;y+=50){
float a=5*(frameCount+x/5+y/5)/180.0*3.1415;
noFill();ellipse(x,y,40,40);
fill(0);ellipse(x+20*cos(a),y+20*sin(a),8,8);
}
}
}
2.聲音

會撥出mp3檔
3.影片

影片設定
播出影片
程式碼:
import processing.sound.*;
import processing.video.*;
SoundFile file;
Movie movie;
void setup(){
size(800,450);
//file=new SoundFile(this,"PPAP.mp3");
//file.play();
movie=new Movie(this,"PPAP.mp4");
movie.play();
}
void draw(){
image(movie,0,0,800,480);
}
void movieEvent(Movie m){
m.read();
}
3.加入互動


按按鍵會跑出筆或蘋果
期末作品:
和林雅雯一組
想做出類似太鼓達人的打擊遊戲
沒有留言:
張貼留言