{"id":234827,"student_id":3311,"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 \n\n \nvx = 0\nvy = 0\nscore = 0\nhighscore = 0\n \ndef loop():\n global vx, vy\n global score\n global highscore\n\n game.draw_text(score, 113, 77, \"white\", 50)\n game.draw_text(highscore, 1060, 77, \"white\", 50)\n \n ball.x = ball.x + vx\n ball.y = ball.y + vy\n vy = vy + 0.33\n \n if ball.y \u003c 100 and vy \u003c 0:\n vy = -vy\n game.create_sound(\"bounce.mp3\")\n if ball.y \u003e 750 and vy \u003e 0:\n vy = -vy * 0.7\n vx = vx * 0.7\n score = 0;\n if ball.x \u003c 100 and vx \u003c 0:\n vx = -vx\n game.create_sound(\"bounce.mp3\")\n if ball.x \u003e 1100 and vx \u003e 0:\n vx = -vx\n game.create_sound(\"bounce.mp3\")\n if score \u003e highscore:\n highscore = score\n if ball.touched(cursor) :\n vx = (ball.x - cursor.x) / 4\n vy = (ball.y - cursor.y) / 4\n game.create_sound(\"bounce.mp3\")\n if info.hidden == True:\n score = score + 1\n if cursor.is_down:\n info.hidden = True;\n \n \n shadow.x = ball.x\n shadow.y = 850\n shadow.scale = ball.y/750\n \n \n \n \n \n \n \n \n \ngame.forever(loop) #重複不斷執行","created_at":"2021-03-13T13:38:06.251+08:00","updated_at":"2021-03-13T15:02:02.596+08:00","name":"排球之王(預設版) 副本","language":"python","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/234827/2fdda0d68860b449b61a21ba6136c776.jpg"},"parent_id":194469,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":134,"hashid":"wdks4m9gp","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":4246160,"file_name":"bgm.mp3","project_id":234827,"asset_id":267832,"created_at":"2021-03-13T13:38:06.290+08:00","updated_at":"2021-03-13T13:38:06.290+08:00"},{"id":4246161,"file_name":"bounce.mp3","project_id":234827,"asset_id":267833,"created_at":"2021-03-13T13:38:06.292+08:00","updated_at":"2021-03-13T13:38:06.292+08:00"},{"id":4246162,"file_name":"bg.png","project_id":234827,"asset_id":267834,"created_at":"2021-03-13T13:38:06.293+08:00","updated_at":"2021-03-13T13:38:06.293+08:00"},{"id":4246163,"file_name":"ball.png","project_id":234827,"asset_id":267835,"created_at":"2021-03-13T13:38:06.295+08:00","updated_at":"2021-03-13T13:38:06.295+08:00"},{"id":4246164,"file_name":"shadow.png","project_id":234827,"asset_id":267836,"created_at":"2021-03-13T13:38:06.296+08:00","updated_at":"2021-03-13T13:38:06.296+08:00"},{"id":4246165,"file_name":"info.png","project_id":234827,"asset_id":267837,"created_at":"2021-03-13T13:38:06.297+08:00","updated_at":"2021-03-13T13:38:06.297+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
繁中
简中
English
日本語
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦