{"id":18995441,"url":"https://github.com/shiritai/cocos-creator-mario","last_synced_at":"2025-09-06T06:32:31.720Z","repository":{"id":170371601,"uuid":"645518213","full_name":"Shiritai/cocos-creator-mario","owner":"Shiritai","description":"A Mario game implemented using Cocos Creator, deployed on firebase","archived":false,"fork":false,"pushed_at":"2023-05-28T23:23:07.000Z","size":7913,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-04-06T23:13:54.922Z","etag":null,"topics":["cocos-creator","firebase","mario","typescript","web-game"],"latest_commit_sha":null,"homepage":"https://mario-shiritai.web.app/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Shiritai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-25T20:52:05.000Z","updated_at":"2025-03-05T19:35:00.000Z","dependencies_parsed_at":"2023-07-10T17:15:12.182Z","dependency_job_id":null,"html_url":"https://github.com/Shiritai/cocos-creator-mario","commit_stats":null,"previous_names":["shiritai/cocos-creator-mario"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Shiritai/cocos-creator-mario","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shiritai%2Fcocos-creator-mario","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shiritai%2Fcocos-creator-mario/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shiritai%2Fcocos-creator-mario/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shiritai%2Fcocos-creator-mario/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shiritai","download_url":"https://codeload.github.com/Shiritai/cocos-creator-mario/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shiritai%2Fcocos-creator-mario/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273867384,"owners_count":25182423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cocos-creator","firebase","mario","typescript","web-game"],"created_at":"2024-11-08T17:30:35.398Z","updated_at":"2025-09-06T06:32:30.886Z","avatar_url":"https://github.com/Shiritai.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Software Studio 2023 Spring Assignment 2\n\n## Deploy link\n\n* Newest: [https://mario-shiritai.web.app/](https://mario-shiritai.web.app/)\n* Old version: [https://ss-assignment2-mario.web.app/](https://ss-assignment2-mario.web.app/)\n\n### Scoring\n\n|  **Basic Component**  | **Score** | **Check** |\n| :-------------------: | :-------: | :-------: |\n| Membership Mechanism  |    10%    |     Y     |\n| Complete Game Process |    5%     |     Y     |\n|      Basic Rules      |    45%    |     Y     |\n|      Animations       |    10%    |     Y     |\n|     Sound Effects     |    10%    |     Y     |\n|          UI           |    10%    |     Y     |\n\n|           **Advanced Component**            | **Score** | **Check** |\n| :-----------------------------------------: | :-------: | :-------: |\n|                Leader board                 |    5%     |     Y     |\n|          Offline multi-player game          |    5%     |     Y     |\n|          Online multi-player game           |    15%    |     N     |\n|                Eatable Coin                 |   1-15%   |     Y     |\n|               Continuous jump               |   1-15%   |     Y     |\n|              3 types of enemy               |   1-15%   |     Y     |\n|                Heal mushroom                |   1-15%   |     Y     |\n|           Hidden path for stage 2           |   1-15%   |     Y     |\n|            Multi-depth box logic            |   1-15%   |     Y     |\n|    Customized number of offline players     |   1-15%   |     Y     |\n|              Player name label              |   1-15%   |     Y     |\n| Mario invincible state when reborn/got hurt |   1-15%   |     Y     |\n|                 Pause game                  |   1-15%   |     Y     |\n|                Restart game                 |   1-15%   |     Y     |\n|               Volume control                |   1-15%   |     Y     |\n\n---\n\n## Basic Components Description\n\n### World map\n\n地圖有二，皆有下列物件與一定程度的美術設計。\n\n* 玩家 (Mario): 瑪利歐，於單人模式下有一位，離線多人至多可有四位\n  ![離線多人遊戲畫面](./img/multiplayer.png)\n* 前後景: 雲海、小雲、草叢、珊瑚、小山丘、黑幕、不同外觀的地面等\n* 固定物件: 地面、遊戲邊界 (不可見)、木磚、三種未知磚 (Question Box/Block)、大木盒、花筒\n* 固定特殊物件\n  * 通關旗幟\n    ![Stage 1 截圖](./img/flag.png)\n  * 金幣\n    ![Stage 1 截圖](./img/coin.png)\n  * 具深度的盒子，橘、藍、綠三色皆然\n    ![Stage 1 截圖](./img/distBox.png)\n  * (Stage 2) 隱藏通道\n    ![Stage 2 截圖](./img/hiddenPath.png)\n* 敵人\n  * Goomba\n  * Turtle\n  * Flower\n\n由於 Stage 2 (第二關) 應較 Stage 1 (第一關) 難，故第二關地圖較長，機關也較多，進一步提升美術和遊戲性。以下針對美術與遊戲性的部分列舉說明。\n\n* 木磚人形排列\n  ![image](./img/human.png)\n* 隱藏通道相關\n  * 前景提示其存在 (見上圖右方)\n  * 前景引導玩家中陷阱 (搭配攝影機的性質)\n  ![image](./img/hiddenPath.png)\n* 敵人池\n  ![image](./img/enemyPool.png)\n* 天降神兵\n  ![image](./img/downEnemy.png)\n  這有點難截圖，圖中靠近花的一個 goomba 和 turtle 是從天而降的。\n  \n### Player\n\n目前實作離線單人與多人，多人定義為 1 ~ 4 人，可於階段選擇時設定。\n\n四位玩家中，除了主玩家 (登入帳號的那位) 外，其他皆命名為 `PlayerX`，X 為從 1 開始的編號。原則上與登入帳號之 Firebase 同步，這有利於擴展為多人連線遊戲。\n\n四位玩家操控按鍵列述如下 (左、上、右、focus)，盡量讓四位玩家的手不會打架的情況下易於點按。\n\nFocus 目的是讓攝影機跟隨某位瑪利歐，預設跟隨登入帳號者。\n\n* 主玩家: `AWDS`\n* player 1: `GYJH`\n* player 2: `LP\":`\n* player 3: `LEFT UP RIGHT DOWN`\n\n這些玩家將共用生命、時間、金幣數與分數，且只有當所有玩家都抵達終點才算獲勝，這樣對 Ranking 比較公平，讓多人離線不要過於佔優。也由於以支援多人連線為目標，加上為了讓瑪利歐玩起來更流暢，所以對部分邏輯做調整，列述如下:\n\n* 顯示玩家名稱於瑪利歐頭頂\n* 單一一位瑪利歐 Power up/down 停止畫面，不然會降低其他玩家的遊戲體驗\n* 死亡時不會停止並切換畫面，而是運鏡至玩家重生處\n* 支援長按連跳，也就是可以一直按著向上鍵，不斷地上下跳\n* 支援牛頓第二運動定律的左右移動，會越走越快，直到瑪利歐速度上限\n* 支援瑪利歐跑步煞車動畫 (逆向高速)，與掉頭 (逆向低速)、行走 (順向) 動畫一同實現流暢轉身動畫\n* 支援重生、Power up 後受敵人攻擊時的暫時 (2 秒) 無敵效果 (含閃爍動畫)，敵人觸碰無敵狀態下的瑪利歐不會死亡，不過會受瑪利歐的踩踏攻擊\n* 單人模式下死亡會重置時間，多人下死亡則不會。\n\n### Enemies\n\n敵人有三，特色列敘如下。\n\n* Goomba\n  * 平時左右定速移動，遇障礙物時掉頭 (行走動畫)\n  * 橫向觸碰玩家時玩家受傷\n  * 受玩家踩踏攻擊時死亡，會加分 (死亡動畫)\n* Turtle\n  * 平時左右定速移動，遇障礙物時掉頭 (行走動畫)\n  * 橫向觸碰玩家時玩家受傷\n  * 受玩家踩踏攻擊時縮進龜殼，會加分 (龜縮動畫)\n  * 再次受玩家踩踏、觸碰時，根據碰撞方向推動龜殼，會加分 (龜殼移動、旋轉動畫)\n  * 旋轉中的龜殼\n    * 受玩家踩踏可改變其方向，會與障礙物互動\n    * 將橫掃所有橫向觸碰的玩家與敵人\n      * 碰到玩家相當於受傷\n      * 碰到敵人將擊落並得分\n* Flower\n  * 花筒本身為障礙物，從中食人花會間歇地出現\n  * 觸碰到玩家即讓玩家受傷\n\n### Question Blocks\n\nQuestion Block/Box 有三種，透過玩家向上敲擊產生物件，會得分、播放被敲擊動畫與音效。產生的物件列敘如下。\n\n* 金幣\n* 升級蘑菇\n  * 玩家向上敲擊後向上產生紅蘑菇，產生動畫播出時不會被吃掉\n  * 隨後向左移動，此時受物理引擎左右，與玩家和敵人不會發生物理效果\n  * 玩家觸碰後變大 (貼圖與剛體皆然，含動畫與音效)，紅蘑菇消失並加分\n  * 蘑菇走出邊界即消失\n* 回血蘑菇\n  * 玩家向上敲擊後向上產生綠蘑菇，產生動畫播出時不會被吃掉\n  * 隨後向左移動，此時受物理引擎左右，與玩家和敵人不會發生物理效果\n  * 玩家觸碰後玩家共用之血量增加一，綠蘑菇消失並加分\n  * 蘑菇走出邊界即消失\n\n### Animations\n\n####  Mario\n\n玩家基本上有五個動畫。\n\n* 閒置\n* 移動\n* 跳躍\n* 煞車\n* 轉身\n\n又由於分 power up 與否兩種，故有十個動畫。外加下列主要由腳本實現之動畫:\n\n* 死亡動畫\n* Power up 動畫\n* Power down 動畫\n* 無敵狀態動畫\n\n共 14 個。\n\n#### 敵人\n\n* Goomba\n  * 左右移動\n  * 死亡\n* Turtle\n  * 左右移動\n  * 龜縮\n  * 龜縮旋轉\n* Flower\n  * 上下移動\n\n#### 其他\n\n* 金幣旋轉動畫\n* Question Box 問號跑馬燈動畫\n* 蘑菇生成動畫\n\n### Sound effects\n\n#### BGM\n\n* 主選單、登入、註冊畫面、關卡選擇等使用 `bgm_1`\n* 關卡一使用 `bgm_2`\n* 關卡二使用 `bgm_2`\n\n#### 瑪利歐本身\n\n* 跳躍\n* 踩敵人的踢擊\n* Power up\n* Power down\n* 失去一條命\n\n#### 關卡音效\n\n* 吃金幣\n* 生成蘑菇\n* 通關\n\n### UI\n\n畫面切換流程為\n\n* Menu\n  ![image](./img/menu.png)\n* -\u003e Login/Sign up\n  |login|sign up|\n  |:-:|:-:|\n  |![image](./img/login.png)|![image](/img/signup.png)|\n* -\u003e 關卡選擇\n  ![image](./img/chooseStage.png)\n* -\u003e 關卡起始畫面\n  ![image](./img/start.png)\n* -\u003e 關卡 (圖略)\n* -\u003e 勝利/失敗換畫面\n  |win|game over|\n  |:-:|:-:|\n  |![image](./img/login.png)|![image](/img/signup.png)|\n* -\u003e 關卡選擇 (圖略)\n\n當中 Menu 選擇 Login/Sign up 後可透過關閉按鈕切回 Menu。\n\n在關卡選擇中可預覽當前玩家的名稱、生命、金幣和最高分數。另可點擊 Question Box 查看玩法、星型按鈕查看 leader board。\n\n|查看玩法|Leader board|\n|:-:|:-:|\n|![image](./img/howToPlay.png)|![image](/img/leaderBoard.png)|\n\n兩關卡主按鈕左方分別有個副按鈕，為離線多人模式的進入點。\n\n![image](./img/chooseStage.png)\n\n進入遊戲畫面後，UI 會顯示玩家所處的關卡、生命、剩餘時間、金幣和當前分數。\n\n![image](./img/human.png)\n\n## Advanced Component Description\n\n### Leader board\n\nLeader board 如 UI 中所述，以星型按鈕查看 leader board。當中對每個玩家只會紀錄最高分，由上而下排序，共顯示五名。\n\n![image](/img/leaderBoard.png)\n\n### Offline Multi-player game\n\n前面描述過離線多人的功能，這裡僅簡單摘要。\n\n* 1 ~ 4 人，共享生命、金幣、剩餘時間、分數。\n* 除登入之主玩家的瑪莉歐頭上有註冊時的名稱外，其餘玩家以 `player` 搭配流水號命名\n* 所有人都到終點才算勝利\n* 攝影機只會追蹤一位玩家，增加遊戲難度並降低多人分數優勢\n* 某玩家 power up/down 或死亡不會停頓或轉移至載入畫面，而是繼續進行，增加其他玩家的遊戲體驗\n\n### Eatable coin\n\n兩關都有可以直接吃的金幣，有音效與動畫。\n\n### Continuous jump\n\n所有瑪利歐都可以連續跳，也就是長按跳躍鍵可不斷嘗試跳躍。\n\n### 3 types of enemy\n\n有 Goomba、Turtle 和 Flower 三種敵人。\n\n### Heal mushroom\n\nQuestion Box 有三種，除金幣和 power up 的蘑菇外，多一個回血蘑菇。\n\n### Hidden path for stage 2\n\n第二關有隱藏通道，幫助玩家度過困難區域，還有騙玩家離開隱藏通道的美術設計。\n\n### Multi-depth box logic\n\n兩關都實作有縱深的箱子 (紅、綠、藍色箱)。\n\n### Customized number of offline players\n\n多人離線模式可指定 1 ~ 4 為不定數的玩家。\n\n\u003e 其實可以再更多，不過鍵盤按鍵對更多玩家不友善。\n\n### Player name label\n\n玩家名稱顯示在玩家頭上，不會跟其他瑪利歐搞混。\n\n### Mario invincible state when reborn/got hurt\n\n瑪利歐受傷或重生時會進入兩秒的無敵模式，免得一死再死，或者重生時直接撞到敵人的尷尬情境。\n\n### Pause Game\n\n右上角暫停按鈕可已暫停遊戲，再按一次可以繼續。\n\n### Restart Game\n\n右上角重置按鈕可已重新玩遊戲 (若為多人模式依然以多人模式重新開始)。\n\n### Volume control\n\n右上角橘色音樂按鈕可增加音量，右上角白色音樂按鈕可降低音量。\n\n# Firebase page link\n\n[https://ss-assignment2-mario.web.app/](https://ss-assignment2-mario.web.app/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiritai%2Fcocos-creator-mario","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshiritai%2Fcocos-creator-mario","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiritai%2Fcocos-creator-mario/lists"}