31 ตุลาคม 2556

void draw

ฟังก์ชัน draw




void draw() {
  int r = 20;
  if (start==0) {
    background(0);
    start = button("START", start);
    drawBoy(420, 300);
    drawGirl(200, 150);
  }
  if (start==1) {
    if (miss<=4) {
      background(195, 255, 230);
      sceen();
      Life(life, width-100, 25);
      textFont(createFont("Arial", 17));
      fill(0, 0, 255);
      text("score = "+score+"  Life "+life, 30, 30);
      /////////// ตำแหน่ง snoopy
      Snoopy_style();
      /////////// ตำแหน่ง boy
      Boy_style();
    }
    // Boy randomball
    Boy_moveBall(r);
    // girl โต้กลับ
    Girl_moveBall(r);
    //สุ่มตำแน่ง
    random_Ball();  
    // hit Girl
    hit_Girl();
    // เมื่อ miss
    miss(r);
    speed++;
  }
}

ไม่มีความคิดเห็น:

แสดงความคิดเห็น