2019年10月17日 星期四

week_06

今天學的是聲音~~

嘎 嘎嘎嘎嘎


速寫本 → 添加庫文件 → 下載Sound










氣球程式碼

PImage imgBalloon;
float []balloonX = new float[200];
float []balloonY = new float[200];
float []balloonsize = new float[200];
int nowN=0;
void setup(){
  size(500,400);
  imgBalloon = loadImage("balloon,png");
}
void draw(){
  background(255);
  for(int i=0;i<nowN;i++){
    image(imgBalloon,balloonX[i],balloonY[i],balloonsize[i],balloonsize[i]/2*3);
    if(mousePressed) println("mousePressed in draw()");
    if(balloonY[i]>0) balloonY[i]--;
  }
  if(mousePressed) setBalloon(balloonsize[nowN-1]*1.01, nowN-1);
}
void setBalloon(float size, int i){
  balloonsize[i]=size;
  balloonX[i]= mouseX-balloonsize[i]/2;
  balloonY[i]= mouseY-balloonsize[i]/2*3;
}

void mousePressed(){
  setBalloon(10,nowN);
  nowN++;
}

沒有留言:

張貼留言

alanhc 互動技術-week17 [final]

回顧這學期的作品:  期中作業:LANDING:PLANET 賣點&特點: 炫麗的特效 物理(星球重力及降落)及粒子系統(噴射) 世界地圖可根據視角縮放 困難點: 重寫3次最終改寫成物件導向的CLASS寫法...