2017年1月10日 星期二

Week 14 ლ(゚д゚ლ) 張書豪 60408029E 大豪豪der上課筆記

20161215 教學軟體設計

本日心得:


今天老師向我們介紹  Processing年度大賞的一些案例,覺得很潮


並介紹了雷亞遊戲公司

雷亞遊戲是一間臺灣電子遊戲公司,成立於2011年9月,於2013年向臺北市政府登記核准設立。
開發有《Cytus》、《Deemo》、《Mandora》、《Implosion》、《VOEZ》等遊戲。

雷亞遊戲於2011年9月成立,成立時成員有16人;其中,由游名揚帶領的《Cytus》開發團隊,在雷亞遊戲成立前曾專注於開發大型機臺的音樂遊戲。

2008年,游名揚等三人在雷亞遊戲前身「Hypaa Studio」開發一款大型機臺的觸碰式音樂遊戲《THEIA》,並在同年上市;
而同年由PENTAVISION在街機平台上推出的遊戲《DJ Max Technika》,與《THEIA》性質接近,但在音樂品質、使用者介面等整體設計上較《THEIA》佳[。

游名揚說「我們以為玩法有趣就會賣,但市場的反應讓我們知道,畫面和音樂很重要,以及該團隊在大型機臺市場的問題,使團隊成員集資成立雷亞遊戲,將重心轉移至手機遊戲市場。

最後實作出愛心,雖然有點跟不太上老師的進度,但好在老師有開實況有影片可以慢慢跟著,收穫良多~ 謝謝老師。


1. The Processing Foundation Fellowship Program
https://processingfoundation.org/fellowships
2. 實作 - 愛心
3. 雷亞遊戲公司介紹

2017年1月9日 星期一

2016 教學軟體設計  week9


2016-11-10

1.LEAP Motion

2.檔案讀取、寫檔

寫檔實作1:
void setup()
{
    size(600,600);
}
void draw()
{
  if(mousePressed)    line(mouseX,mouseY,pmouseX,pmouseY);
}
void mousePressed(){
  save("now.png");
}

寫檔實作1執行結果:






































****查看工作資料夾















寫檔實作2:
void setup()
{
    size(600,600);
}
void draw()
{
  if(mousePressed)    line(mouseX,mouseY,pmouseX,pmouseY);
}
int number=0;
void mousePressed(){
  save("now"+number+".png");
  number++;
}
寫檔實作2  執行結果:





































查詢 save 相關函數











































寫檔實作3:
void setup()
{
    size(600,600);
}
void draw()
{
  if(mousePressed)    line(mouseX,mouseY,pmouseX,pmouseY);
}
int number=0;
void mousePressed(){
  saveFrame();
}
寫檔實作3執行結果:

































儲存文字檔
String [] names={"AAA","BBB","CCC"};
saveStrings("myClassmateName.txt",names);
























讀檔實作1:
String lines[] = loadStrings("myClassmateName.txt");
println("there are " + lines.length + " lines");
for (int i = 0 ; i < lines.length; i++) {
  println(lines[i]);
}

讀檔實作1 執行結果:
























接coin實作1:滑鼠與coin距離<30,加100分,並顯示分數。


 接coin實作1 執行結果:









 接coin實作2:滑鼠與coin距離<30,加100分,漏接扣命一條,並顯示分數及生命數。

接coin實作2 執行結果:
接coin實作3:滑鼠or hand 與coin距離<30,加100分,漏接扣命一條,並顯示分數及生命數。
                       當生命數=0,則遊戲結束,滑鼠一點則顯示 allScores.txt內容。
import de.voidplus.leapmotion.*;
LeapMotion leap;
float handX=0,handY=0;
PVector [] coins=new PVector[10];
void setup(){
  size(500,500);
  leap = new LeapMotion(this);
  for(int i=0;i<10;i++) coins[i]=new PVector( random(500), -random(100));
}
int score=0, life=10, speed=2;
int state=0;//state 0:playing, 1:gameOver, 2:showScoreBoard
String [] allScore;
void draw(){
  for (Hand hand : leap.getHands ()) {
     handX=hand.getPosition().x;
     handY=hand.getPosition().y;
  }
  if(state==2){
     background(255,255,0);
     for(int i=0;i<allScore.length; i++){
        fill(255,0,0); textSize(30);text( allScore[i], 100, 200+i*50);
     }
     return ;
  }else if(state==1){
    background(128); speed=0;
    allScore = loadStrings("allScores.txt");
    if(mousePressed) state=2;
  }else background(255);
  for(int i=0;i<10;i++){
    fill(255,255,0); ellipse(coins[i].x, coins[i].y, 30,30);
    coins[i].y+=speed;//!!!!!!
    if(coins[i].y>530){
       coins[i].y=-random(100);
       life--;
      if(life<=0) state=1;
    }
    if(dist(handX, handY, coins[i].x, coins[i].y)<30){
       score+=100; coins[i].y=-random(100);
    }
    if(dist(mouseX, mouseY, coins[i].x, coins[i].y)<30){
       score+=100; coins[i].y=-random(100);
    }
  }
  fill(255); ellipse(handX, handY, 30,30);
 fill(255,0,0); textSize(30); text("Score:"+score +"Life:"+life, 200,200);
 }

接coin實作3 執行結果:








2016 教學軟體設計 week8


2016-11-03

1.LEAPmotion
    1.0      LEAPmotion Setup(PC/Mac)
    1.1  LEAP motion on APP Store
    1.2  Play
2.      Developer /Designer














開啟範例:
























執行結果:
















實作1:
import de.voidplus.leapmotion.*;
LeapMotion leap;
void setup() {
  size(640, 480,P3D);
  leap = new LeapMotion(this);
}
void draw() {
  background(255);
  int fps = leap.getFrameRate();
  for (Hand hand : leap.getHands ()) {
    hand.draw();
  }
}  
實作1 執行結果:



















de.voidplus.leapmotion.*  文件
















實作2:顯示hand的座標
























實作3:在hand的座標上,顯示一個直徑100的紅色圓。























實作3 執行結果:
















實作4:在hand的座標上,顯示一個直徑100的紅色圓,但不顯示hand,
               功能為用hand接coin,hand與coin距離< 100,代表接到得10分。

























實作 4執行結果:



2017年1月8日 星期日

2016 教學軟體設計 week7  
2016-10-27

1.      Web cam
2.      Camera Calibration 攝影機校正
3.      AR
l  2000 Magic Book, Invisible Train
l  ARToolkit

4.      holoportation
teleport
5.      實作:拿金幣(實作示範, 給程式碼)
6.      Leap Motion



 下載 video Library


Sketch --> Import Library ... -->Add Library --> Video  -->Install

















開啟video 範例 






















import processing.video.*;

Capture video;
void setup()
{
    size(640,480);
    video = new Capture(this,640,480);
    video.start();
}
void draw()
{
  image(video,0,0);   
}

void captureEvent(Capture c)
{
  c.read();   

}


2016 教學軟體設計   week6  
2016-10-20
l   Vive 介紹、設定、體驗
l   本日實作:for loop+array, 打字遊戲
  
打字 英文

typing game

Sketch --> Import Library ... -->Add Library --> Sound -->Install



















import processing.sound.*;
SoundFile soundfile;
boolean [] drawkey = new boolean[26];//java
int shooting=0;
float boxX=200,boxY=0;
int c=0;
char []boxC={'A','B','C','D','E','F','G','H','I','J','K','L','M','N',
              'O','P','Q','R','S','T','U','V','W','X','Y','Z'};

void setup() //執行1次
{
    size(600,400);
    soundfile =new SoundFile(this,"Developers.mp3");
    soundfile.play();
}
void draw()//
{
  background(255);
  boxY +=2;
  if(boxY>400){
    c=int(random(26));
    boxY=0;
  } 
  fill(255);rect(boxX,boxY,50,50);
  fill(255,0,0);textSize(60);text(boxC[c],boxX,boxY);
  if(shooting>0){
    strokeWeight(40);
    stroke(255,0,0);
    line(300,400,boxX,boxY);
    strokeWeight(1);
    shooting--;
    if(shooting==0){
      c=int(random(26));
      boxX=random(400)+100;
      boxY=0;
    } 
  }
}
void keyPressed()
{
  if ( Character.toUpperCase(key) == boxC[c] ){
    shooting=10;
  } 
  println(key);
}
2016 教學軟體設計 week5   :葉老師生病了,停課。