{"id":261243,"student_id":34,"content":"import game\ngame.set_backdrop(\"bg.png\") #設定背景\nball = game.create_sprite(\"ball.png\") #創造角色\ninfo = game.create_sprite(\"info.png\")\nshadow = game.create_sprite(\"shadow.png\")\ngame.create_sound(\"bgm.mp3\",True)\n\nvx = 0\nvy = 0\nscore = 0\nbest = 0\nbouns = 1\nten = 10\ninfo_hidden = 0\nball.y = 100\n\ndef loop():\n global vx,vy,score,best,info,bouns,ten,info_hidden\n if cursor.is_down:\n info.hidden = True\n info_hidden = 1\n \n if info_hidden == 1:\n ball.x = ball.x + vx\n ball.y = ball.y + vy\n vy = vy + 0.33\n if ball.x \u003c 100 and vx \u003c 0: vx = -vx\n if ball.x \u003e 1100 and vx \u003e 0: vx = -vx\n if ball.y \u003c 100 and vy \u003c 0: vy = -vy\n if ball.y \u003e 750 and vy \u003e 0:\n score = 0\n bouns = 1\n vy = -vy * 0.7\n vx = vx * 0.7\n \n if ball.touched(cursor):\n if score \u003e ten:\n bouns = bouns + 1\n ten = ten + 10\n score = score + bouns\n game.create_sound(\"bounce.mp3\")\n if score \u003e best: best = score\n vx = (ball.x - cursor.x) / 4\n vy = (ball.y - cursor.y) / 4\n \n game.draw_text(score,110,80,'white',50)\n game.draw_text(best,1050,80,'white',50)\n \n shadow.x = ball.x\n shadow.y = 850\n shadow.scale = ball.y / 750\n \ngame.forever(loop) #重複不斷執行","created_at":"2021-06-10T19:11:57.008+08:00","updated_at":"2021-07-12T23:24:24.629+08:00","name":"排球之王(預設版) 副本","language":"python","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/261243/36a5f5b88951647639937663264bbdd3.jpg"},"parent_id":194469,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":96,"hashid":"36ysmrjzy","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":5008055,"file_name":"bgm.mp3","project_id":261243,"asset_id":267832,"created_at":"2021-06-10T19:11:57.013+08:00","updated_at":"2021-06-10T19:11:57.013+08:00"},{"id":5008056,"file_name":"bounce.mp3","project_id":261243,"asset_id":267833,"created_at":"2021-06-10T19:11:57.014+08:00","updated_at":"2021-06-10T19:11:57.014+08:00"},{"id":5008057,"file_name":"bg.png","project_id":261243,"asset_id":267834,"created_at":"2021-06-10T19:11:57.015+08:00","updated_at":"2021-06-10T19:11:57.015+08:00"},{"id":5008058,"file_name":"ball.png","project_id":261243,"asset_id":267835,"created_at":"2021-06-10T19:11:57.016+08:00","updated_at":"2021-06-10T19:11:57.016+08:00"},{"id":5008059,"file_name":"shadow.png","project_id":261243,"asset_id":267836,"created_at":"2021-06-10T19:11:57.017+08:00","updated_at":"2021-06-10T19:11:57.017+08:00"},{"id":5008060,"file_name":"info.png","project_id":261243,"asset_id":267837,"created_at":"2021-06-10T19:11:57.018+08:00","updated_at":"2021-06-10T19:11:57.018+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
繁中
简中
English
日本語
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦