Scratch 實作解法:How to Add a Double Jump in Scratch in Scratch
📌 本頁學習重點
先完成最小可運作版本,確認邏輯正確後再加入美術、音效與關卡變化。 Track remaining jumps in a variable so the player can jump once more mid-air.
核心觀念與實作步驟: Minimal Working Block Recipe
先完成最小可運作版本,確認邏輯正確後再加入美術、音效與關卡變化。
Track remaining jumps in a variable so the player can jump once more mid-air.
Test this minimal version first, then tune numbers like speed, gravity, or timing to match your game feel.
Add a Double Jump in Scratch script
- when touching Ground -> set [jumps left] to 2
- when [space] key pressed
- if (jumps left) 0> then set [y vel] to 13, change [jumps left] by -1
動手試試看: Resets to 2 jumps on the ground and allows 1 extra jump in mid-air.
測試檢查與延伸練習: Debugging Checklist & Next Steps
按下綠旗前先預測結果,並觀察變數與座標數值是否符合預期。
If it behaves unexpectedly, verify initial variable resets on the green flag and check that continuous checks sit inside a forever loop.
測試檢查與延伸練習
按下綠旗前先預測結果,並觀察變數與座標數值是否符合預期。
本指南僅供學習參考。Scratch 介面與使用條款可能會隨版本更新而變動,請一併參考 Scratch 官方網站說明。