2012年10月30日 星期二

98163021,張耀璇,HW08,Week08

1.1我們之前完成了人物的左右移動,並且碰到視窗的最邊緣時,會自己更換方向,並且繼續的移動,這是上上禮拜的進度,那上禮拜我們做到的是,利用鍵盤的按鍵可以控制人物往上移動,進行跳躍的動作。


1.2今天的計畫是,如何人物碰到跳躍的板子下方,即會跳不上去,還有場景會一直跑不同的東西,地板會隨機擺放以及地板的數量。


1.3可能會遇到的問題是如地板會隨機,有時候板子距離太遙遠,人物的跳躍可能跳不到,或許要控制在一定的範圍內,還有場景的移動,必須搭配人物的移動以等比例的方式移動,不然背景看起來會非常的不協調,可能要解決的是人物以及背景的位置必須搭配好,否則會很奇怪。
2. 我們目前的進度是把背景的比例用好,然後至於地板的隨機部分,可能會再想解決的方法。
今日進度:

int finnx=0,finny=0;
int dx=5,bgX=0,bgY=0,jump;
PImage finn1,finn2,jump1,jump2,sky,grass;
void setup(){
size(600,800);
finn1 = loadImage("Finn_right.png");
finn2 = loadImage("Finn_left.png");
jump1 = loadImage("jump_right.png");
jump2 = loadImage("jump_left.png");
sky = loadImage("sky.jpg");
grass = loadImage("grass.png");
}
void draw(){
background (239,228,176);
image (sky,0,0,600,630);
image (grass,0,500,600,300);
translate (0,500);

if (finnx>500 || finnx<0) dx=-dx;
finnx+=dx;
if(dx>0) image(finn1,finnx,finny,100,150);
else image(finn2,finnx,finny,100,150);
/*if(jump>0){
jump=jump-10;
finny-=10;
}
if(finny<420){
finny+=5;
}*/
}
/*void keyPressed(){
if(key==' '){
jump=200;
}
}

HW08,week08

1. 請寫下以下資料:
1.1. 你之前完成了什麼?
製作遊戲所需要的素材,例如痘痘,和爆掉的痘痘。

1.2. 你今天計畫要做什麼?
讓痘痘越來越成熟,用滑鼠點擊就會爆開。

1.3. 可能會遇到的問題... (及可能的解決方法)
(1)痘痘漸層的顏色是從黑色開始變紅,想要讓他從膚色開始。
(2)現在點擊痘痘只會爆開一下子就變回原本痘痘的圖,想要讓他可以一直停在爆開痘痘的圖。


2. 請把你目前期中作品的進度貼出來

Week08,HW08

1. 請寫下以下資料:
1.1. 你之前完成了什麼?
      
       我們之前完成了烤章魚燒的烤盤。

1.2. 你今天計畫要做什麼?

       我們今天計畫完成
       (1)切換畫面(從一開始的畫面→點選"開始遊戲" → 切換到烤章魚燒烤盤的畫面)。
       (2)工具列(麵糊、叉子、刷子、手)。 
       (3)章魚燒可以成功變色(漸層變色,變色是用計時器來控制)
            白色 → 黃色(麵糊開始變色)
                     → 褐色(章魚燒成功的顏色)
                     → 黑色(章魚燒失敗的顏色,焦掉)。 
       (4)用小烏龜的移動代表時間的倒數。

1.3. 可能會遇到的問題... (及可能的解決方法)

       我們在麵糊變色遇到了很大的困難,花了我們很多時間去調整RGB數值,但是都沒有很
      成功。
      後來我們請教助教,顏色終於比較像了,在助教的幫忙下,有了計時器和漸層的功能。
     

2. 請把你目前期中作品的進度貼出來
 
一開始的畫面

點選"遊戲開始"後切換的畫面
小烏龜代表時間的倒數(時間一點一滴的流逝~~)
倒入麵糊、麵糊變色(變色是用計時器來控制)、
小烏龜的移動(時間在倒數)的畫面

Week08,HW08

8-1 上週完成了進度:
(1) 遊戲登入畫面按"開始遊戲"會進入遊戲畫面。
(2) 調整材質大小以及去背。


8-2 本週計畫進度:
遊戲畫面
(1) 酒瓶(目標物)來回移動
(2) 球棒可依滑鼠移動而揮動
(3) 投手圖片、球圖片放上遊戲畫面
(4) 球棒打擊到球飛處去的角度



8-3 可能會遇到的問題:
(1) 球棒打擊到球飛出去的角度(向量)
(2) 酒瓶來回移動(在x軸)
(3) 球棒揮動(T-移動,R,T-軸心)




week08 , hw08

1.1. 你之前完成了什麼?


簡陋的圖樣和不會移動的橫槓


1.2. 你今天計畫要做什麼?


美化整個圖樣和想辦法讓橫槓和球移動
還有分數的計算

1.3. 可能會遇到的問題... (及可能的解決方法)

依然不會動或跑不出來
2. 請把你目前期中作品的進度貼出來





 
 
加強了整個遊戲的視覺辨識度
以及橫槓的大小,但是只有球能動
橫槓和分數依舊無動靜ㄏㄏ

WEEK HW08

boolean a1=false;
boolean a12=false;
boolean s1=false;
boolean s12=false;
boolean d1=false;
boolean f1=false;
boolean z1=false;
boolean x1=false;
boolean c1=false;
boolean v1=false;
boolean y1=false;
boolean u1=false;
boolean i1=false;
boolean o1=false;
boolean h1=false;
boolean j1=false;
boolean k1=false;
boolean l1=false;
boolean q1=false;
boolean take=false;
int s123=0;
 int sice=0;
 int siceten=0;
 int sicehun=0;
 int m=0;
void setup(){
  size(600,650);
}
void sicetake()//////////////////// 計分判斷
{
 if(sice<10)
    {
    sice++;
    }
    if(sice==10)
    {
      sice=0;
      if(siceten<10)
      {
      siceten++;
      }
      if(siceten==10)
      {
        siceten=0;
        if(sicehun<10)
        {
          sicehun++;
        }
      }
      }
}
void draw()
{
   if(s1==true&&s12==true)
  {
    sicetake();
    s12=false;
  }
  else if(s1==true&&s12==false)
  {
  }
  background(255);
  int m = millis()/1000;
  if(m==3)
  {
  a1=true;
  s1=true;
  }
  else if(m==4)
  {
    a1=false;
    s1=false;
  }
   if(m==7)
  {
  a1=true;
  s1=true;
  }
  else if(m==8)
  {
    a1=false;
    s1=false;
  }
 fill(255);
 /////////////////////////////////////////////第一排
 rect(50, 100, 100, 100);    
 rect(180, 100, 100, 100);
 rect(310, 100, 100, 100);
 rect(440, 100, 100, 100);
 ///////////////////////////////////////////////第二排
 rect(50, 230, 100, 100);
 rect(180, 230, 100, 100);
 rect(310, 230, 100, 100);
 rect(440, 230, 100, 100);
 //////////////////////////////////////////////第三排
 rect(50, 360, 100, 100);
 rect(180, 360, 100, 100);
 rect(310, 360, 100, 100);
 rect(440, 360, 100, 100);
 //////////////////////////////////////////////第四排
 rect(50, 490, 100, 100);
 rect(180, 490, 100, 100);
 rect(310, 490, 100, 100);
 rect(440, 490, 100, 100);
 /////////////////////////////////////////////////////////
  if(a1)
  {
    fill(0);
    rect(50, 100, 100, 100);
  }
   if(s1)
  {
    fill(0);
    rect(180, 100, 100, 100);
  }
   if(d1)
  {
    fill(0);
      rect(310, 100, 100, 100);
  }
   if(f1)
  {
    fill(0);
     rect(440, 100, 100, 100); 
  }
/////////////////////////////////////////////////////第一排
   if (z1)
        {
      fill(0);
      rect(50, 230, 100, 100);
        }
     if(x1)
        {
      fill(0);
      rect(180, 230, 100, 100);  
         
        }
      if(c1)
        {
      fill(0);
      rect(310, 230, 100, 100);      
        }
      if(v1)
        {
      fill(0);
      rect(440, 230, 100, 100);      
        }
//////////////////////////////////////////第二排
   if (y1)
        {
      fill(0);
      rect(50, 360, 100, 100);
        }
   if(u1)
        {
      fill(0);
      rect(180, 360, 100, 100);           
        }
      if(i1)
        {
      fill(0);
      rect(310, 360, 100, 100);      
        }
      if(o1)
        {
      fill(0);
      rect(440, 360, 100, 100);      
        }
/////////////////////////////////////////////////////////////第三排
if (h1)
        {
      fill(0);
      rect(50, 490, 100, 100);
        }
     if(j1)
        {
      fill(0);
      rect(180, 490, 100, 100);  
         
        }
      if(k1)
        {
      fill(0);
      rect(310, 490, 100, 100);      
        }
      if(l1)
        {
      fill(0);
      rect(440, 490, 100, 100);      
        }
 
////////////////////////////////////////////////////////////////第四排////////////X+50.Y+80
if(sice==1)
 {
  fill(0,0,0,120);
 rect(450, 280, 20, 60);
 rect(450, 360, 20, 60);
 }
 if(siceten==1)
 {
  fill(0,0,0,120);
 rect(300, 280, 20, 60);
 rect(300, 360, 20, 60);
 }
 if(sicehun==1)
 {
  fill(0,0,0,120);
 rect(150, 280, 20, 60);
 rect(150, 360, 20, 60);
 }
if(siceten==2)
 {
  fill(0,0,0,120);
 rect(240,260,60,20);
 rect(300, 280, 20, 60);
 rect(240,340,60,20);
 rect(220, 360, 20, 60);
 rect(240,420,60,20);
 }
if(sicehun==2)
 {
  fill(0,0,0,120);
 rect(90,260,60,20);
 rect(150, 280, 20, 60);
 rect(90,340,60,20);
 rect(70, 360, 20, 60);
 rect(90,420,60,20);
 }
if(sice==2)
 {
  fill(0,0,0,120);
 rect(390,260,60,20);
 rect(450, 280, 20, 60);
 rect(390,340,60,20);
 rect(370, 360, 20, 60);
 rect(390,420,60,20);
 }
if(sice==3)
 {
  fill(0,0,0,120);
 rect(390,260,60,20);
 rect(450, 280, 20, 60);
 rect(390,340,60,20);
 rect(450, 360, 20, 60);
 rect(390,420,60,20);
 }
if(siceten==3)
 {
  fill(0,0,0,120);
 rect(240,260,60,20);
 rect(300, 280, 20, 60);
 rect(240,340,60,20);
 rect(300, 360, 20, 60);
 rect(240,420,60,20);
 }
if(sicehun==3)
 {
  fill(0,0,0,120);
 rect(90,260,60,20);
 rect(150, 280, 20, 60);
 rect(90,340,60,20);
 rect(150, 360, 20, 60);
 rect(90,420,60,20);
 }
 if(sice==4)
 {
   fill(0,0,0,120);
   rect(370, 280, 20, 60);
   rect(450, 280, 20, 60);
   rect(390,340,60,20);
   rect(450, 360, 20, 60);
 }
 if(siceten==4)
 {
   fill(0,0,0,120);
   rect(220, 280, 20, 60);
   rect(300, 280, 20, 60);
   rect(240,340,60,20);
   rect(300, 360, 20, 60);
 }
 if(sicehun==4)
 {
   fill(0,0,0,120);
   rect(70, 280, 20, 60);
   rect(150, 280, 20, 60);
   rect(90,340,60,20);
   rect(150, 360, 20, 60);
 }
 if(sice==5)
 {
 fill(0,0,0,120);
 rect(390,260,60,20);
 rect(370, 280, 20, 60);
 rect(390,340,60,20);
 rect(450, 360, 20, 60);
 rect(390,420,60,20);
 }
 if(siceten==5)
 {
 fill(0,0,0,120);
 rect(240,260,60,20);
 rect(220, 280, 20, 60);
 rect(240,340,60,20);
 rect(300, 360, 20, 60);
 rect(240,420,60,20);
 }
 if(sicehun==5)
 {
 fill(0,0,0,120);
 rect(90,260,60,20);
 rect(70, 280, 20, 60);
 rect(90,340,60,20);
 rect(150, 360, 20, 60);
 rect(90,420,60,20);
 }
  if(sice==6)
 {
 fill(0,0,0,120);
 rect(390,260,60,20);
 rect(450, 280, 20, 60);
 rect(390,340,60,20);
 rect(450, 360, 20, 60);
 rect(390,420,60,20);
 rect(370, 360, 20, 60);
 }
 if(siceten==6)
 {
 fill(0,0,0,120);
 rect(240,260,60,20);
 rect(300, 280, 20, 60);
 rect(240,340,60,20);
 rect(300, 360, 20, 60);
 rect(240,420,60,20);
 rect(220, 360, 20, 60);
 }
 if(sicehun==6)
 {
 fill(0,0,0,120);
 rect(90,260,60,20);
 rect(150, 280, 20, 60);
 rect(90,340,60,20);
 rect(150, 360, 20, 60);
 rect(90,420,60,20);
 rect(70, 360, 20, 60);
 }
 if(sice==7)
 {
 fill(0,0,0,120);
 rect(390,260,60,20);
 rect(450, 280, 20, 60);
 rect(450, 360, 20, 60);
 }
 if(siceten==7)
 {
 fill(0,0,0,120);
 rect(240,260,60,20);
 rect(300, 280, 20, 60);
 rect(300, 360, 20, 60);
 }
 if(sicehun==7)
 {
 fill(0,0,0,120);
 rect(90,260,60,20);
 rect(150, 280, 20, 60);
 rect(150, 360, 20, 60);
 }
 if(sice==8)
 {
 fill(0,0,0,120);
 rect(390,260,60,20);
 rect(450, 280, 20, 60);
 rect(390,340,60,20);
 rect(450, 360, 20, 60);
 rect(390,420,60,20);
 rect(370, 360, 20, 60);
 rect(370, 280, 20, 60);
 }
 if(siceten==8)
 {
 fill(0,0,0,120);
 rect(240,260,60,20);
 rect(300, 280, 20, 60);
 rect(240,340,60,20);
 rect(300, 360, 20, 60);
 rect(240,420,60,20);
 rect(220, 360, 20, 60);
 rect(220, 280, 20, 60);
 }
 if(sicehun==8)
 {
 fill(0,0,0,120);
 rect(90,260,60,20);
 rect(150, 280, 20, 60);
 rect(90,340,60,20);
 rect(150, 360, 20, 60);
 rect(90,420,60,20);
 rect(70, 360, 20, 60);
 rect(70, 280, 20, 60);
 }
 if(sice==9)
 {
 fill(0,0,0,120);
 rect(390,260,60,20);
 rect(450, 280, 20, 60);
 rect(390,340,60,20);
 rect(450, 360, 20, 60);
 rect(390,420,60,20);
// rect(320, 280, 20, 60);
 rect(370, 280, 20, 60);
 }
 if(siceten==9)
 {
 fill(0,0,0,120);
 rect(240,260,60,20);
 rect(300, 280, 20, 60);
 rect(240,340,60,20);
 rect(300, 360, 20, 60);
 rect(240,420,60,20);
// rect(320, 280, 20, 60);
 rect(220, 280, 20, 60);
 }
 if(sicehun==9)
 {
 fill(0,0,0,120);
 rect(90,260,60,20);
 rect(150, 280, 20, 60);
 rect(90,340,60,20);
 rect(150, 360, 20, 60);
 rect(90,420,60,20);
// rect(320, 280, 20, 60);
 rect(70, 280, 20, 60);
 }
 if(sice==0)
 {
 fill(0,0,0,120);
 rect(390,260,60,20);
 rect(450, 280, 20, 60);
// rect(390,340,60,20);
 rect(450, 360, 20, 60);
 rect(390,420,60,20);
 rect(370, 360, 20, 60);
 rect(370, 280, 20, 60);
 }
 if(siceten==0)
 {
 fill(0,0,0,120);
 rect(240,260,60,20);
 rect(300, 280, 20, 60);
// rect(390,340,60,20);
 rect(300, 360, 20, 60);
 rect(240,420,60,20);
 rect(220, 360, 20, 60);
 rect(220, 280, 20, 60);
 }
 if(sicehun==0)
 {
 fill(0,0,0,120);
 rect(90,260,60,20);
 rect(150, 280, 20, 60);
// rect(390,340,60,20);
 rect(150, 360, 20, 60);
 rect(90,420,60,20);
 rect(70, 360, 20, 60);
 rect(70, 280, 20, 60);
 }
}
void keyPressed(){
  if(key=='a'|| key == 'A'){
    a12=true;
  }
 else  if(key=='s'|| key == 'S'){
    s12=true;
    s123=1;
  }
 else  if(key=='d'|| key == 'D')
{
  d1=true;
}
  else if(key=='f'|| key == 'F')
{
  f1=true;
}
  if(key=='z'|| key == 'Z'){
    z1=true;
  }
 else  if(key=='x'|| key == 'X'){
    x1=true;
  }
 else  if(key=='c'|| key == 'C')
{
  c1=true;
}
  else if(key=='v'|| key == 'V')
{
  v1=true;
}
  if(key=='y'|| key == 'Y'){
    y1=true;
  }
 else  if(key=='u'|| key == 'U'){
    u1=true;
  }
 else  if(key=='i'|| key == 'I')
{
  i1=true;
}
  else if(key=='o'|| key == 'O')
{
  o1=true;
}
  if(key=='h'|| key == 'H'){
    h1=true;
  }
 else  if(key=='j'|| key == 'J'){
    j1=true;
  }
 else  if(key=='k'|| key == 'K')
{
  k1=true;
}
  else if(key=='l'|| key == 'L')
{
  l1=true;
}
else if(key=='q'|| key == 'Q')/////////////////////////////////開始建
{
  q1=true;
}
}
void keyReleased(){
  if(key=='a'|| key == 'A')
  {
    a12=false;
    if(sice<10)
    {
    sice++;
    }
    if(sice==10)
    {
      sice=0;
      if(siceten<10)
      {
      siceten++;
      }
      if(siceten==10)
      {
        siceten=0;
        if(sicehun<10)
        {
          sicehun++;
        }
      }
    }
  }
    if(key=='s'|| key == 'S'){
    s12=false;
    s123=0;
  }
   if(key=='d'|| key == 'D')
{
   d1=false;
}
 else  if(key=='f'|| key == 'F')
{
    f1=false;
}
   else if(key=='z'|| key == 'Z')
  {
    z1=false;
  }
   if(key=='x'|| key == 'X'){
    x1=false;
  }
   if(key=='c'|| key == 'C')
{
   c1=false;
}
  else if(key=='v'|| key == 'V')
{
    v1=false;
}
  if(key=='y'|| key == 'Y'){
    y1=false;
  }
 else  if(key=='u'|| key == 'U'){
    u1=false;
  }
 else  if(key=='i'|| key == 'I')
{
  i1=false;
}
  else if(key=='o'|| key == 'O')
{
  o1=false;
}
  if(key=='h'|| key == 'H'){
    h1=false;
  }
 else  if(key=='j'|| key == 'J'){
    j1=false;
  }
 else  if(key=='k'|| key == 'K')
{
  k1=false;
}
  else if(key=='l'|| key == 'L')
{
  l1=false;
}
  else if(key=='q'|| key == 'Q')/////////////////////////開始建
{
  q1=false;
}
}
加入時間自動編輯
加入計分判斷


之前我將所有素材找到而且將位置規劃放好

今天我完成了老鼠的出現時間以及分數跟時間的設定

有想法想放音樂以及音效還有如果想要背景會動的話應該怎麼做

week08,hw08

1本周進度

這禮拜完成了計分和小人移動的部分,洞穴會越來越窄,而小人會不斷的往下掉,不管他會觸碰到洞穴邊緣死掉,所以我們要一直按空白健讓小人往上移動,不要碰到洞穴邊緣。每次玩遊戲結束或是game over之後可以按Enter重玩一遍.遊戲的最高分數會記錄於左上角。


遊戲失敗畫面



遊戲畫面




2本週程式碼



int cfg_width =450;
int cfg_height = 450;
int cfg_maxchange = 5;
float cfg_space_mod = 0.9994;
int cfg_playersize = 5;
float cfg_gravity = 1.0002;
PImage body;
float dir = 1; 
long score = 0; //分數
long maxscore = 0; //最高分紀錄
int push = 0; //按空白鍵增加
int mode = 1; // 遊戲狀態
float cur_space = 450; 
float factor = 0.5;   

//穴邊
int[] ylinetop = new int[cfg_width];
int[] ylinebottom = new int[cfg_width];

float[] yplayer = new float[cfg_width/2];

PFont myFont;


void initcave() {
  
  score = 0;
  dir = 1;
  push = 0;
  cur_space = 400;
 
  body=loadImage("body.png");
  
  
  
  for(int i = 0; i < width; i++) {
    ylinetop[i] = height/2-int(cur_space)/2;
    ylinebottom[i] = ylinetop[i]+int(cur_space);
  }

  for(int i = 0; i < width/2; i++) {
    yplayer[i] = height/2;
  }
}

void drawframe () {
  background(0,0,0);
   
   stroke(255,0,0);
 
  for(int i=1; i<width; i++) {  
    line(i, 0, i, ylinetop[i]);
    line(i, ylinebottom[i], i, height);
  }

 
  for(int i=1; i<width/2; i++) {  
  
   image(body,i, int(yplayer[i]),80,80);
   if ( ylinetop[i]==10 & ylinebottom[i]==100){
     background(255);
   }
 
  }

  if (mode < 1) {
    stroke(0,255,0);
    strokeWeight(5);
    fill(100,255,0);
    ellipse(width/2, yplayer[width/2 - 1], 150, 150);
  }
  
}

void setup()
{
  size(cfg_width, cfg_height);
  initcave();
  frameRate(100);
}


void drawscore()
{
  stroke(0);
  strokeWeight(3);
  fill(0);
  text("最高分紀錄: " + int(maxscore/10) + "  分數: " + int(score/10), 1, 12);
  if (mode == -1) {
    text("Game Over!再玩一次.", 2, 26);
  }
}

void draw()
{
 
 if (mode == 1) {
   
  for(int i = 1; i < width; i++) {
    ylinetop[i-1] = ylinetop[i];
    ylinebottom[i-1] = ylinebottom[i];
  }
  
  for(int i = 1; i < width/2; i++) {
    yplayer[i-1] = yplayer[i];
  }
 
  ylinetop[width-1] =
    constrain( int( random(-cfg_maxchange, cfg_maxchange) + factor)
                 + ylinetop[width-1]
              , 0, height-int(cur_space+1));
              
  ylinebottom[width-1] = ylinetop[width-1] + int(cur_space);
  
  
  dir = pow(cfg_gravity, dir) * dir;
  
  yplayer[width/2-1] = constrain(yplayer[width/2- 2] * dir, 1, height-2);
  
  
  if (yplayer[width/2-1] < ylinetop[width/2] ||
      yplayer[width/2-1] > ylinebottom[width/2]) {
    mode = 0;
  }

  cur_space *= cfg_space_mod;
  
  score += 1;
  
 
  if (ylinetop[width-1] < 2 || ylinebottom[width-1] > height-2) {
    factor *= -1;
  }
    
 } else { 
   if (mode == 0) {
     maxscore = maxscore > score ? maxscore : score;
   
     mode = -1;
   }
 }
 
 drawframe();
 drawscore();
  
}

void keyPressed() {
  

  if (mode == 1 && key == ' ') {
    dir *= 0.997;
  }


  if (mode == -1 && (keyCode == ENTER || keyCode == RETURN)) {
    mode = 1;
    initcave();
  }

}
3尚未完成吃金幣的功能

4本周心得

這禮拜將小人用貼圖方式放進遊戲中,讓它可以順利執行,很開心
今天老師又說明了音樂怎麼進程式中,這樣一來我們也考慮放背景音樂至遊戲裡。
















Week08,Hw08

1. 請寫下以下資料:
1.1. 你之前完成了什麼?

  1.遊戲畫面。
  2.隨機產生游標,以及游標的位移。
  3.背景。
  4.Combo畫面,以及combo判斷。
  5.速度調整,難度調整。
  6.游標變換。
  7.不同的背景以及combo、數字圖樣。
  8.說明頁面。



小丸子游標 以及 遊戲畫面:
  



















另一首歌的畫面:




















1.2. 你今天計畫要做什麼?

  1.選單部分,包含選擇游標、歌曲、最高分紀錄。
  2.開始畫面


1.3. 可能會遇到的問題... (及可能的解決方法)

  1.使用越多的場景,程式會越難增加。故必須要將程式整理,使其增加能辯度。
  2.由於場景是連續修正,擔心效率問題。故修改部分需要效率的場景之程式結構。
  3.普面設計的問題,需要按照節奏,故必須要考慮到時間。故使用文字檔搭配millis()儲存,並記錄時間以及做時間的修正位移。

2. 請把你目前期中作品的進度貼出來




歌曲1:畫面風格



















歌曲2畫面風格:




















歌曲1COMBO以及數字風格:




















歌曲2COMBO以及數字風格:



















說明頁面:

Week08 , HW08

1. 請寫下以下資料:
1.1. 你之前完成了什麼?
找完素材,想好架構,並尋找可利用的程式

1.2. 你今天計畫要做什麼?
(a)把首頁畫面完成
(b)遊戲畫面裡,酒瓶可以跑出來,準心可以跟著滑鼠移動

1.3. 可能會遇到的問題... (及可能的解決方法)
(a)選單畫面的設置
(b)儲存酒瓶的陣列


2. 請把你目前期中作品的進度貼出來
(a)首頁畫面



(a)把首頁畫面完成


程式碼:
PImage screenleft,screenright,people,bg;  
boolean ctl=true,ctl2=false;          //control mouse press
int siteX1=0,siteX2=350,siteX3=525;   //Image site
//Var
PImage gun,star;
PImage [] bottle = new PImage[5];
float [] bx = new float [5];
//首頁畫面
void Start()
{
  if(mousePressed&&mouseX<430&&mouseX>270&&mouseY<430&&mouseY>270&&ctl)
    ctl=false;
  if(ctl==false && ctl2==false){
     image(screenleft, siteX1-=3, 0, width/2, height);
     image(screenright,siteX2+=3,0,width/2, height);
     image(people,siteX3+=1,150,width/4, height/1.5);
     if(siteX1<-350&&siteX2>700&&siteX3>700) ctl2=true;
     if(ctl2) ;
  }
  else if(ctl==true && ctl2 == false){
     image(screenleft, siteX1, 0, width/2, height);
     image(screenright,siteX2,0,width/2, height);
     image(people,siteX3,150,width/4, height/1.5);
     fill(66,66,255);
     ellipse(350,350, 80,80);
     fill(255,255,0);
     textFont(createFont("Georgia", 20));
     text("START",320,355);
  }
}
void setup() {
  //Size
  size(700,525);
  bg = loadImage("bg.jpg");
 
  //Load Image
  screenleft = loadImage("screen_left.jpg");
  screenright = loadImage("screen_right.jpg");
  people = loadImage("people.png");
 
  //Print Image
  image(screenleft, siteX1, 0, width/2, height);
  image(screenright,siteX2,0,width/2, height);
  image(people,siteX3,150,width/4, height/1.5);
 
  //code
  //textFont(createFont("Georgia", 40));
   gun=loadImage("gun.png");
   star=loadImage("star.png");
   for(int i=0;i<5;i++){
      bottle[i]=loadImage("bottle.png");
    }
}
void draw() {
  background(bg);
  Start();
  //code
  if(siteX1<-350&&siteX2>700&&siteX3>700){
  bottle(); 
  gun();
 
  }
}
void gun(){
  image(gun,530,420);
  image(star,mouseX,mouseY);
  text("Score:",40,500);
}
void bottle(){
   for(int i=0;i<5;i++){
     image(bottle[i],i*50+bx[i],98,50,80);
     bx[i]+=2;
     if(bx[i]==700){
       bx[i]=0;
     }
  }
}




week08,work08


因為我們先前的太鼓達人太難了,所以我們上網找別的益智遊戲,所以我們改變主題了

遇到的問題就是~~不會上網直接google答案就會跑出來慢慢試




心得
        就是還是很難不過差不多都上網google

Week08,HW08

1. 期中作品報告:

1.1. 之前完成的部分:

  之前已完成遊戲背景底色與其他區域的配色,以及所有的固定文字及

數字的擺設,還有將洛克人去背剩人物本身,有向左、向右跑動以及向左

跳和向又跳的動作圖示。

1.2. 今天計畫的部分:

  今天計劃的部分是將洛克人能成功在限定的範圍內左右跑動,以及向

左和向右的方向正確,在來就是能使遊戲中途暫停及再度開始,

1.3. 可能會遇到的問題,及可能的解決方法

  之後可能遇到的問題是,當人物漸漸向上移動時,上方的長方形也會

慢慢出現,但要如何讓洛克人成功的站在每條方塊上,以及移動和跳動。

2. 目前期中作品的進度圖





week08,hw08

1. 請寫下以下資料:
1.1. 你之前完成了什麼?
之前完成了
1.時間計時的功能
2.炸彈設置個數功能
3.版面大致格式與計畫

1.2. 你今天計畫要做什麼?
1.版面美化
2.成功與失敗提示語
3.簡單可以跑的只有1個炸彈
4.重新restart功能鍵(R)
5.假設炸彈設定


1.3. 可能會遇到的問題... (及可能的解決方法)
1.炸彈隨機的問題
利用具有random的函示來解決

2.提示周圍炸彈個數
已有借書,想透過書上的既定程式語法
將其函式轉換到processing可以應用 加油!

3.音樂放置仍有疑問
下次前一定要突破


2. 請把你目前期中作品的進度貼出來
 
 

目前完成進度
1.版面美化完成
2.預設炸彈完成
3.可放置炸彈
4.RESTART鍵功能OK
5.輸跟贏 視窗顯示語 OK
6.計時功能更新 OK

心得
今天做了不少功能,踩地雷大致也有個樣子了
不過還有幾個功能需要突破,希望挑戰可以一一迎刃而解,加油!





Week08, HW08,

1. 請寫下以下資料:
1.1. 你之前完成了什麼?
     素材 :
     覺得之前的背景圖貼來貼去很不好看,所以換了一張背景圖,我們遊戲名稱也出來了
 a. 第一個場景圖  

b.第二個場景圖

c.主角貓



1.2. 你今天計畫要做什麼?
       看下play鍵可以跳到另一個遊戲畫面
        做出繩子,偵測是否有碰到繩子
1.3. 可能會遇到的問題... (及可能的解決方法)
     
2. 請把你目前期中作品的進度貼出來
 
 
 
PImage bk,cat,cat1;
int now=1,x=0,y=0;
int jumpH=0; //跳的高度
int mx=500,my=500;
void setup(){
  size(1200,800);  //視窗大小
  bk=loadImage("bk.jpg"); //背景圖
  cat=loadImage("bk2.png");  //背景2
  cat1=loadImage("cat.png");  //跳跳人
  fill(237,28,36); //紅
  rect(0,0,328,123);
}
void show1(){
  image(cat,0,0);
}
void show2(){
  image(bk,0,0);
}
void draw(){
  if(now==1){
    show1();
    if(mouseX>780 && mouseX<1115 && mouseY>250  && mouseY<379 && mousePressed){
    now=2;
    }
  }
  if(now==2){
    show2();
 
if(jumpH>0){
       jumpH=jumpH-10;
       my-=10;
     }
     if(my<500){
       my+=5;
     }
    image(cat1,mouseX,my,138,235); //讓跳跳人跟著滑鼠X移動
  }
}
void mouseClicked() //按下滑鼠左鍵
{
    jumpH=200 - (500-my); //就跳起
 }
 



week02,hw02

1.
size(600,600);
for(int i=0;i<50;i++)
{
fill(random(255),random(255),random(255));
rect(random(500),random(255),random(500),random(255));
}
2.
size(500,500);
for(int i=0;i<50;i++)

    for(int k=0;k<50;k++)
    {   
        fill(i*220/20,k*200/20,i*200/16);
        rect(i*10,k*10,  50,30);
    }
}

3.
size(500,500);
for(int i=0;i<5;i++){
  for(int k=0;k<5;k++){
    fill(i*255/2,k*255/3,50);
    ellipse(i*100+50,k*100+50,  100,100);
    fill(255,255,255);
    ellipse(i*100+50,k*100+50,  80,50);
    fill(0,0,0);
    ellipse(i*100+50,k*100+50,  20,50);
  }
}

4.
因為第三週才加入課程,花了一些時間理解前兩個作業,抱歉太晚補交作業了。
原來迴圈可以這樣玩,真的是像萬花筒一樣,在完成程式碼之後總是期待執行的那一刻會出現怎樣的圖: )

week8 hw8

未完成 : 計分、背景音樂、跳繩加快、有其他貓會加入玩、選擇角色
有想過要不要把"有其他貓會加入玩" 改成 吃"天空掉下來的魚會加分吃到垃圾會扣分沒吃到魚也會扣分" 

//*****變數宣告*****
PImage s2,cat1,s1,s3;//圖片空間 
float y = 450;//跳繩y變數
int now=1;//改變場景要用到的變數
int jumpH=0; //喵跳的高度
int mx=400,my=400;//喵的位子
boolean stop = false; //遊戲暫停會用到
int score =0; //計算得分會弄到
//*****設定*****
void setup() {
  size(900, 600);//視窗大小
  s2=loadImage("bk.jpg");//場景2 
  s1=loadImage("bk2.png");  //場景1
  s3=loadImage("s3.jpg"); //場景3
  cat1=loadImage("cat.png");  //跳跳人
  float yrope = 100;
  fill(237,28,36); //紅
  rect(0,0,328,123);
  
}
//*****開始畫****  
void draw() {
  image(s2,0,0);
  if (stop == false) { 
  l();
  jump(); 
  }
  //按Enter鍵休息
  if (keyPressed) {
  stop = true;
  fill(0);
  textSize(150);
  text("STOP", 250, 300);
  }else stop = false;
  if(mouseX>622 && mouseX<895 && mouseY>96  && mouseY<130 && mousePressed){
  now=3;
  }
}
//*****跳跳繩的繩******
void l(){
  fill(255,0,128);
  y= y + 1.5;  //若想讓跳繩越跳越快,可以從這裡改,把1.5改成變數
  if (y > 600)  y = 350;
  strokeWeight(10);
  fill(255,0,128);
  line(0,y,width,y);
}
//*****跳和場景變換*****
void jump(){
  if(now==1){
    show1();
  if(mouseX>593 && mouseX<836 && mouseY>188  && mouseY<273 && mousePressed){
    now=2;
    }
  }
  if(now==2){
    show2();
    if(jumpH>0){
      jumpH=jumpH-10; 
      my-=10;
     }
    if(my<400){
      my+=5;
     }
    image(cat1,mouseX,my,138,235); //讓跳跳人跟著滑鼠X移動
  }
  if(now==3){
  show3();
  }
}
void show1(){
  image(s1,0,0);
}
void show2(){
  //有手指指標
  if (mousePressed == true) {
    noCursor();
  } else {
    cursor(HAND);
  }
}
void show3(){
  image(s3,0,0);
  fill(0);
  textSize(50);
  text("cheer up !", 300, 200);
  textSize(150);
  text(score, 360, 350);
}
//*****當按下滑鼠左鍵******

void mouseClicked()
{
    jumpH=100 - (200-my); //就跳起
}


場景1

場景2
場景3

角色1

角色2

week01,hw01

1.http://www.youtube.com/watch?v=TAVbWKGUDiU
2size(772, 443);  //視窗大小
background(210); //背景
fill(0,0,0); //耳朵(外)
ellipse(200, 221,120, 120); //(x,y,寬,高)
fill(255,255,255); //耳朵(內)
ellipse(200, 221, 90, 90); //(x,y,寬,高)
fill(0,0,0); //耳朵(外)
ellipse(397, 221,120, 120);
fill(255,255,255); //耳朵(內)
ellipse(397, 221, 90, 90);
fill(0,0,0); //臉(外)
ellipse(300, 300,190, 190);
fill(255,255,255); //臉(內)
ellipse(300, 300, 165, 165);
fill(0,0,0); //黑色眼睛
ellipse(267, 273, 20, 30); //(x,y,寬,高)
fill(0,0,0); //黑色眼睛
ellipse(333, 273, 20, 30); //(x,y,寬,高)
noStroke();
//stroke(10);
fill(255,0,0); //嘴巴紅色部分
ellipse(300, 320,80, 80);
fill(255,255,255); //嘴巴白色部分
ellipse(300,310,80,62);
fill(0,0,0); //鼻子
ellipse(300,310,25,18);


Week08,Hw08

1.1加上手指可以戳泡泡及會游動的魚
1.2加上背景音樂及戳到泡泡時的音效
1.3如何讓泡泡一直不停出現...用回圈寫寫看能不能讓泡泡一直出現

2.1
int popox=0,popoy=0;
int fishx=0,fishy=0;

PImage popo;
PImage finger;
PImage bobo;
PImage back;
PImage fish;
void setup()
{
  size(800,600);
  fish=loadImage("fish.png");
  bobo=loadImage("bobo.png");
  finger=loadImage("finger.png");
  popo=loadImage("popo.png");
  back=loadImage("back.jpeg");
}

void draw()
{
// background(255,255,255);

  
 image(back,0,0);
  image(bobo,250,100);
  popoy-=0.05;
  image(popo,popox+300,popoy+600,100,100);
  popoy-=0.05;
  image(popo,popox+200,popoy+500,100,100);
   popoy-=0.05;
  image(popo,popox+100,popoy+700,100,100);
  popoy-=0.05;
  image(popo,popox+500,popoy+600,100,100);
  
    popoy-=0.05;
  image(popo,popox+300,popoy+1500,100,100);
  popoy-=0.05;
  image(popo,popox+200,popoy+1400,100,100);
   popoy-=0.05;
  image(popo,popox+100,popoy+1300,100,100);
  popoy-=0.05;
  image(popo,popox+500,popoy+1200,100,100);
  
    popoy-=0.05;
  image(popo,popox+300,popoy+1600,100,100);
  popoy-=0.05;
  image(popo,popox+200,popoy+1500,100,100);
   popoy-=0.05;
  image(popo,popox+100,popoy+1700,100,100);
  popoy-=0.05;
  image(popo,popox+500,popoy+1600,100,100);
  
  popoy--;
  image(popo,popox+300,popoy+800,100,100);
  popoy--;
  image(popo,popox+200,popoy+1000,100,100);
   popoy--;
  image(popo,popox+100,popoy+700,100,100);
  popoy--;
  image(popo,popox+500,popoy+1200,100,100);
  
      popoy-=0.05;
  image(popo,popox+300,popoy+2200,100,100);
  popoy-=0.05;
  image(popo,popox+200,popoy+1900,100,100);
   popoy-=0.05;
  image(popo,popox+100,popoy+2000,100,100);
  popoy-=0.05;
  image(popo,popox+500,popoy+1000,100,100);
  
      popoy-=0.05;
  image(popo,popox+400,popoy+2000,100,100);
  popoy-=0.05;
  image(popo,popox+600,popoy+2300,100,100);
   popoy-=0.05;
  image(popo,popox+500,popoy+2400,100,100);
  popoy-=0.05;
  image(popo,popox+500,popoy+2600,100,100);
  
        popoy-=0.05;
  image(popo,popox+100,popoy+2000,100,100);
  popoy-=0.05;
  image(popo,popox+300,popoy+2300,100,100);
   popoy-=0.05;
  image(popo,popox+200,popoy+2400,100,100);
  popoy-=0.05;
  image(popo,popox+100,popoy+2600,100,100);
  
  image(finger,mouseX-30,mouseY-30,60,60);
  
  fishx++;
  image(fish,fishx,fishy+200);
  
}

2.2

Week08, HW08

(1) 之前完成的進度

a. 調整俄羅斯方塊介面設計
b. 用鍵盤控制方向 ( ↑、↓、←、→ )


(2) 第 8 周預期完成進度

a. 每個方塊的旋轉狀態用陣列去宣告
b. 方塊在二維陣列中怎麼和背景貼齊
c. 預計用的背景圖


 










(3) 遇到的問題及可能的解決方法

  a 問題:
           在方塊創立時已經使用二維陣列宣告,
           也把1、0放進去 if 做判斷,
           但是方塊沒有依照1的位置正確填色
           譬如說我的二維陣列是

                      int nts[][]={{0,0,1,0},
                                       {0,1,1,0},
                                       {0,1,0,0},
                                       {0,0,0,0}};


                     for(int a=0;a<4;a++){
                       for(int b=0;b<4;b++)
                      if(nts[a][b]==1){
                      fill(91,0,183);
                      rect(a,b,20,20);

          在呼叫進draw時,只出現一個 rect ,
          正常應該是要由四個 rect 拼成一個 N型的方塊類型。

發現並解決: 
          在 rect 的座標軸要加一個位置值,他就出現 N 型方塊種類
           rect(a*20+320,b*20,20,20);



    b.問題:
             七個俄羅斯的方塊種類 已經設定完畢
              在map (陣列地圖) 的初始值也設定ok

              可是我在draw中隨機呼叫俄羅斯的種類時遇到了問題

              隨機呼叫就是 任意種類的俄羅斯方塊被我呼叫進map中
              利用swich的方式,雖然把所有方塊類型都有亂數跑出來
              但是亂數停不了,所有的方塊在map中都是一閃一閃的

          k=round(random(0)); 
          println(k);

          if(k>=0){
          switch(k){
          case 0:
          translate(110,0+(s/500)*20);
          Lt(270,0,20,20);
          break;
          case 1:
          It(270,0,20,20);
          break;
          case 2:
          Wt(270,0,20,20);
           break;
           case 3:
           Nt(270,0,20,20);
           break;
           }}
          

發現並解決:
             目前還沒有找到方法可以解決這個問題
  


(4)心得:

           在這幾週試著去處理俄羅斯方塊遇到的問題
       發現其實俄羅斯方塊還需要解決的問題還很多
       但是希望我們未來遇到的問題能順利的解決
       在這上面得到成就感



Week08, HW08

作業8-1.1:之前完成了甚麼?
    已解決了分數無法顯示的問題
    雞蛋上拋的效果(仍有小問題)

作業8-1.2:今天計畫要做甚麼?
     1.籃子移動的效果,隨機的速度和起始位置
     2.完全解決雞蛋上拋的問題
     3.判斷雞蛋是否正確落到籃子上
     4.分數增加的動作
     5.雞蛋落下使生命減少

作業8-1.3:可能會遇到的問題
     (1)籃子移動的運算式
     (2)問題2:雞蛋位置的判斷

作業8-2:今日進度:

week7 HW7


import processing.video.*;
Capture video;
void setup(){
size(640,480,P2D);
video = new Capture(this, width, height);
video.start();
loadPixels();
}
void draw(){
if(video.available()){
video.read();
video.loadPixels();
for(int i=0;i<640*480;i++){
pixels[i]=video.pixels[i];
}
updatePixels();
}
}
最短視訊碼

HW08, Week08, 葉正聖老師示範

1. 請寫下以下資料:
1.1. 你之前完成了什麼?
1.2. 你今天計畫要做什麼?
1.3. 可能會遇到的問題... (及可能的解決方法)

2. 請把你目前期中作品的進度貼出來


示範時間 : 老師示範一些期中作品,如果是老師,會怎麼實作。