{"id":220344,"student_id":2002,"content":"import game\ngame.set_backdrop(\"bg.png\") #設定背景\nball = game.create_sprite(\"ball.png\") #創造角色\ninfo = game.game.create_sprite(\"info.png\") #創造角色\nshadow = game.create_sprite(\"shadow.png\") #創造角色\nvx = 5\nvy = 5\nscore = 0\nbestscore = 0\ndef loop():\n game.draw_text(score, 110, 80, \"white\", 50)\n game.draw_text(bestscore, 1050, 80, \"white\", 50)\n # game.draw_text(vy, 600, 80, \"white\", 50)\n global vx, vy, score, bestscore\n shadow.x = ball.x\n shadow.y = 850\n shadow.scale = ball.y / 750\n ball.x += vx\n ball.y += vy\n vy += 0.33\n if ball.x \u003c 100 or ball.x \u003e 1100 :\n vx = -vx\n if ball.y \u003c 100 and vy \u003c 0:\n vy = -vy\n \n if ball.y \u003e 750 and vy \u003e 0:\n vy = -vy * 0.7\n vx *= 0.7\n score = 0\n if ball.touched(cursor):\n vx = (ball.x - cursor.x) / 4\n vy = (ball.y - cursor.y) / 4\n score += 1\n if score \u003e bestscore :\n bestscore = score\n if info.hidden == False and cursor.is_down :\n info.hidden = True\n \ngame.forever(loop) #重複不斷執行","created_at":"2021-01-17T13:30:49.509+08:00","updated_at":"2021-01-17T14:57:41.450+08:00","name":"排球之王(預設版) 副本","language":"python","screenshot":{"url":"https://cdn0.koding.school/uploads/project/screenshot/220344/77c04d47fe6aaa89d720632ed0820b6d.jpg"},"parent_id":194469,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":120,"hashid":"jzmsek8j3","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3910720,"file_name":"bgm.mp3","project_id":220344,"asset_id":267832,"created_at":"2021-01-17T13:30:49.514+08:00","updated_at":"2021-01-17T13:30:49.514+08:00"},{"id":3910721,"file_name":"bounce.mp3","project_id":220344,"asset_id":267833,"created_at":"2021-01-17T13:30:49.515+08:00","updated_at":"2021-01-17T13:30:49.515+08:00"},{"id":3910722,"file_name":"bg.png","project_id":220344,"asset_id":267834,"created_at":"2021-01-17T13:30:49.516+08:00","updated_at":"2021-01-17T13:30:49.516+08:00"},{"id":3910723,"file_name":"ball.png","project_id":220344,"asset_id":267835,"created_at":"2021-01-17T13:30:49.517+08:00","updated_at":"2021-01-17T13:30:49.517+08:00"},{"id":3910724,"file_name":"shadow.png","project_id":220344,"asset_id":267836,"created_at":"2021-01-17T13:30:49.518+08:00","updated_at":"2021-01-17T13:30:49.518+08:00"},{"id":3910725,"file_name":"info.png","project_id":220344,"asset_id":267837,"created_at":"2021-01-17T13:30:49.518+08:00","updated_at":"2021-01-17T13:30:49.518+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦