{"id":183185,"student_id":2589,"content":"","created_at":"2020-08-20T11:14:56.444+08:00","updated_at":"2020-08-20T11:15:23.123+08:00","name":"逃離洞窟(完整版)","language":"javascript","screenshot":{"url":null},"parent_id":2,"plugin":"Game.set({\n width: 1200,\n height: 900,\n})\n\nsetBackdrop('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}","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":77,"hashid":"zpes9ykr","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3115449,"file_name":"4.png","project_id":183185,"asset_id":251236,"created_at":"2020-08-20T11:15:08.494+08:00","updated_at":"2020-08-20T11:15:08.494+08:00"},{"id":3115450,"file_name":"3.png","project_id":183185,"asset_id":251237,"created_at":"2020-08-20T11:15:08.499+08:00","updated_at":"2020-08-20T11:15:08.499+08:00"},{"id":3115451,"file_name":"2.png","project_id":183185,"asset_id":251238,"created_at":"2020-08-20T11:15:08.504+08:00","updated_at":"2020-08-20T11:15:08.504+08:00"},{"id":3115452,"file_name":"1.png","project_id":183185,"asset_id":251239,"created_at":"2020-08-20T11:15:08.509+08:00","updated_at":"2020-08-20T11:15:08.509+08:00"},{"id":3115453,"file_name":"t4.png","project_id":183185,"asset_id":251240,"created_at":"2020-08-20T11:15:08.513+08:00","updated_at":"2020-08-20T11:15:08.513+08:00"},{"id":3115454,"file_name":"hit.ogg","project_id":183185,"asset_id":251241,"created_at":"2020-08-20T11:15:08.517+08:00","updated_at":"2020-08-20T11:15:08.517+08:00"},{"id":3115455,"file_name":"bgm.mp3","project_id":183185,"asset_id":251242,"created_at":"2020-08-20T11:15:08.613+08:00","updated_at":"2020-08-20T11:15:08.613+08:00"},{"id":3115456,"file_name":"bg.png","project_id":183185,"asset_id":251243,"created_at":"2020-08-20T11:15:08.629+08:00","updated_at":"2020-08-20T11:15:08.629+08:00"},{"id":3115457,"file_name":"player.png","project_id":183185,"asset_id":251244,"created_at":"2020-08-20T11:15:08.633+08:00","updated_at":"2020-08-20T11:15:08.633+08:00"},{"id":3115458,"file_name":"wheel.png","project_id":183185,"asset_id":251245,"created_at":"2020-08-20T11:15:08.637+08:00","updated_at":"2020-08-20T11:15:08.637+08:00"},{"id":3115459,"file_name":"youwin.png","project_id":183185,"asset_id":251246,"created_at":"2020-08-20T11:15:08.641+08:00","updated_at":"2020-08-20T11:15:08.641+08:00"},{"id":3115460,"file_name":"t1.png","project_id":183185,"asset_id":251247,"created_at":"2020-08-20T11:15:08.645+08:00","updated_at":"2020-08-20T11:15:08.645+08:00"},{"id":3115461,"file_name":"t2.png","project_id":183185,"asset_id":251248,"created_at":"2020-08-20T11:15:08.650+08:00","updated_at":"2020-08-20T11:15:08.650+08:00"},{"id":3115462,"file_name":"t3.png","project_id":183185,"asset_id":251249,"created_at":"2020-08-20T11:15:08.654+08:00","updated_at":"2020-08-20T11:15:08.654+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦