Construct 2教學| 停車!(下)
Stop The Car/20180128-0204/免洗No.2 網址連結Link

上集目錄:
鎖定視窗大小、無限捲動、自動前進、飛行、動畫銜接、下蛋攻擊、衝撞攻擊、攻擊冷卻、重設位置、隨機怪物、整數亂數
這集目錄:
flash受擊閃爍、車子血量、OK蹦、image point、車子受擊、發射子彈、車子飛行、隨機攻擊模式、怪物死亡、暫停、淡入、車子死亡、接下一關、怪物全滅、通關、靜音
加進去後就能使用flash功能,當中能設定閃的速度時間等

車子血量與OK蹦
先隨便決定要打多少次才會死,之後也還能改

OK蹦直接放在想讓它出現的地方,設成invisible

在車減少到幾滴血後OK蹦出現

image point
OK蹦只是出現的話會停在原地不動,想讓它更活潑跟著車子晃動的話能使用這個做法
先在中心點的視窗中增加image points(1,2分別是兩邊的ok蹦),設定方式跟中心點一樣

every tick, set position to another object->car->image point 1

車子受擊
subtract是減的意思,之前不知道都用add -1,都可以就是了
29//蛋一樣讓它破掉
35,46//粉和蝸加上正在播放攻擊動畫的條件

發射子彈
隨機2.5到6秒,播放攻擊動畫同時生成子彈,播了1.2秒攻擊後回到待機
每一幀移動子彈,碰到地板破壞


車子飛行、隨機攻擊模式
其實就是隨機怪物和冷卻時間的合體
然後車子飛完全是動畫弄的,沒碰到一丁點程式O:)


att設在10只是為了移開0,1,2,防止動畫沒播完就卡到另一個

碰到車子或子彈時播放死亡動畫、取消和紫塊的碰撞(Enable/disable collisions)、設為死亡

播兩秒死亡後,座標設回畫面外並invisible

我比較機車一點想讓它死了就永久死亡,所以設成當怪物死了後如果骰到它就重骰

以上做法芒果籽和蝸牛也依樣畫葫蘆


按下esc後set time scale-> 1-timescale, set value-> 1-STOP,就能達成兩個狀態的切換

將要但淡入的圖片透明度設成0

車子死了又是一二關時,每一幀透明度+5

車子死亡、接關
87//死了就停止背景捲動,播放死亡動畫,停一下後讓下一關淡入出現、設定下一關的血量
88//當下一關圖示淡入到透明度達到100,趁此時將所有東西重設和更換背景
89//按下右鍵下一關圖示淡出,其他東西則如之前執行並輪迴

第二關的設置也如第一關這樣




程式都是類似的東西,就直接貼內容啦


每一關因為加速而變化的各種數字(?)

前景的花設法就跟紫塊牆一樣,只差在多了隨機而已


上集目錄:
鎖定視窗大小、無限捲動、自動前進、飛行、動畫銜接、下蛋攻擊、衝撞攻擊、攻擊冷卻、重設位置、隨機怪物、整數亂數
這集目錄:
flash受擊閃爍、車子血量、OK蹦、image point、車子受擊、發射子彈、車子飛行、隨機攻擊模式、怪物死亡、暫停、淡入、車子死亡、接下一關、怪物全滅、通關、靜音
7.車子、碰撞collision
flash受擊閃爍加進去後就能使用flash功能,當中能設定閃的速度時間等

車子血量與OK蹦
先隨便決定要打多少次才會死,之後也還能改

OK蹦直接放在想讓它出現的地方,設成invisible

在車減少到幾滴血後OK蹦出現

image point
OK蹦只是出現的話會停在原地不動,想讓它更活潑跟著車子晃動的話能使用這個做法
先在中心點的視窗中增加image points(1,2分別是兩邊的ok蹦),設定方式跟中心點一樣

every tick, set position to another object->car->image point 1

車子受擊
subtract是減的意思,之前不知道都用add -1,都可以就是了
29//蛋一樣讓它破掉
35,46//粉和蝸加上正在播放攻擊動畫的條件

發射子彈
隨機2.5到6秒,播放攻擊動畫同時生成子彈,播了1.2秒攻擊後回到待機
每一幀移動子彈,碰到地板破壞


車子飛行、隨機攻擊模式
其實就是隨機怪物和冷卻時間的合體
然後車子飛完全是動畫弄的,沒碰到一丁點程式O:)


att設在10只是為了移開0,1,2,防止動畫沒播完就卡到另一個
8.怪物死亡
將怪物身上都加上判斷生死的變數,並在按鍵控制的地方再加上活著的條件
碰到車子或子彈時播放死亡動畫、取消和紫塊的碰撞(Enable/disable collisions)、設為死亡

播兩秒死亡後,座標設回畫面外並invisible

我比較機車一點想讓它死了就永久死亡,所以設成當怪物死了後如果骰到它就重骰

以上做法芒果籽和蝸牛也依樣畫葫蘆
9.暫停
STOP分別設置成背景有捲動和沒捲動的狀態

按下esc後set time scale-> 1-timescale, set value-> 1-STOP,就能達成兩個狀態的切換

10.車子死亡、接下一關
淡入將要但淡入的圖片透明度設成0

車子死了又是一二關時,每一幀透明度+5

車子死亡、接關
87//死了就停止背景捲動,播放死亡動畫,停一下後讓下一關淡入出現、設定下一關的血量
88//當下一關圖示淡入到透明度達到100,趁此時將所有東西重設和更換背景
89//按下右鍵下一關圖示淡出,其他東西則如之前執行並輪迴

第二關的設置也如第一關這樣
11.怪物全滅
MonsterN=3是分別三隻怪物,每死一隻就減一,死光歸零時停止捲動,失敗畫面如下一關那樣淡入,透明度達100按鈕出現,按下按鈕將變更的變數重設回原始狀態
12.通關
基本跟下一關和全滅差不多,不過多了判斷三隻怪物有沒有死,而決定要不要顯示圖片
13.靜音
先依據有沒有聲音來判斷圖示要顯示播放還是靜音,在點擊後進行切換,wait0.1秒一定要用啊~不然會變得完全沒反應呀
14.主畫面
可增加場景來切換會比較方便統整
程式都是類似的東西,就直接貼內容啦

15.剩下的
start of layout要設啊不然會出bug
每一關因為加速而變化的各種數字(?)

前景的花設法就跟紫塊牆一樣,只差在多了隨機而已
