2017年1月5日 星期四

20170105 小楓兒筆記

1. 太鼓達人遊戲的製作
2. Arduino or 視訊 or 音控
3. 介紹3D全息影像投影
4. 介紹zuvio
5. 介紹Arduino

Arduino






單芯線




麵包板





三用電表

 


電烙鐵




熱熔膠

 


喇叭




杜邦線









*太鼓達人實作

下載Arduino
https://www.arduino.cc/en/Main/Donate

開啟檔案管理員
devmgmt

檔案→範例→Digital→toneMelody
左上角打ˇ編譯程式碼
工具→開發板→選使用的開發板




void setup(){
  pinMode(3,INPUT_PULLUP);//pin 3 vs. GND
  Serial.begin(9600);
}
void loop(){
  if(digitalRead(3)==LOW){
    Serial.write("Pin3 touch\n");
  }
}




成品








Processing版





PImage imgBG;
void setup(){
  size(760,430);
  imgBG=loadImage("taiku.png");
}
int cx=700,cy=160;
void draw(){
  background(imgBG);
  fill(255);
  rect(195,102,760-195,229-102);
  fill(251,69,43);
  ellipse(cx,cy,60,60);
  cx-=3;
  if(cx < 25){
    cx=800;
  }
}




計分







PImage imgBG;
void setup(){
  size(760,430);
  imgBG=loadImage("taiku.png");
}
int cx=700,cy=160;
int score=0,heart=10;
void draw(){
  background(imgBG);
  fill(0,0,255);
  textSize(60);
  text("Score:" + score + "Heart:" +heart,100,100);
  rect(195,102,760-195,229-102);
  fill(251,69,43);
  ellipse(cx,cy,60,60);
  cx-=3;
  if(250 < cx && cx < 263 && mousePressed){
    score += 100;
    cx=800;
  }
  if(cx < 250){
    heart--;
    cx=800;
  }
}



沒有留言:

張貼留言