2013年10月20日 星期日

WEEK07

1.
 請列出你今天三個小時,要完成的事

掉落物品更新 會開始掉落物品

腳色基本移動控制 倒數計時三秒鐘

2. 你在期中作品要做到什麼程度

有背景音樂 限制時間

控制腳色移動範圍 接到的東西會消失 並且發出聲音



3. Why? 你為什麼要做它

基本的接金幣遊戲

因為遊戲的基礎都有了

就能再做其他種的遊戲了

4.
程式碼更新:
int N=4;
float MarioX=150;
float MarioY=700;
float []thingX = new float[4];
float []thingY = new float[4];
float []thingType = new float[4];
PImage imgMoney;
PImage imgMario;
PImage imgDola;
PImage imgChouda;

void setup(){
  size(400,800);
  imgMoney=loadImage("https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7QrpaoSIHQYaGxdmSzdz3JmZiv6i8UHFaZtqqilKDAIhCynO58_nMbT3AiF3QwrSd8fGTB7h-FpNk5tfADmo_YVx56YNjglctM6VUgEnN1WSCmAvZUKzMk7L33X1gL-FaROjWB0s_kys/s320/%E6%99%AE%E6%B4%B1%E8%8C%B6%E7%A3%9A%E7%A6%8F%E5%AD%97%E5%8E%BB%E8%83%8C%E5%9C%96.jpg");
  imgMario=loadImage("http://pic.pimg.tw/aa118123/f44256e2606a66726f18407530485106.png");
  imgDola=loadImage("http://album.udn.com/community/img/PSN_PHOTO/surpanp/f_3296895_1.gif");
  imgChouda=loadImage("http://weakminded.blog.ithome.com.tw/gallery/4945/4945-82745.jpg");
  for(int i=0;i<N;i++){
    newThing(i);
  }
}
int countDown=3*30;
void draw(){
  if(countDown>0){
     background(255,0,0);
     countDown--;
     text("Start: "+countDown/30,150,350);
     return ;
  }
  background(255);
  for(int i=0;i<N;i++){
    if(thingType[i]==1) drawGood(i);
    else if(thingType[i]==2) drawBad(i);
    else if(thingType[i]==3) drawTrash(i);
   thingY[i]+=4;
   if(thingY[i]>800) newThing(i);
  }
  image(imgMario,MarioX,MarioY,100,100);
}
void keyPressed(){
  if(keyCode==RIGHT) MarioX+=10;
  if(keyCode==LEFT) MarioX-=10;
}

void newThing(int i) {
  thingY[i]=-random(200);
  thingX[i]=random(400);
  thingType[i]=int(random(3))+1;
}
void drawGood(int i){
  fill(255,0,0);
  image(imgChouda,thingX[i],thingY[i],100,100);
}
void drawBad(int i){
  fill(0);
  image(imgDola,thingX[i],thingY[i],100,100);
}
void drawTrash(int i){
  fill(#FF6803);
  image(imgMoney ,thingX[i],thingY[i],100,100);
}
5.截圖

沒有留言:

張貼留言