2021年12月13日 星期一

我出一百萬👀

 Week14 ----期末作品初步_____123木頭人👈

今日進度:





///一二三木頭人, 3D

void setup(){

  size(1600,400,P3D);//OpenGL

  noStroke();

  genRandomTime();

}

void genRandomTime(){

  time = millis()+random(3000,5000);

}

float time=0;

float angle=-90;

float speed=3;

void draw(){

  background(#FFD436);

  if(time < millis() ){//animation鬼要動了!!!

    //ghostMoving=true;

    angle+=speed;

    if(angle>=90){//鬼在看你

      angle=90;

      time = millis()+3000;//rest

      speed = -speed;

    }else if(angle<-90){

      angle=-90;

      genRandomTime();

      speed=3;

    }

  }

  ghost(angle);//鬼要看的角度:-90背對沒看,90看到你 

}

void ghost(float angle){

  fill(237,137,63);

  rect(100,200,100,100);//上半身

  fill(220,210,150);

  rect(153,300,25,50);//腿

  fill(243,249,230);

  rect(152,330,27,50);//襪子

  fill(0);

  rect(150,370,30,20);//鞋子

  fill(220,210,150);

  rect(120,300,25,50);//腿

  fill(243,249,230);

  rect(118,330,27,50);//襪子

  fill(0);

  rect(116,370,30,20);//鞋子

  pushMatrix();

    lights(); ortho();

    translate(150,150);//把整個會轉的頭,移到身體上

    rotateY(radians(angle));

    fill(190,162,95);//head

    sphere(50);//大頭

    pushMatrix();

      translate(40,-10,50);

      fill(0); sphere(10);//黑色的右眼👀

    popMatrix();

    pushMatrix();

      translate(-40,-10,50);

      fill(0); sphere(10);//黑色的左眼👀

      popMatrix();  

  popMatrix();

}


改背景🌆












///一二三木頭人, 3D

PImage img;

void setup(){

  img = loadImage("1.jpeg");

  //background(img);

  size(700,415,P3D);//OpenGL

  noStroke();

  genRandomTime();

}

void genRandomTime(){

  time = millis()+random(3000,5000);

}

float time=0;

float angle=-90;

float speed=3;

void draw(){

  background(img);

  if(time < millis() ){//animation鬼要動了!!!

    //ghostMoving=true;

    angle+=speed;

    if(angle>=90){//鬼在看你

      angle=90;

      time = millis()+3000;//rest

      speed = -speed;

    }else if(angle<-90){

      angle=-90;

      genRandomTime();

      speed=3;

    }

  }

  ghost(angle);//鬼要看的角度:-90背對沒看,90看到你 

}

void ghost(float angle){

  fill(237,137,63);

  rect(100,200,100,100);//吊帶褲

  fill(252,254,4);

  rect(100,200,100,30);//衣服

  fill(237,137,63);

  rect(120,200,20,30);//吊帶

  fill(220,210,150);

  rect(150,220,20,50);//手

  fill(220,210,150);

  rect(153,300,25,50);//左腿

  fill(243,249,230);

  rect(152,330,27,50);//襪子

  fill(0);

  rect(150,370,30,20);//鞋子

  fill(220,210,150);

  rect(120,300,25,50);//右腿

  fill(243,249,230);

  rect(118,330,27,50);//襪子

  fill(0);

  rect(116,370,30,20);//鞋子

  pushMatrix();

    lights(); ortho();

    translate(150,150);//把整個會轉的頭,移到身體上

    rotateY(radians(angle));

    fill(246,224,154);//head

    sphere(50);//大頭

    pushMatrix();

      translate(40,-10,50);

      fill(0); sphere(10);//黑色的右眼👀

    popMatrix();

    pushMatrix();

      translate(-40,-10,50);

      fill(0); sphere(10);//黑色的左眼👀

      popMatrix();  

  popMatrix();

}

調整遊戲畫面♧♦♥♤♣♢♡♠










///一二三木頭人, 3D

PImage img;

void setup(){

  img = loadImage("1.jpeg");

  //background(img);

  size(1600,400,P3D);//OpenGL

  noStroke();

  genRandomTime();

}

void genRandomTime(){

  time = millis()+random(3000,5000);

}

float time=0;

float angle=-90;

float speed=3;

void draw(){

  background(img);

  if(time < millis() ){//animation鬼要動了!!!

    //ghostMoving=true;

    angle+=speed;

    if(angle>=90){//鬼在看你

      angle=90;

      time = millis()+3000;//rest

      speed = -speed;

    }else if(angle<-90){

      angle=-90;

      genRandomTime();

      speed=3;

    }

  }

  ghost(angle);//鬼要看的角度:-90背對沒看,90看到你 

}

void ghost(float angle){

  fill(237,137,63);

  rect(100,200,100,100);//吊帶褲

  fill(252,254,4);

  rect(100,200,100,30);//衣服

  fill(237,137,63);

  rect(120,200,20,30);//吊帶

  fill(220,210,150);

  rect(150,220,20,50);//手

  fill(220,210,150);

  rect(153,300,25,50);//左腿

  fill(243,249,230);

  rect(152,330,27,50);//襪子

  fill(0);

  rect(150,370,30,20);//鞋子

  fill(220,210,150);

  rect(120,300,25,50);//右腿

  fill(243,249,230);

  rect(118,330,27,50);//襪子

  fill(0);

  rect(116,370,30,20);//鞋子

  pushMatrix();

    lights(); ortho();

    translate(150,150);//把整個會轉的頭,移到身體上

    rotateY(radians(angle));

    fill(246,224,154);//head

    sphere(50);//大頭

    pushMatrix();

      translate(40,-10,50);

      fill(0); sphere(10);//黑色的右眼👀

    popMatrix();

    pushMatrix();

      translate(-40,-10,50);

      fill(0); sphere(10);//黑色的左眼👀

      popMatrix();  

  popMatrix();

}

加樹🌲🌳🌴










///一二三木頭人, 3D

PImage img;

void setup(){

  img = loadImage("1.jpeg");

  //background(img);

  size(1600,400,P3D);//OpenGL

  noStroke();

  genRandomTime();

}

void genRandomTime(){

  time = millis()+random(3000,5000);

}

float time=0;

float angle=-90;

float speed=3;

void draw(){

  background(img);

  if(time < millis() ){//animation鬼要動了!!!

    //ghostMoving=true;

    angle+=speed;

    if(angle>=90){//鬼在看你

      angle=90;

      time = millis()+3000;//rest

      speed = -speed;

    }else if(angle<-90){

      angle=-90;

      genRandomTime();

      speed=3;

    }

  }

  ghost(angle);//鬼要看的角度:-90背對沒看,90看到你 

}

void ghost(float angle){

  fill(237,137,63);

  rect(100,200,100,100);//吊帶褲

  fill(252,254,4);

  rect(100,200,100,30);//衣服

  fill(237,137,63);

  rect(120,200,20,30);//吊帶

  fill(235,218,171);

  rect(150,220,18,50);//手

  fill(243,233,185);

  circle(159, 273, 25);//拳頭

  fill(243,233,185);

  rect(153,300,25,50);//左腿

  fill(243,249,230);

  rect(152,330,27,50);//襪子

  fill(0);

  rect(150,370,30,20);//鞋子

  fill(243,233,185);

  rect(120,300,25,50);//右腿

  fill(243,249,230);

  rect(118,330,27,50);//襪子

  fill(0);

  rect(116,370,30,20);//鞋子

  fill(108,54,0);

  rect(0,80,60,300);//樹

  fill(122,143,58);

  circle(20, 50, 180);//葉子

  pushMatrix();

    lights(); ortho();

    translate(150,150);//把整個會轉的頭,移到身體上

    rotateY(radians(angle));

    fill(246,224,154);//head

    sphere(50);//大頭

    pushMatrix();

      translate(40,-10,50);

      fill(0); sphere(10);//黑色的右眼👀

    popMatrix();

    pushMatrix();

      translate(-40,-10,50);

      fill(0); sphere(10);//黑色的左眼👀

      popMatrix();  

  popMatrix();

}

沒有留言:

張貼留言