{"id":1023828,"student_id":2589,"content":"import game\nimport random\n\ngame.set_backdrop('bg.jpg')\nball = game.create_sprite('ball_0.png', 'ball_1.png')\np1 = game.create_sprite('p1.png')\np2 = game.create_sprite('p2.png')\ninfo = game.create_sprite('info.png', 'bg_1.jpg', 'bg_2.jpg')\n\np1.x = 30\np2.x = 1170\ninfo.hidden = True\n\nspeed = 10\np1_score = 0\np2_score = 0\n\n\ndef loop():\n global p1_score, p2_score, speed\n\n if game.key.w == True:\n p1.y = p1.y - 20\n if game.key.s == True:\n p1.y = p1.y + 20\n if game.key.o == True:\n p2.y = p2.y - 20\n if game.key.l == True:\n p2.y = p2.y + 20\n\n ball.step_forward(speed)\n\n if ball.touched(p1) == True or ball.touched(p2) == True:\n ball.direction = ball.direction * -1 + random.randrange(0, 15)\n speed = speed + 1\n\n if ball.y \u003c 0 or ball.y \u003e 900:\n ball.direction = ball.direction * -1 + 180\n\n if ball.x \u003c 0:\n ball.move_to(600, 450)\n ball.direction = 90\n speed = 10\n\n if ball.x \u003e 1200:\n ball.moveTo(600, 450)\n ball.direction = 270\n speed = 10\n\n\nforever(loop)\n","created_at":"2025-05-29T12:00:11.006+08:00","updated_at":"2025-05-29T12:01:03.211+08:00","name":"7_A_G_彈力球大戰_正課_【講解】重新發球 副本","language":"python","screenshot":{"url":null},"parent_id":1011710,"plugin":"game.set({'width': 1200, 'height': 900})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":39,"hashid":"yeys553nj","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":38686170,"file_name":"p2.png","project_id":1023828,"asset_id":251890,"created_at":"2025-05-29T12:00:11.011+08:00","updated_at":"2025-05-29T12:00:11.011+08:00"},{"id":38686171,"file_name":"ball_1.png","project_id":1023828,"asset_id":251891,"created_at":"2025-05-29T12:00:11.012+08:00","updated_at":"2025-05-29T12:00:11.012+08:00"},{"id":38686172,"file_name":"bg.jpg","project_id":1023828,"asset_id":251892,"created_at":"2025-05-29T12:00:11.013+08:00","updated_at":"2025-05-29T12:00:11.013+08:00"},{"id":38686173,"file_name":"hit.mp3","project_id":1023828,"asset_id":251893,"created_at":"2025-05-29T12:00:11.014+08:00","updated_at":"2025-05-29T12:00:11.014+08:00"},{"id":38686174,"file_name":"lose.ogg","project_id":1023828,"asset_id":251894,"created_at":"2025-05-29T12:00:11.015+08:00","updated_at":"2025-05-29T12:00:11.015+08:00"},{"id":38686175,"file_name":"bg_1.jpg","project_id":1023828,"asset_id":251895,"created_at":"2025-05-29T12:00:11.016+08:00","updated_at":"2025-05-29T12:00:11.016+08:00"},{"id":38686176,"file_name":"p1.png","project_id":1023828,"asset_id":251896,"created_at":"2025-05-29T12:00:11.017+08:00","updated_at":"2025-05-29T12:00:11.017+08:00"},{"id":38686177,"file_name":"info.png","project_id":1023828,"asset_id":251897,"created_at":"2025-05-29T12:00:11.018+08:00","updated_at":"2025-05-29T12:00:11.018+08:00"},{"id":38686178,"file_name":"bgm.mp3","project_id":1023828,"asset_id":251898,"created_at":"2025-05-29T12:00:11.019+08:00","updated_at":"2025-05-29T12:00:11.019+08:00"},{"id":38686179,"file_name":"bg_2.jpg","project_id":1023828,"asset_id":251899,"created_at":"2025-05-29T12:00:11.020+08:00","updated_at":"2025-05-29T12:00:11.020+08:00"},{"id":38686180,"file_name":"ball_3.png","project_id":1023828,"asset_id":251900,"created_at":"2025-05-29T12:00:11.021+08:00","updated_at":"2025-05-29T12:00:11.021+08:00"},{"id":38686181,"file_name":"ball_0.png","project_id":1023828,"asset_id":251901,"created_at":"2025-05-29T12:00:11.022+08:00","updated_at":"2025-05-29T12:00:11.022+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
繁中
简中
English
日本語
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦