2015年10月19日 星期一

動畫,到數計時

void setup(){
   size(500,500);
}
void draw(){
  background(255);
  for(int i=-1;i<20;i++){
    for(int j=-1;j<20;j++){
      float a=500.0/18.0;
      float r=a*2-10;
      float t=((i+j)*5+frameCount)/13.0;
      noFill();
      ellipse(i*a,j*a,r,r);
      fill(0);
      ellipse(i*a+r*cos(t), j*a+r*sin(t),5,5);
    }
  }}





\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\      倒數計時
int count=200;
void setup(){
  size(500,500);
}
void draw(){
  count--;
  if(count<0)background(255,0,0);
  else background(255);
  fill(255,0,50);text("TIME: "+count, 100,100);
}





game
http://www.geneatcg.com/2014/04/09/processing-101-04-bouncingballgamev01/


沒有留言:

張貼留言