2013年10月28日 星期一

WEEK08

遊戲名稱 : Mondo and fiddle!!
組員名稱: 呂東勳   99163161
                  雲品瀚   99163205

新進度:

將人物更新
設定接觸20個完成任務
有開頭畫面與結束畫面
有背景
可以記錄分數

未來進度:

加入音樂
接到的音效



程式碼如下:

int N=4;

float AriX=150;
float AriY=700;
float []thingX = new float[4];
float []thingY = new float[4];
float []thingType = new float[4];
PImage imgMoney;
PImage imgAri;
PImage imgDola;
PImage imgChouda;
PImage imgBack;
PImage imgTemmo;
PImage imgsuc;
int score = 0;
int stage=0;

void setup(){
  size(600,800);

  imgMoney=loadImage("http://ext.pimg.tw/pplanetj/1354368747-3891682287_n.png");
  imgAri=loadImage("http://pic.pimg.tw/pplanetj/1353075166-1361306915_n.png");
  imgDola=loadImage("http://pic.pimg.tw/pplanetj/1354368741-2996714660_t.png");
  imgChouda=loadImage("http://pic.pimg.tw/pplanetj/1353075170-12784274_n.png");
  imgBack=loadImage("http://pic1.kkdoor.net/u/1/42775752_41144.jpg");
  imgTemmo=loadImage("http://i.gbc.tw/gb_img/0/002/420/2420030.jpg");
  imgsuc=loadImage("http://ih3.redbubble.net/image.13391908.4520/sticker,375x360.u1.png");
  //image(imgBack,600,800);
  for(int i=0;i<N;i++){
    newThing(i);
  }
}
int countDown=3*30;
void draw(){
  switch(stage){
    case 0:
  if(countDown>0){
     image(imgTemmo,0,0,600,800) ;
     countDown--;
     textSize(50);
     text("Mondo and Fiddle!!",70,250);
     text("Start: "+countDown/30,250,350);
   
     return ;
  }
  image(imgBack,0,0,600,800);
 
  for(int i=0;i<N;i++){
    if(thingType[i]==1) drawchouda(i);
    else if(thingType[i]==2) drawDola(i);
    else if(thingType[i]==3) drawMoney(i);
   thingY[i]+=4;
   if(thingY[i]>800) newThing(i);
  }
  image(imgAri,AriX,AriY,150,100);
  for (int i = 0; i < 4 ; i++){
   scores(i);
  }
  pushMatrix();
   fill(255,0,0);
  textSize(30);
  text("Score: "+score,50,150);
  popMatrix();
 
  break;
  case 1:
  image(imgsuc,0,0,600,800) ;
 /*   pushMatrix();
   fill(255,0,0);
  textSize(70);
  text("sucessful!!! ",250,350);
  popMatrix();
  */
   break;
  }
}
void keyPressed(){
  if(keyCode==RIGHT) AriX+=50;
  if(keyCode==LEFT) AriX-=50;
}

void newThing(int i) {
  thingY[i]=-random(200);
  thingX[i]=random(520);
  thingType[i]=int(random(3))+1;
}
void drawchouda(int i){
  fill(255,0,0);
  image(imgChouda,thingX[i],thingY[i],100,100);
}
void drawDola(int i){
  fill(0);
  image(imgDola,thingX[i],thingY[i],100,100);
}
void drawMoney(int i){
  fill(#FF6803);
  image(imgMoney ,thingX[i],thingY[i],100,100);
}
void scores(int i){
  if( AriX + 100 >= thingX[i] && thingX[i]+100>=AriX && AriY <= thingY[i]+100){
  newThing(i);
  score++;
  }
  if(score==20)
  stage=1;
}
預覽圖片:


沒有留言:

張貼留言