{"id":599780,"student_id":63121,"content":"import game #載入遊戲套件\ngame.set_backdrop('bg.png') #設定背景圖\nball = game.create_sprite('ball.png') #球\n\nvx= 0\nvy= 0\nscore = 0\n\n#遊戲迴圈\ndef loop ():\n global vx, vy, score\n \n ball.x = ball.x + vx\n ball.y = ball.y + vy\n vy = vy + 0.33\n \n if ball.x \u003c 100 and vx \u003c 0: vx = -vx\n \n if ball.x \u003e 1100 and vx \u003e 0: vx = -vx\n \n if ball.y \u003c 100 and vy \u003c 0: vy = -vy\n \n if ball.y \u003e 800 and vy\u003e0:\n vy = -vy * 0.7\n vx =vx* 0.7\n score = 0\n \n \n if ball.touched(cursor):\n vx = (ball.x - cursor.x) / 4\n vy = (ball.y -cursor.y) / 4\n score = score + 1\n \n game.draw_text(score,110,80,'white',50)\ngame.forever(loop) #重複不斷執行遊戲迴圈\n\n\n","created_at":"2023-08-27T10:10:29.261+08:00","updated_at":"2023-10-01T10:15:40.170+08:00","name":"排球之王(預設版) 副本","language":"python","screenshot":{"url":"https://cdn2.koding.school/uploads/project/screenshot/599780/0c438ffc95f91856abc0ec5bce665f6e.jpg"},"parent_id":194469,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":13,"hashid":"jzms9e8yq","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":13525133,"file_name":"bgm.mp3","project_id":599780,"asset_id":267832,"created_at":"2023-08-27T10:10:29.271+08:00","updated_at":"2023-08-27T10:10:29.271+08:00"},{"id":13525134,"file_name":"bounce.mp3","project_id":599780,"asset_id":267833,"created_at":"2023-08-27T10:10:29.273+08:00","updated_at":"2023-08-27T10:10:29.273+08:00"},{"id":13525135,"file_name":"bg.png","project_id":599780,"asset_id":267834,"created_at":"2023-08-27T10:10:29.277+08:00","updated_at":"2023-08-27T10:10:29.277+08:00"},{"id":13525136,"file_name":"ball.png","project_id":599780,"asset_id":267835,"created_at":"2023-08-27T10:10:29.279+08:00","updated_at":"2023-08-27T10:10:29.279+08:00"},{"id":13525137,"file_name":"shadow.png","project_id":599780,"asset_id":267836,"created_at":"2023-08-27T10:10:29.282+08:00","updated_at":"2023-08-27T10:10:29.282+08:00"},{"id":13525138,"file_name":"info.png","project_id":599780,"asset_id":267837,"created_at":"2023-08-27T10:10:29.284+08:00","updated_at":"2023-08-27T10:10:29.284+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦