{"id":413086,"student_id":10,"content":"setBackdrop('bg.png'); //設定背景圖\nlet board = createSprite('board.png'); //計分板\nlet koding = createSprite('k_0.png', 'k_1.png', 'k_2.png'); //玩家\nlet info = createSprite('info.png'); //遊戲說明\nlet sight = createSprite('sight.png'); //準星\nlet target = createSprite('t_0.png', 't_1.png', 't_2.png', 't_3.png', 't_4.png', 't_5.png', 't_6.png');\n\nlet score = 0; //分數\nlet clock = 0; //遊戲迴圈執行次數\n\ninfo.hidden = true; //預設隱藏\ntarget.direction = Math.random()*360; //目標物朝向隨機方向\ntarget.stepForward(1000); //目標物向前移動 1000 的距離\ntarget.direction += 180; //目標物 180 度旋轉方向\ntarget.costumeId = Math.floor(Math.random()*7);\n\n// createSound('bgm.mp3');\n\n// 遊戲迴圈\nfunction gameloop () {\n drawText(score, 200, 60, 'white', 50); //顯示攔截數\n \n // 讓準星跟著滑鼠移動\n sight.x = cursor.x;\n sight.y = cursor.y;\n \n // 根據遊戲迴圈次數,切換叩叮的造型\n clock++;\n if (clock % 30 == 0) {\n koding.costumeId = 0;\n }\n \n if (clock % 30 == 15) {\n koding.costumeId = 1;\n }\n \n target.stepForward(5 + score * 0.2);\n \n if (target.touched(koding)) {\n setBackdrop('bg_end.png');\n koding.costumeId = 2;\n stop();\n createSound('fail.mp3');\n }\n}\n\n// 當遊戲場景被點擊時\nfunction clickOnStage () {\n if (target.touched(sight) == true) { //如果目標物碰到準星\n \n score += 1; // 分數加 1\n \n // 當物品被攔截時,創造一個半透明的物品作為紀錄\n let fake = createSprite('t_0.png', 't_1.png', 't_2.png', 't_3.png', 't_4.png', 't_5.png', 't_6.png');\n fake.x = target.x;\n fake.y = target.y;\n fake.direction = target.direction;\n fake.costumeId = target.costumeId;\n fake.opacity = 0.5;\n \n target.x = 600; //移動至水平中央\n target.y = 450; //移動至垂直中央\n target.direction = Math.random()*360;\n target.stepForward(Math.random() * 300 + 1000);\n target.direction += 180;\n target.costumeId = Math.floor(Math.random()*7);\n \n createSound('fired.mp3');\n }\n}\n\non('click', clickOnStage); //遊戲場景被點擊就執行 clickOnStage\nforever(gameloop); //不斷執行遊戲迴圈\n\n","created_at":"2022-07-28T13:20:26.036+08:00","updated_at":"2022-11-29T13:57:10.251+08:00","name":"守護重金屬叩叮(除錯練習 1)","language":"javascript","screenshot":{"url":"https://cdn5.koding.school/uploads/project/screenshot/413086/2cb29e190597106a42ab8c6e527de420.jpg"},"parent_id":2,"plugin":"Game.set({ width: 1200, height: 900 });","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":134,"hashid":"npmszz6vn","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":9245748,"file_name":"fired.mp3","project_id":413086,"asset_id":541432,"created_at":"2022-07-28T13:20:37.928+08:00","updated_at":"2022-07-28T13:20:37.928+08:00"},{"id":9245749,"file_name":"bgm.mp3","project_id":413086,"asset_id":541433,"created_at":"2022-07-28T13:20:37.965+08:00","updated_at":"2022-07-28T13:20:37.965+08:00"},{"id":9245750,"file_name":"sight.png","project_id":413086,"asset_id":541434,"created_at":"2022-07-28T13:20:37.973+08:00","updated_at":"2022-07-28T13:20:37.973+08:00"},{"id":9245751,"file_name":"k_1.png","project_id":413086,"asset_id":541435,"created_at":"2022-07-28T13:20:37.977+08:00","updated_at":"2022-07-28T13:20:37.977+08:00"},{"id":9245752,"file_name":"k_0.png","project_id":413086,"asset_id":541436,"created_at":"2022-07-28T13:20:37.981+08:00","updated_at":"2022-07-28T13:20:37.981+08:00"},{"id":9245753,"file_name":"info.png","project_id":413086,"asset_id":541437,"created_at":"2022-07-28T13:20:37.985+08:00","updated_at":"2022-07-28T13:20:37.985+08:00"},{"id":9245754,"file_name":"board.png","project_id":413086,"asset_id":541438,"created_at":"2022-07-28T13:20:37.989+08:00","updated_at":"2022-07-28T13:20:37.989+08:00"},{"id":9245755,"file_name":"bg.png","project_id":413086,"asset_id":541439,"created_at":"2022-07-28T13:20:37.996+08:00","updated_at":"2022-07-28T13:20:37.996+08:00"},{"id":9245756,"file_name":"bg_end.png","project_id":413086,"asset_id":541440,"created_at":"2022-07-28T13:20:38.006+08:00","updated_at":"2022-07-28T13:20:38.006+08:00"},{"id":9245757,"file_name":"t_0.png","project_id":413086,"asset_id":541441,"created_at":"2022-07-28T13:20:38.010+08:00","updated_at":"2022-07-28T13:20:38.010+08:00"},{"id":9245758,"file_name":"t_2.png","project_id":413086,"asset_id":541442,"created_at":"2022-07-28T13:20:38.014+08:00","updated_at":"2022-07-28T13:20:38.014+08:00"},{"id":9245759,"file_name":"fail.mp3","project_id":413086,"asset_id":541443,"created_at":"2022-07-28T13:20:38.017+08:00","updated_at":"2022-07-28T13:20:38.017+08:00"},{"id":9245760,"file_name":"t_6.png","project_id":413086,"asset_id":541444,"created_at":"2022-07-28T13:20:38.022+08:00","updated_at":"2022-07-28T13:20:38.022+08:00"},{"id":9245761,"file_name":"t_5.png","project_id":413086,"asset_id":541445,"created_at":"2022-07-28T13:20:38.026+08:00","updated_at":"2022-07-28T13:20:38.026+08:00"},{"id":9245762,"file_name":"t_4.png","project_id":413086,"asset_id":541446,"created_at":"2022-07-28T13:20:38.030+08:00","updated_at":"2022-07-28T13:20:38.030+08:00"},{"id":9245763,"file_name":"t_3.png","project_id":413086,"asset_id":541447,"created_at":"2022-07-28T13:20:38.033+08:00","updated_at":"2022-07-28T13:20:38.033+08:00"},{"id":9245764,"file_name":"t_1.png","project_id":413086,"asset_id":541448,"created_at":"2022-07-28T13:20:38.036+08:00","updated_at":"2022-07-28T13:20:38.036+08:00"},{"id":9245765,"file_name":"k_2.png","project_id":413086,"asset_id":541449,"created_at":"2022-07-28T13:20:38.040+08:00","updated_at":"2022-07-28T13:20:38.040+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦