{"id":129533,"student_id":10,"content":"setBackdrop('bg.png'); //設定背景圖\nvar maze = createSprite('1.png', '2.png', '3.png', '4.png', 'youwin.png'); //遊戲關卡\nvar wheel = createSprite('wheel.png'); //轉盤\nvar t1 = createSprite('t1.png'); //紅色目標\nvar t2 = createSprite('t2.png'); //黃色目標\nvar t3 = createSprite('t3.png'); //藍色目標\nvar t4 = createSprite('t4.png'); //綠色目標\nvar player = createSprite('player.png'); //發光ㄉ小精靈\n\nvar active = false; //是否開始跟隨滑鼠\nvar count = 0; //計時器\n\nt1.moveTo(1200, 900);\nt2.moveTo(0, 900);\nt3.moveTo(1200, 0);\nt4.moveTo(0, 0);\nplayer.moveTo(50, 50);\n\ncreateSound('bgm.mp3', true); //不斷播放背景音樂\n\nforever(loop); //不斷重複執行遊戲迴圈\n\n// 遊戲迴圈\nfunction loop () {\n\n wheel.direction = wheel.direction + 1;\n t1.direction = t1.direction - 0.2;\n t2.direction = t2.direction - 0.2;\n t3.direction = t3.direction - 0.2;\n t4.direction = t4.direction - 0.2;\n\n //如果開始跟隨模式,就不斷設定玩家位置到滑鼠位置\n if (active == true) {\n player.x = cursor.x;\n player.y = cursor.y;\n count = count + 1; //移動中才會計時\n }\n //如果玩家碰到滑鼠\n if (player.touched(cursor) == true) {\n active = true; //開始跟隨滑鼠\n }\n if (player.touched(t1) == true) {\n maze.costumeId = 1; //切換到第二關\n }\n if (player.touched(t2) == true) {\n maze.costumeId = 2; //切換到第三關\n }\n if (player.touched(t3) == true) {\n maze.costumeId = 3; //切換到第四關\n }\n if (player.touched(t4) == true \u0026\u0026 maze.costumeId == 3) {\n maze.costumeId = 4; //切換到遊戲勝利\n wheel.hidden = true; //隱藏轉盤\n stop(); //停止遊戲\n }\n // 如果玩家碰到地圖或者碰到中間轉盤就重置位置\n if (player.touched(maze) == true || player.touched(wheel) == true) {\n active = false; //停止跟隨滑鼠\n if (maze.costumeId == 0) {\n player.moveTo(50, 50);\n }\n if (maze.costumeId == 1) {\n player.moveTo(1150, 850);\n }\n if (maze.costumeId == 2) {\n player.moveTo(50, 850);\n }\n if (maze.costumeId == 3) {\n player.moveTo(1150, 50);\n }\n createSound('hit.ogg');\n }\n\n var sec = Math.floor(count/60); //遊戲迴圈一秒約執行 60 次\n print('花費時間' + sec + '秒', 500, 30, 'white', 30, 'Comic Sans MS');\n}","created_at":"2020-03-02T17:32:27.737+08:00","updated_at":"2024-01-16T13:35:36.063+08:00","name":"逃離洞窟(完整版)","language":"javascript","screenshot":{"url":"https://cdn1.koding.school/uploads/project/screenshot/129533/d7f72eb85f77b49e3fb4f79f33aa33bb.jpg"},"parent_id":129391,"plugin":"Game.set({\n width: 1200,\n height: 900,\n})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":298,"hashid":"zpes2mv3","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2224044,"file_name":"bgm.mp3","project_id":129533,"asset_id":188533,"created_at":"2020-03-02T17:32:27.771+08:00","updated_at":"2020-03-02T17:32:27.771+08:00"},{"id":2224045,"file_name":"hit.ogg","project_id":129533,"asset_id":188534,"created_at":"2020-03-02T17:32:27.772+08:00","updated_at":"2020-03-02T17:32:27.772+08:00"},{"id":3115773,"file_name":"1.png","project_id":129533,"asset_id":202094,"created_at":"2020-08-20T13:04:06.280+08:00","updated_at":"2020-08-20T13:04:06.280+08:00"},{"id":3115774,"file_name":"2.png","project_id":129533,"asset_id":202095,"created_at":"2020-08-20T13:04:06.282+08:00","updated_at":"2020-08-20T13:04:06.282+08:00"},{"id":3115783,"file_name":"t4.png","project_id":129533,"asset_id":202103,"created_at":"2020-08-20T13:04:09.337+08:00","updated_at":"2020-08-20T13:04:09.337+08:00"},{"id":3115784,"file_name":"wheel.png","project_id":129533,"asset_id":202104,"created_at":"2020-08-20T13:04:09.339+08:00","updated_at":"2020-08-20T13:04:09.339+08:00"},{"id":3115779,"file_name":"player.png","project_id":129533,"asset_id":202099,"created_at":"2020-08-20T13:04:08.313+08:00","updated_at":"2020-08-20T13:04:08.313+08:00"},{"id":3115780,"file_name":"t1.png","project_id":129533,"asset_id":202100,"created_at":"2020-08-20T13:04:08.314+08:00","updated_at":"2020-08-20T13:04:08.314+08:00"},{"id":3115781,"file_name":"t2.png","project_id":129533,"asset_id":202101,"created_at":"2020-08-20T13:04:08.940+08:00","updated_at":"2020-08-20T13:04:08.940+08:00"},{"id":3115782,"file_name":"t3.png","project_id":129533,"asset_id":202102,"created_at":"2020-08-20T13:04:08.942+08:00","updated_at":"2020-08-20T13:04:08.942+08:00"},{"id":3115785,"file_name":"youwin.png","project_id":129533,"asset_id":202105,"created_at":"2020-08-20T13:04:10.371+08:00","updated_at":"2020-08-20T13:04:10.371+08:00"},{"id":3115777,"file_name":"bg.png","project_id":129533,"asset_id":202097,"created_at":"2020-08-20T13:04:07.817+08:00","updated_at":"2020-08-20T13:04:07.817+08:00"},{"id":3115778,"file_name":"gameover.png","project_id":129533,"asset_id":202098,"created_at":"2020-08-20T13:04:07.818+08:00","updated_at":"2020-08-20T13:04:07.818+08:00"},{"id":3115775,"file_name":"3.png","project_id":129533,"asset_id":251339,"created_at":"2020-08-20T13:04:07.350+08:00","updated_at":"2020-08-20T13:04:07.350+08:00"},{"id":3115776,"file_name":"4.png","project_id":129533,"asset_id":202096,"created_at":"2020-08-20T13:04:07.352+08:00","updated_at":"2020-08-20T13:04:07.352+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦