2019年9月19日 星期四

huangxuuu互動技術_week2

void setup(){
  size(800,300);
}
void draw(){
  rect(mouseX,mouseY,50,20);
}


void setup(){
  size(800,300);
  for(int x=0;x<800;x+=16){
    for(int y=0;y<300;y+=30){
      rect(x,y,16,30);
    }
  }
}
void draw(){
  int nowX=mouseX/16*16,nowY=mouseY/30*30;
  fill(0);
  rect(nowX,nowY,50,20);
}
void setup(){
  size(800,300);
  for(int x=0;x<800;x+=16){
    for(int y=0;y<300;y+=30){
      rect(x,y,16,30);
    }
  }
}
void draw(){
  int nowX=mouseX/16*16,nowY=mouseY/30*30;
  if(mousePressed && mouseButton==LEFT){
    fill(0);
    rect(nowX,nowY,16,30);
  }
  else if(mousePressed && mouseButton==RIGHT){
    fill(255);
    rect(nowX,nowY,16,30);
  }
}


PImage img;
void setup(){
  size(500,500);
  img=loadImage("new.png");
}
void draw(){
  image( img,mouseX,mouseY,100,100);
}



沒有留言:

張貼留言

alanhc 互動技術-week17 [final]

回顧這學期的作品:  期中作業:LANDING:PLANET 賣點&特點: 炫麗的特效 物理(星球重力及降落)及粒子系統(噴射) 世界地圖可根據視角縮放 困難點: 重寫3次最終改寫成物件導向的CLASS寫法...