{"id":335273,"student_id":10,"content":"//=====================================================\n// 預設程式可能與影片中老師的程式有些不同,\n// 但不會影響到專案製作,\n// 請按照影片中老師的指示完成專案即可。\n//=====================================================\n//=====================================================\n\n//=====================================================\n\nsetBackdrop(\"bg.png\"); //設定背景圖\nlet board = createSprite('board.png'); //分數板\nlet player = createSprite('k_0.png', 'k_1.png', 'k_2.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'); //飛行物體\nlet info = createSprite('info.png'); //遊戲說明\nlet sight = createSprite('sight.png'); //準星\nlet level = 0; //等級\nlet clock = 0; //紀錄遊戲迴圈的執行次數\n\n// info.hidden = true; //預設隱藏\n\ntarget.direction = Math.random()*360; //物品朝向隨機方向\ntarget.stepForward(Math.random() * 300 + 1000); //物品向前移動 300 - 1300 的距離\ntarget.direction += 180; //物品 180 度旋轉方向\ntarget.costumeId = Math.floor(Math.random() * 7); //隨機切換物品的造型\n\ncreateSound('bgm.mp3', true); //播放背景音樂\n\n// 遊戲迴圈\nfunction gameloop () {\n\n // 讓準星不斷跟著滑鼠移動\n sight.x = cursor.x;\n sight.y = cursor.y;\n\n // 如果遊戲說明圖被隱藏,物品才會開始移動\n if (info.hidden == true) {\n target.stepForward(5 + level/5);\n }\n\n // 如果物品碰到叩叮遊戲就結束\n if (target.touched(player) == true) {\n player.costumeId = 2; //切換叩叮的圖片\n setBackdrop(\"bg_end.png\"); //切換背景圖圖片\n stop(); //暫停遊戲\n // createSound('fail.mp3'); //播放失敗音效\n }\n\n // 將分數印在左上角\n drawText(level, 200, 60, 'white', 50);\n\n clock++;\n if (clock % 30 == 0) {\n player.costumeId = 1;\n }\n if (clock % 30 == 15) {\n player.costumeId = 0;\n }\n}\n\n// 當遊戲場景被點擊時\nfunction clickOnStage () {\n\n if (target.touched(sight) == true) {\n \n level += 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 // 將物品重置到遊戲場景中央\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 info.hidden = true; //隱藏遊戲說明圖\n}\n\n\non('click', clickOnStage); //遊戲場景被點擊就執行 clickOnStage\nforever(gameloop);","created_at":"2022-01-13T14:30:13.741+08:00","updated_at":"2022-01-14T18:52:38.037+08:00","name":"守護演唱會(完整版)","language":"javascript","screenshot":{"url":null},"parent_id":2,"plugin":"Game.set({ width: 1200, height: 900 });\n\n// 重要單字\n// createSprite\n// target\n// blablabla\nMath.random()\n// 提示1\n// 設定 target 角色朝向一個隨機的方向\ntarget.direction = Math.random()*360;\n\n// 提示2\n// 讓準星水平位置跟著滑鼠移動\nsight.x = cursor.x;\n\nif (target.touched(player) == true) {}\n","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":164,"hashid":"d5msvj9q2","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":7147326,"file_name":"effect.mp3","project_id":335273,"asset_id":463470,"created_at":"2022-01-13T14:30:22.956+08:00","updated_at":"2022-01-13T14:30:22.956+08:00"},{"id":7147327,"file_name":"bgm.mp3","project_id":335273,"asset_id":463471,"created_at":"2022-01-13T14:30:22.987+08:00","updated_at":"2022-01-13T14:30:22.987+08:00"},{"id":7147328,"file_name":"sight.png","project_id":335273,"asset_id":463472,"created_at":"2022-01-13T14:30:22.996+08:00","updated_at":"2022-01-13T14:30:22.996+08:00"},{"id":7147329,"file_name":"k_1.png","project_id":335273,"asset_id":463473,"created_at":"2022-01-13T14:30:23.001+08:00","updated_at":"2022-01-13T14:30:23.001+08:00"},{"id":7147330,"file_name":"k_0.png","project_id":335273,"asset_id":463474,"created_at":"2022-01-13T14:30:23.005+08:00","updated_at":"2022-01-13T14:30:23.005+08:00"},{"id":7147331,"file_name":"info.png","project_id":335273,"asset_id":463475,"created_at":"2022-01-13T14:30:23.011+08:00","updated_at":"2022-01-13T14:30:23.011+08:00"},{"id":7147332,"file_name":"board.png","project_id":335273,"asset_id":463476,"created_at":"2022-01-13T14:30:23.015+08:00","updated_at":"2022-01-13T14:30:23.015+08:00"},{"id":7147333,"file_name":"bg.png","project_id":335273,"asset_id":463477,"created_at":"2022-01-13T14:30:23.023+08:00","updated_at":"2022-01-13T14:30:23.023+08:00"},{"id":7147334,"file_name":"bg_end.png","project_id":335273,"asset_id":463478,"created_at":"2022-01-13T14:30:23.029+08:00","updated_at":"2022-01-13T14:30:23.029+08:00"},{"id":7147335,"file_name":"t_0.png","project_id":335273,"asset_id":463479,"created_at":"2022-01-13T14:30:23.033+08:00","updated_at":"2022-01-13T14:30:23.033+08:00"},{"id":7147336,"file_name":"t_2.png","project_id":335273,"asset_id":463480,"created_at":"2022-01-13T14:30:23.038+08:00","updated_at":"2022-01-13T14:30:23.038+08:00"},{"id":7147337,"file_name":"fail.mp3","project_id":335273,"asset_id":463481,"created_at":"2022-01-13T14:30:23.042+08:00","updated_at":"2022-01-13T14:30:23.042+08:00"},{"id":7147338,"file_name":"t_6.png","project_id":335273,"asset_id":463482,"created_at":"2022-01-13T14:30:23.046+08:00","updated_at":"2022-01-13T14:30:23.046+08:00"},{"id":7147339,"file_name":"t_5.png","project_id":335273,"asset_id":463483,"created_at":"2022-01-13T14:30:23.051+08:00","updated_at":"2022-01-13T14:30:23.051+08:00"},{"id":7147340,"file_name":"t_4.png","project_id":335273,"asset_id":463484,"created_at":"2022-01-13T14:30:23.055+08:00","updated_at":"2022-01-13T14:30:23.055+08:00"},{"id":7147341,"file_name":"t_3.png","project_id":335273,"asset_id":463485,"created_at":"2022-01-13T14:30:23.059+08:00","updated_at":"2022-01-13T14:30:23.059+08:00"},{"id":7147342,"file_name":"t_1.png","project_id":335273,"asset_id":463486,"created_at":"2022-01-13T14:30:23.063+08:00","updated_at":"2022-01-13T14:30:23.063+08:00"},{"id":7147343,"file_name":"k_2.png","project_id":335273,"asset_id":463487,"created_at":"2022-01-13T14:30:23.067+08:00","updated_at":"2022-01-13T14:30:23.067+08:00"},{"id":7147325,"file_name":"fired.mp3","project_id":335273,"asset_id":463469,"created_at":"2022-01-13T14:30:22.951+08:00","updated_at":"2022-01-13T14:30:22.951+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦