음성고등학교 로고이미지

RSS 페이스북 공유하기 트위터 공유하기 카카오톡 공유하기 카카오스토리 공유하기 네이버밴드 공유하기 프린트하기
feeding packman
작성자 김용남 등록일 18.11.08 조회수 46

int x = 50;
int y = 50;
int xspeed = 1;
int yspeed = 10;
int volume = 50;
int mouth =0;

void setup(){
  size(640, 480);
}

void draw(){
  background(0);
  //fill(255, 255, 0);
  fill(random(255), random(255), random(255));
  if(frameCount % 20 < 10){
  arc(x, height/2, volume+((x*volume)/width), volume+((x*volume)/width), 0.52, 5.76); // open mouth
  } else {
  arc(x, height/2, volume+((x*volume)/width), volume+((x*volume)/width), 0.1, 6.18); // close mouth
  }
  x = x + xspeed;
  y = y + yspeed;
 
/*  if(x==50||x==600){
    xspeed = xspeed * (-1);
  }
*/ 

  if(x==500){
    x = 0;
  }

  if(y==50||y==440){
    yspeed = yspeed * (-1); 
  }
  strokeWeight(5);
  stroke(255);

  for(int i = 15; i<= width; i += 15){
    if(i>x+3)
    point(i, height/2);
  }
}

이전글 friend packman
다음글 엑셀2급A형 소스 및 문제