{"id":183015,"student_id":10,"content":"/**\n * 情境:老師我沒辦法用上下按鍵控制擋板移動\n * 提示:學生就是會亂排版,先要求他們整理一下\n */\n\nvar score_left = 0;\nvar score_right = 0;\nvar speed = 5;\n\nforever(function() {\n\nball.stepForward(speed); //球向前移動\n \n //當球超出上下邊界就反彈\n if(ball.y \u003c 0 || ball.y \u003e 480) {\n ball.direction = -ball.direction - 180;\n}\n\n//當球撞到左右兩邊擋板就反彈\nif(ball.touched(p2) || ball.touched(p1)) {\n ball.direction = -ball.direction + Math.random()*15;\n speed = speed + 0.5;\n}\n});\n\n//玩家按下「上」鍵\nif(key.up) {\n p1.y = p1.y - 10; //右邊擋板向上移動\n}\n\n//玩家按下「下」鍵\nif(key.down) {\n p1.y = p1.y + 10; //右邊擋板向下移動\n}\n\n//玩家按下「w」鍵\nif(key.w) {\n p2.y = p2.y - 10; //左邊擋板向上移動\n}\n\n//玩家按下「s」鍵\nif(key.s) {\n p2.y = p2.y + 10; //左邊擋板向下移動\n}\n","created_at":"2020-08-19T16:34:39.763+08:00","updated_at":"2022-11-02T15:13:51.601+08:00","name":"L5_彈力球_除錯範例_2","language":"javascript","screenshot":{"url":"/uploads/project/screenshot/183015/7b578f02be353f69e12a09d9de983570.jpg"},"parent_id":73437,"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":379,"hashid":"2pdsg822","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3112954,"file_name":"BonusCube.mp3","project_id":183015,"asset_id":127563,"created_at":"2020-08-19T16:34:39.769+08:00","updated_at":"2020-08-19T16:34:39.769+08:00"},{"id":3112955,"file_name":"bg.jpg","project_id":183015,"asset_id":127562,"created_at":"2020-08-19T16:34:39.770+08:00","updated_at":"2020-08-19T16:34:39.770+08:00"},{"id":3112956,"file_name":"ball.png","project_id":183015,"asset_id":127561,"created_at":"2020-08-19T16:34:39.771+08:00","updated_at":"2020-08-19T16:34:39.771+08:00"},{"id":3112957,"file_name":"orange.jpg","project_id":183015,"asset_id":127560,"created_at":"2020-08-19T16:34:39.772+08:00","updated_at":"2020-08-19T16:34:39.772+08:00"},{"id":3112958,"file_name":"blue.jpg","project_id":183015,"asset_id":127559,"created_at":"2020-08-19T16:34:39.773+08:00","updated_at":"2020-08-19T16:34:39.773+08:00"}]
Orange Apple Learning Platform
My Projects
View Project Page
Export
Remix
Import
Delete
Download Android APP (APK)
Screenshot
繁中
简中
English
日本語
1:1:1
1:1
Full Width
Scan the QRCode below with your phone to install
Or you can
download APK
to this computer
Scan the QRCode below with your phone to install
Or you can
download APK
to this computer