{"id":795822,"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', 'p_0.png', 'p_1.png')\nbg1 = create_sprite('bg_1.png')\nsplit = create_sprite('split_0.png', 'split_1.png')\n\nvx = 0\nvy = 0\nstatus = 0\n\ndef reset():\n global vx, vy, status\n status = 0\n vx = 0\n vy = 0\n player.y = 750\n split.y = 750\n ground.x = 0\n bg0.x = -2400\n bg1.x = -2400\n\ndef loop():\n global status, vx, vy\n if status == 1:\n vx += 0.1\n if ground.x \u003c 1200: status = 4\n if status == 2 or status == 3:\n player.y += vy\n vy += 0.2\n if status == 1 or status == 2:\n bg0.x += vx\n bg1.x += vx\n ground.x += vx\n if bg0.x \u003e 1200:\n bg0.x -= 1200\n bg1.x -= 1200\n \n if player.y \u003e 1000:\n status = 4\n if status == 4 and player.y \u003e 850:\n player.y -= 1\n \n split.hidden = player.y \u003c= 700 or player.y \u003e= 800 or status != 2\n \n dist = ground.x - 1800\n if dist \u003c 0: dist = 0\n draw_text(str(dist // 10) + 'm', 30, 30, 'black', 100)\n \n player.costume_id = (ground.x // 100) % 2\n split.costume_id = (ground.x // 100) % 2\n\ndef keydown():\n global status, vx, vy\n if status == 0:\n status = 1\n elif status == 1:\n status = 2\n vy = -10\n if ground.x \u003c 1200:\n status = 4\n player.direction = 0\n vy = 0\n elif status == 2:\n scale = 0\n if player.y \u003e 700 and player.y \u003c= 750:\n scale = (player.y - 700) / 50\n if player.y \u003e 750 and player.y \u003c= 800:\n scale = (800 - player.y) / 50\n vx *= scale\n vy *= scale * -1\n if vx \u003c= 1: status = 3\n \non('keydown', 'r', reset)\non('keydown', 'space', keydown)\nforever(loop)\nreset()\n","created_at":"2024-07-19T15:49:08.425+08:00","updated_at":"2024-07-29T18:16:51.263+08:00","name":"叩叮入浴","language":"python","screenshot":{"url":"https://cdn3.koding.school/uploads/project/screenshot/795822/071dcca30661001349d5f5503576f428.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":42,"hashid":"rdvsd6qrz","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":17643173,"file_name":"p_0.png","project_id":795822,"asset_id":748859,"created_at":"2024-07-19T15:50:06.116+08:00","updated_at":"2024-07-19T15:50:06.116+08:00"},{"id":17643174,"file_name":"p_1.png","project_id":795822,"asset_id":748860,"created_at":"2024-07-19T15:50:06.118+08:00","updated_at":"2024-07-19T15:50:06.118+08:00"},{"id":17730238,"file_name":"bg_0.png","project_id":795822,"asset_id":758224,"created_at":"2024-07-22T11:56:30.652+08:00","updated_at":"2024-07-22T11:56:30.652+08:00"},{"id":17730236,"file_name":"ground.png","project_id":795822,"asset_id":758222,"created_at":"2024-07-22T11:56:30.213+08:00","updated_at":"2024-07-22T11:56:30.213+08:00"},{"id":17730237,"file_name":"bg_1.png","project_id":795822,"asset_id":758223,"created_at":"2024-07-22T11:56:30.215+08:00","updated_at":"2024-07-22T11:56:30.215+08:00"},{"id":17730170,"file_name":"split_1.png","project_id":795822,"asset_id":758214,"created_at":"2024-07-22T10:30:03.136+08:00","updated_at":"2024-07-22T10:30:03.136+08:00"},{"id":17730171,"file_name":"split_0.png","project_id":795822,"asset_id":758215,"created_at":"2024-07-22T10:30:03.138+08:00","updated_at":"2024-07-22T10:30:03.138+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦