2018年10月25日 星期四

week07


int life=10;
boolean gameover=false;
void setup(){
  size(500,500);
}
void draw(){
  background(0,0,205);
  fill(255);rect(50,50,life*10,20);
  if(gameover){
    textSize(40);
    text("GameOver",150,150);
  }
}
void mousePressed(){
  life--;
  if(life<=0) gameover=true;
}

沒有留言:

張貼留言