{"id":183177,"student_id":10,"content":"/**\n* 情境:老師我沒辦法用上下按鍵控制擋板移動\n* 提示:學生就是會亂排版,先要求他們整理一下\n*/\n\nvar score_left = 0;\nvar score_right = 0;\nvar speed = 5;\n\nforever(function() {\n\n ball.stepForward(speed); //球向前移動\n\n //當球超出上下邊界就反彈\n if (ball.y \u003c 0 || ball.y \u003e 480) {\n ball.direction = -ball.direction - 180;\n }\n\n //當球撞到左右兩邊擋板就反彈\n if (ball.touched(p2) || ball.touched(p1)) {\n ball.direction = -ball.direction + Math.random()*15;\n speed = speed + 0.5;\n }\n\n\n //玩家按下「上」鍵\n if (key.up) {\n p1.y = p1.y - 10; //右邊擋板向上移動\n }\n\n //玩家按下「下」鍵\n if (key.down) {\n p1.y = p1.y + 10; //右邊擋板向下移動\n }\n\n //玩家按下「w」鍵\n if (key.w) {\n p2.y = p2.y - 10; //左邊擋板向上移動\n }\n\n //玩家按下「s」鍵\n if (key.s) {\n p2.y = p2.y + 10; //左邊擋板向下移動\n }\n\n});","created_at":"2020-08-20T10:44:43.940+08:00","updated_at":"2022-11-02T15:14:17.686+08:00","name":"L5_彈力球_除錯範例_2 副本","language":"javascript","screenshot":{"url":"https://cdn3.koding.school/uploads/project/screenshot/183177/7b578f02be353f69e12a09d9de983570.jpg"},"parent_id":183015,"plugin":"setBackdrop('bg.jpg');\nvar ball = createSprite(\"ball.png\");\nvar p2 = createSprite({\n costumes: \"blue.jpg\",\n x: 10,\n y: 250\n});\nvar p1 = createSprite({\n costumes: \"orange.jpg\",\n x: 631,\n y: 250\n});\n// =================================//\n","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":252,"hashid":"rdvsq2mk","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3115382,"file_name":"blue.jpg","project_id":183177,"asset_id":127559,"created_at":"2020-08-20T10:44:43.946+08:00","updated_at":"2020-08-20T10:44:43.946+08:00"},{"id":3115383,"file_name":"orange.jpg","project_id":183177,"asset_id":127560,"created_at":"2020-08-20T10:44:43.947+08:00","updated_at":"2020-08-20T10:44:43.947+08:00"},{"id":3115384,"file_name":"ball.png","project_id":183177,"asset_id":127561,"created_at":"2020-08-20T10:44:43.948+08:00","updated_at":"2020-08-20T10:44:43.948+08:00"},{"id":3115385,"file_name":"bg.jpg","project_id":183177,"asset_id":127562,"created_at":"2020-08-20T10:44:43.949+08:00","updated_at":"2020-08-20T10:44:43.949+08:00"},{"id":3115386,"file_name":"BonusCube.mp3","project_id":183177,"asset_id":127563,"created_at":"2020-08-20T10:44:43.950+08:00","updated_at":"2020-08-20T10:44:43.950+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦