{"id":760838,"student_id":10,"content":"from game import *\nfrom random import *\n\nset_backdrop('bg.png')\ngrounds = []\ntrees = []\nsigns = []\nspeed = 0\nstatus = 0\n\nfor i in range(11):\n g = create_sprite('g_0.png', 'g_1.png')\n g.x = 600 - 1200 * i\n grounds.append(g)\n \nfor i in range(30):\n t = create_sprite('tree.png')\n t.y = 540 + 40\n t.x = 600 - 12000 * random()\n t.scale = random() * 0.5 + 0.5\n if t.scale \u003c 0.8: t.layer = -1\n trees.append(t)\n \nfor i in range(11):\n s = create_sprite(str(i) + '.png')\n s.x = 600 - 12000 + i * 500\n signs.append(s)\n \ngrounds[10].costume_id = 1\nexpose = create_sprite('expose.png')\nexpose.y += 150\nplayer = create_sprite('k_0.png', 'k_1.png', 'k_2.png')\nplayer.scale = 0.5\nreset_btn = create_sprite('r_hint.png')\nhint = create_sprite('hint_space.png')\nreset_btn.hidden = True\n\ndef loop():\n global speed, status\n \n score = (player.x - grounds[10].x) * 10 / 500\n draw_text('成績:' + str(score) + 'm', 10, 10, 'black', 60)\n \n if key.space:\n speed += 1\n hint.hidden = True\n status = 1\n elif speed \u003e 0:\n speed -= 1\n status = 2\n else:\n speed = 0\n \n if status == 1:\n player.costume_id = (grounds[0].x // 300) % 2\n else:\n player.costume_id = 2\n \n for s in grounds + trees + signs:\n s.x += speed\n \n if player.x \u003c grounds[10].x:\n player.y += 15\n \n if speed == 0 and status == 2:\n reset_btn.hidden = False\n \n if key.r: reset()\n \n expose.hidden = not status == 2 or speed \u003c= 0 or player.y \u003e 450\n expose.scale = 1.1 if grounds[0].x % 300 \u003e 150 else 1\n \n\ndef reset():\n global status\n diff = grounds[0].x - 600\n for s in grounds + trees + signs: s.x -= diff\n player.y = 450\n reset_btn.hidden = True\n status = 1\n\nreset_btn.on('click', reset)\nforever(loop)\n","created_at":"2024-05-30T17:11:27.305+08:00","updated_at":"2024-06-05T14:25:43.972+08:00","name":"懸崖衝刺","language":"python","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/760838/1ae3825eb8eda7208a51911618e4df74.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":64,"hashid":"882sn6nev","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":16985629,"file_name":"k_0.png","project_id":760838,"asset_id":161769,"created_at":"2024-05-30T17:12:26.060+08:00","updated_at":"2024-05-30T17:12:26.060+08:00"},{"id":16985630,"file_name":"k_1.png","project_id":760838,"asset_id":161770,"created_at":"2024-05-30T17:12:26.062+08:00","updated_at":"2024-05-30T17:12:26.062+08:00"},{"id":16985645,"file_name":"6.png","project_id":760838,"asset_id":745166,"created_at":"2024-05-30T17:31:02.459+08:00","updated_at":"2024-05-30T17:31:02.459+08:00"},{"id":16985646,"file_name":"7.png","project_id":760838,"asset_id":745167,"created_at":"2024-05-30T17:31:02.461+08:00","updated_at":"2024-05-30T17:31:02.461+08:00"},{"id":16985647,"file_name":"8.png","project_id":760838,"asset_id":745168,"created_at":"2024-05-30T17:31:02.900+08:00","updated_at":"2024-05-30T17:31:02.900+08:00"},{"id":16985648,"file_name":"10.png","project_id":760838,"asset_id":745169,"created_at":"2024-05-30T17:31:02.901+08:00","updated_at":"2024-05-30T17:31:02.901+08:00"},{"id":16985650,"file_name":"tree.png","project_id":760838,"asset_id":745171,"created_at":"2024-05-30T17:37:00.155+08:00","updated_at":"2024-05-30T17:37:00.155+08:00"},{"id":16985641,"file_name":"2.png","project_id":760838,"asset_id":745162,"created_at":"2024-05-30T17:31:01.377+08:00","updated_at":"2024-05-30T17:31:01.377+08:00"},{"id":16985642,"file_name":"3.png","project_id":760838,"asset_id":745163,"created_at":"2024-05-30T17:31:01.379+08:00","updated_at":"2024-05-30T17:31:01.379+08:00"},{"id":16985652,"file_name":"expose.png","project_id":760838,"asset_id":745173,"created_at":"2024-05-30T18:02:55.191+08:00","updated_at":"2024-05-30T18:02:55.191+08:00"},{"id":16985651,"file_name":"start.png","project_id":760838,"asset_id":745172,"created_at":"2024-05-30T17:44:21.552+08:00","updated_at":"2024-05-30T17:44:21.552+08:00"},{"id":16985649,"file_name":"9.png","project_id":760838,"asset_id":745170,"created_at":"2024-05-30T17:31:03.440+08:00","updated_at":"2024-05-30T17:31:03.440+08:00"},{"id":16985631,"file_name":"g_1.png","project_id":760838,"asset_id":745156,"created_at":"2024-05-30T17:17:25.717+08:00","updated_at":"2024-05-30T17:17:25.717+08:00"},{"id":16985632,"file_name":"g_0.png","project_id":760838,"asset_id":745157,"created_at":"2024-05-30T17:17:25.719+08:00","updated_at":"2024-05-30T17:17:25.719+08:00"},{"id":16985638,"file_name":"bg.png","project_id":760838,"asset_id":745159,"created_at":"2024-05-30T17:29:42.854+08:00","updated_at":"2024-05-30T17:29:42.854+08:00"},{"id":16985643,"file_name":"4.png","project_id":760838,"asset_id":745164,"created_at":"2024-05-30T17:31:01.830+08:00","updated_at":"2024-05-30T17:31:01.830+08:00"},{"id":16985644,"file_name":"5.png","project_id":760838,"asset_id":745165,"created_at":"2024-05-30T17:31:01.832+08:00","updated_at":"2024-05-30T17:31:01.832+08:00"},{"id":16985653,"file_name":"k_2.png","project_id":760838,"asset_id":745174,"created_at":"2024-05-30T18:06:51.737+08:00","updated_at":"2024-05-30T18:06:51.737+08:00"},{"id":16985639,"file_name":"0.png","project_id":760838,"asset_id":745160,"created_at":"2024-05-30T17:31:00.904+08:00","updated_at":"2024-05-30T17:31:00.904+08:00"},{"id":16985640,"file_name":"1.png","project_id":760838,"asset_id":745161,"created_at":"2024-05-30T17:31:00.906+08:00","updated_at":"2024-05-30T17:31:00.906+08:00"},{"id":16988069,"file_name":"r_hint.png","project_id":760838,"asset_id":745210,"created_at":"2024-05-31T17:08:42.900+08:00","updated_at":"2024-05-31T17:08:42.900+08:00"},{"id":16988070,"file_name":"hint_space.png","project_id":760838,"asset_id":745211,"created_at":"2024-05-31T17:08:42.902+08:00","updated_at":"2024-05-31T17:08:42.902+08:00"},{"id":16988071,"file_name":"r_hint.png","project_id":760838,"asset_id":745210,"created_at":"2024-05-31T17:09:22.291+08:00","updated_at":"2024-05-31T17:09:22.291+08:00"},{"id":16988072,"file_name":"hint_space.png","project_id":760838,"asset_id":745211,"created_at":"2024-05-31T17:09:22.293+08:00","updated_at":"2024-05-31T17:09:22.293+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦