{"id":171583,"student_id":10,"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\np1_score = 0 #左邊玩家分數\np2_score = 0 #右邊玩家分數\nspeed = 10 #球的速度\n\n#遊戲主迴圈\ndef loop ():\n global p1_score, p2_score, speed\n \n if game.key.w:\n p1.y -= 20\n \n if game.key.s:\n p1.y += 20\n \n game.draw_text(p1_score, 30, 20, '#F46F25', 80) #印出 p1 分數\n game.draw_text(p2_score, 1140, 20, '#23B0DB', 80) #印出 p2 分數\n\n \nforever(loop) #重複不斷執行遊戲迴圈\n\n\n\n\n","created_at":"2020-07-26T19:05:19.555+08:00","updated_at":"2020-10-21T17:21:40.805+08:00","name":"彈力球大賽(預設版) ","language":"python","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/171583/1aea0426ab968e688af83fa85b8d0258.jpg"},"parent_id":150127,"plugin":"game.set({'width': 1200, 'height': 900})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":232,"hashid":"rdvs9j65","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2965628,"file_name":"ball_0.png","project_id":171583,"asset_id":197998,"created_at":"2020-07-26T19:05:19.561+08:00","updated_at":"2020-07-26T19:05:19.561+08:00"},{"id":2965629,"file_name":"ball_3.png","project_id":171583,"asset_id":198068,"created_at":"2020-07-26T19:05:19.562+08:00","updated_at":"2020-07-26T19:05:19.562+08:00"},{"id":2965630,"file_name":"bg_2.jpg","project_id":171583,"asset_id":197996,"created_at":"2020-07-26T19:05:19.563+08:00","updated_at":"2020-07-26T19:05:19.563+08:00"},{"id":2965631,"file_name":"bgm.mp3","project_id":171583,"asset_id":172560,"created_at":"2020-07-26T19:05:19.564+08:00","updated_at":"2020-07-26T19:05:19.564+08:00"},{"id":2965632,"file_name":"info.png","project_id":171583,"asset_id":197997,"created_at":"2020-07-26T19:05:19.565+08:00","updated_at":"2020-07-26T19:05:19.565+08:00"},{"id":2965633,"file_name":"p1.png","project_id":171583,"asset_id":197969,"created_at":"2020-07-26T19:05:19.566+08:00","updated_at":"2020-07-26T19:05:19.566+08:00"},{"id":2965634,"file_name":"bg_1.jpg","project_id":171583,"asset_id":197995,"created_at":"2020-07-26T19:05:19.567+08:00","updated_at":"2020-07-26T19:05:19.567+08:00"},{"id":2965635,"file_name":"lose.ogg","project_id":171583,"asset_id":192734,"created_at":"2020-07-26T19:05:19.569+08:00","updated_at":"2020-07-26T19:05:19.569+08:00"},{"id":2965636,"file_name":"hit.mp3","project_id":171583,"asset_id":17858,"created_at":"2020-07-26T19:05:19.570+08:00","updated_at":"2020-07-26T19:05:19.570+08:00"},{"id":2965637,"file_name":"bg.jpg","project_id":171583,"asset_id":197970,"created_at":"2020-07-26T19:05:19.571+08:00","updated_at":"2020-07-26T19:05:19.571+08:00"},{"id":2965638,"file_name":"ball_1.png","project_id":171583,"asset_id":198067,"created_at":"2020-07-26T19:05:19.572+08:00","updated_at":"2020-07-26T19:05:19.572+08:00"},{"id":2965639,"file_name":"p2.png","project_id":171583,"asset_id":197971,"created_at":"2020-07-26T19:05:19.573+08:00","updated_at":"2020-07-26T19:05:19.573+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦