{"id":720851,"student_id":10,"content":"from game import *\nfrom random import *\n\nspeed = 10\nsigns = []\ngrounds = []\ntrees = []\ntrees2 = []\nstatus = 0\n\nfor i in range(20):\n g = create_sprite('ground_1.png' if i == 0 else 'ground_0.png')\n g.x += i * 1200 - 12000\n g.scale = 0.95\n grounds.append(g)\n\nfor i in range(10):\n s = create_sprite('sign.png')\n s.x += i * 500 - 12000\n signs.append(s)\n\nfor i in range(10):\n s = game.create_sprite('tree.png')\n s.x += i * 1200 + 1200 * random() - 12000\n trees.append(s)\n s = game.create_sprite('tree.png')\n s.x += i * 1200 + 1200 * random() - 12000\n s.scale = 0.5\n s.layer = -1\n trees2.append(s)\n \nplayer = create_sprite('koding.png')\n \ndef reset():\n d = 12000 - (player.x - signs[0].x)\n arr = signs + grounds + trees\n for s in arr: s.x -= d\n for s in trees2: s.x -= d / 3\n player.y = 450 \n \ndef loop():\n global speed, status\n arr = signs + grounds + trees\n for s in arr:\n s.x += speed\n for s in trees2:\n s.x += speed / 3\n \n if (status == 0 or status == 1) and cursor.is_down:\n status = 1\n speed += 2\n \n if (status == 1 or status == 2) and not cursor.is_down:\n status = 2\n speed -= 2\n if speed \u003c 0:\n speed = 0\n status = 3\n \n if status == 3 and cursor.is_down:\n status = 0\n reset()\n \n if player.x \u003c signs[0].x:\n player.y += 2\n \n score = 5000 - (player.x - signs[0].x)\n if score \u003c 0 or score \u003e 5000: score = 0\n draw_text(score, 0, 0, 'black', 30)\n\n \nforever(loop)","created_at":"2024-03-26T10:53:53.880+08:00","updated_at":"2024-05-30T16:35:56.670+08:00","name":"懸崖挑戰","language":"python","screenshot":{"url":"https://cdn0.koding.school/uploads/project/screenshot/720851/8f6791fc6ba532607f3ff2891de09034.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":77,"hashid":"5j3sjwypv","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":16121325,"file_name":"ground_1.png","project_id":720851,"asset_id":730472,"created_at":"2024-03-26T12:23:37.066+08:00","updated_at":"2024-03-26T12:23:37.066+08:00"},{"id":16121326,"file_name":"ground_0.png","project_id":720851,"asset_id":730473,"created_at":"2024-03-26T12:23:37.068+08:00","updated_at":"2024-03-26T12:23:37.068+08:00"},{"id":16121323,"file_name":"tree.png","project_id":720851,"asset_id":730470,"created_at":"2024-03-26T12:23:36.612+08:00","updated_at":"2024-03-26T12:23:36.612+08:00"},{"id":16121324,"file_name":"sign.png","project_id":720851,"asset_id":730471,"created_at":"2024-03-26T12:23:36.614+08:00","updated_at":"2024-03-26T12:23:36.614+08:00"},{"id":16121135,"file_name":"koding.png","project_id":720851,"asset_id":302346,"created_at":"2024-03-26T10:53:53.892+08:00","updated_at":"2024-03-26T10:53:53.892+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦