{"id":771744,"student_id":10,"content":"from game import *\nfrom random import *\n\nground = create_sprite('ground.png')\nbg0 = create_sprite('bg_0.png')\nplayer = create_sprite('p_0.png', 'p_1.png')\nbg1 = create_sprite('bg_1.png')\nvy = -0\nvx = 10\nscore = 0\nstatus = 0\n\ndef reset():\n global vy, vx, status\n player.y = 700\n status = 0\n vy = 0\n vx = 0\n ground.x = 600\n bg0.x = -1800\n bg1.x = -1800\n\ndef loop():\n global vy, vx, jump, status\n if status == 1:\n vx += 0.1\n if status == 2:\n player.y += vy\n vy += 0.2\n if status == 1 or status == 2:\n if player.y \u003c 900:\n bg0.x += vx\n bg1.x += vx\n ground.x += vx\n if bg0.x \u003e 1200: bg0.x -= 1200\n if bg1.x \u003e 1200: bg1.x -= 1200\n if status == 3:\n if player.y \u003e 800: player.y -= 1\n \n if status == 2 and (vx \u003c 1 or player.y \u003e 1000):\n status = 3\n\n draw_text(status)\n\ndef key_down():\n global status, jump, vx, vy\n if status == 0:\n status = 1\n elif status == 1:\n status = 2\n vy = -vx\n elif status == 2 and player.y \u003e= 550 and player.y \u003c= 850:\n scale = (150 - abs(700 - player.y)) / 150\n vy = -vy\n vy *= scale\n vx *= scale\n\non('keydown', 'space', key_down)\non('keydown', 'r', reset)\nforever(loop)\nreset()","created_at":"2024-06-18T11:09:57.971+08:00","updated_at":"2024-07-19T15:01:04.030+08:00","name":"輕功水上飄","language":"python","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/771744/482df0972d64ba37bf3dd1a544d79508.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":43,"hashid":"2pdsyd3d6","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":17208437,"file_name":"ground.png","project_id":771744,"asset_id":748877,"created_at":"2024-06-18T15:11:03.279+08:00","updated_at":"2024-06-18T15:11:03.279+08:00"},{"id":17208406,"file_name":"splash.png","project_id":771744,"asset_id":748863,"created_at":"2024-06-18T12:21:38.135+08:00","updated_at":"2024-06-18T12:21:38.135+08:00"},{"id":17208364,"file_name":"p_1.png","project_id":771744,"asset_id":748859,"created_at":"2024-06-18T11:19:29.668+08:00","updated_at":"2024-06-18T11:19:29.668+08:00"},{"id":17208365,"file_name":"p_0.png","project_id":771744,"asset_id":748860,"created_at":"2024-06-18T11:19:29.670+08:00","updated_at":"2024-06-18T11:19:29.670+08:00"},{"id":17208404,"file_name":"bg_1.png","project_id":771744,"asset_id":748861,"created_at":"2024-06-18T11:48:27.519+08:00","updated_at":"2024-06-18T11:48:27.519+08:00"},{"id":17208405,"file_name":"bg_0.png","project_id":771744,"asset_id":748862,"created_at":"2024-06-18T11:48:27.521+08:00","updated_at":"2024-06-18T11:48:27.521+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦