{"id":766067,"student_id":10,"content":"from game import *\nfrom random import *\n\nset_backdrop('bg.png')\nitems = []\nspeed = 0\nstatus = 0\n\nfor i in range(11):\n g = create_sprite('g_0.png', 'g_1.png')\n g.x = 600 + i * 1200 - 12000\n items.append(g)\n \nfor i in range(11):\n s = create_sprite(str(i) + '.png')\n s.x = 600 + i * 500 - 12000\n items.append(s)\n \nfor i in range(50):\n s = create_sprite('tree.png')\n s.x = 600 + i * 500 - random() * 6000\n s.y = 550\n s.scale = random() + 0.5\n s.layer = -1\n items.append(s)\n\nitems[0].costume_id = 1\nbrake = create_sprite('brake.png')\nplayer = create_sprite('p_0.png', 'p_1.png', 'p_2.png', 'p_3.png')\nbtn = create_sprite('space.png', 'r.png')\nn1 = create_sprite(['n_' + str(i) + '.png' for i in range(10)])\nn2 = create_sprite(['n_' + str(i) + '.png' for i in range(10)])\nnm = create_sprite('m.png')\n\nbrake.move_to(700, 630)\nn1.move_to(50, 50)\nn2.move_to(100, 50)\nnm.move_to(150, 50)\nbtn.scale = 0.4\nbtn.y += 200\nn1.scale = n2.scale = nm.scale = 0.5\n\ndef loop():\n global speed, status\n \n for s in items:\n s.x += speed\n \n if key.space and status \u003c= 1:\n speed += 1\n player.costume_id = (items[0].x // 300) % 2 + 1\n elif speed \u003e 0:\n speed -= 1\n status = 2\n player.costume_id = 3\n elif status == 2:\n speed = 0\n status = 3\n player.costume_id = 0\n \n failed = player.x \u003c items[0].x\n if failed: player.y += 30\n \n score = (600 - items[11].x) // 50\n n1.costume_id = (score // 10) % 10\n n2.costume_id = score % 10\n n1.hidden = n2.hidden = nm.hidden = failed\n \n brake.hidden = status != 2 or failed\n if score % 2 == 0: brake.scale = 0.8\n if score % 2 == 1: brake.scale = 1\n\n btn.hidden = status == 1 or status == 2\n if status == 0: btn.costume_id = 0\n if status == 3: btn.costume_id = 1\n\ndef reset():\n global status\n status = 1\n player.y = 450\n diff = items[10].x - 600\n i = 0\n while i \u003c len(items):\n items[i].x -= diff\n i += 1\n\non('keydown', 'r', reset)\nforever(loop)\n\n\n","created_at":"2024-06-07T17:12:27.858+08:00","updated_at":"2024-07-03T16:03:16.137+08:00","name":"懸崖勒叩叮","language":"python","screenshot":{"url":"https://cdn2.koding.school/uploads/project/screenshot/766067/8d4605469b71b23790eda49f3bbcdce0.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":101,"hashid":"kdms8qnj9","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":17099452,"file_name":"bg.png","project_id":766067,"asset_id":746763,"created_at":"2024-06-07T17:13:02.995+08:00","updated_at":"2024-06-07T17:13:02.995+08:00"},{"id":17099453,"file_name":"brake.png","project_id":766067,"asset_id":746764,"created_at":"2024-06-07T17:13:02.997+08:00","updated_at":"2024-06-07T17:13:02.997+08:00"},{"id":17099446,"file_name":"6.png","project_id":766067,"asset_id":746757,"created_at":"2024-06-07T17:13:00.226+08:00","updated_at":"2024-06-07T17:13:00.226+08:00"},{"id":17099447,"file_name":"7.png","project_id":766067,"asset_id":746758,"created_at":"2024-06-07T17:13:00.228+08:00","updated_at":"2024-06-07T17:13:00.228+08:00"},{"id":17099466,"file_name":"n_8.png","project_id":766067,"asset_id":746777,"created_at":"2024-06-07T17:13:07.271+08:00","updated_at":"2024-06-07T17:13:07.271+08:00"},{"id":17099467,"file_name":"n_9.png","project_id":766067,"asset_id":746778,"created_at":"2024-06-07T17:13:07.272+08:00","updated_at":"2024-06-07T17:13:07.272+08:00"},{"id":17099468,"file_name":"p_0.png","project_id":766067,"asset_id":746779,"created_at":"2024-06-07T17:13:07.859+08:00","updated_at":"2024-06-07T17:13:07.859+08:00"},{"id":17099469,"file_name":"p_1.png","project_id":766067,"asset_id":746780,"created_at":"2024-06-07T17:13:07.861+08:00","updated_at":"2024-06-07T17:13:07.861+08:00"},{"id":17099464,"file_name":"n_6.png","project_id":766067,"asset_id":746775,"created_at":"2024-06-07T17:13:06.875+08:00","updated_at":"2024-06-07T17:13:06.875+08:00"},{"id":17099465,"file_name":"n_7.png","project_id":766067,"asset_id":746776,"created_at":"2024-06-07T17:13:06.877+08:00","updated_at":"2024-06-07T17:13:06.877+08:00"},{"id":17099440,"file_name":"0.png","project_id":766067,"asset_id":746751,"created_at":"2024-06-07T17:12:58.108+08:00","updated_at":"2024-06-07T17:12:58.108+08:00"},{"id":17099441,"file_name":"1.png","project_id":766067,"asset_id":746752,"created_at":"2024-06-07T17:12:58.110+08:00","updated_at":"2024-06-07T17:12:58.110+08:00"},{"id":17099470,"file_name":"p_2.png","project_id":766067,"asset_id":746781,"created_at":"2024-06-07T17:13:08.515+08:00","updated_at":"2024-06-07T17:13:08.515+08:00"},{"id":17099471,"file_name":"p_3.png","project_id":766067,"asset_id":746782,"created_at":"2024-06-07T17:13:08.517+08:00","updated_at":"2024-06-07T17:13:08.517+08:00"},{"id":17099460,"file_name":"n_2.png","project_id":766067,"asset_id":746771,"created_at":"2024-06-07T17:13:05.442+08:00","updated_at":"2024-06-07T17:13:05.442+08:00"},{"id":17099461,"file_name":"n_3.png","project_id":766067,"asset_id":746772,"created_at":"2024-06-07T17:13:05.444+08:00","updated_at":"2024-06-07T17:13:05.444+08:00"},{"id":17099472,"file_name":"r.png","project_id":766067,"asset_id":746783,"created_at":"2024-06-07T17:13:09.367+08:00","updated_at":"2024-06-07T17:13:09.367+08:00"},{"id":17099473,"file_name":"space.png","project_id":766067,"asset_id":746784,"created_at":"2024-06-07T17:13:09.368+08:00","updated_at":"2024-06-07T17:13:09.368+08:00"},{"id":17099474,"file_name":"tree.png","project_id":766067,"asset_id":746785,"created_at":"2024-06-07T17:13:09.788+08:00","updated_at":"2024-06-07T17:13:09.788+08:00"},{"id":17099454,"file_name":"g_0.png","project_id":766067,"asset_id":746765,"created_at":"2024-06-07T17:13:04.218+08:00","updated_at":"2024-06-07T17:13:04.218+08:00"},{"id":17099455,"file_name":"g_1.png","project_id":766067,"asset_id":746766,"created_at":"2024-06-07T17:13:04.220+08:00","updated_at":"2024-06-07T17:13:04.220+08:00"},{"id":17099456,"file_name":"m.png","project_id":766067,"asset_id":746767,"created_at":"2024-06-07T17:13:04.643+08:00","updated_at":"2024-06-07T17:13:04.643+08:00"},{"id":17099457,"file_name":"mountain.png","project_id":766067,"asset_id":746768,"created_at":"2024-06-07T17:13:04.645+08:00","updated_at":"2024-06-07T17:13:04.645+08:00"},{"id":17099462,"file_name":"n_4.png","project_id":766067,"asset_id":746773,"created_at":"2024-06-07T17:13:05.967+08:00","updated_at":"2024-06-07T17:13:05.967+08:00"},{"id":17099463,"file_name":"n_5.png","project_id":766067,"asset_id":746774,"created_at":"2024-06-07T17:13:05.969+08:00","updated_at":"2024-06-07T17:13:05.969+08:00"},{"id":17099444,"file_name":"4.png","project_id":766067,"asset_id":746755,"created_at":"2024-06-07T17:12:59.746+08:00","updated_at":"2024-06-07T17:12:59.746+08:00"},{"id":17099445,"file_name":"5.png","project_id":766067,"asset_id":746756,"created_at":"2024-06-07T17:12:59.747+08:00","updated_at":"2024-06-07T17:12:59.747+08:00"},{"id":17099448,"file_name":"8.png","project_id":766067,"asset_id":746759,"created_at":"2024-06-07T17:13:00.761+08:00","updated_at":"2024-06-07T17:13:00.761+08:00"},{"id":17099449,"file_name":"9.png","project_id":766067,"asset_id":746760,"created_at":"2024-06-07T17:13:00.762+08:00","updated_at":"2024-06-07T17:13:00.762+08:00"},{"id":17099458,"file_name":"n_0.png","project_id":766067,"asset_id":746769,"created_at":"2024-06-07T17:13:05.056+08:00","updated_at":"2024-06-07T17:13:05.056+08:00"},{"id":17099459,"file_name":"n_1.png","project_id":766067,"asset_id":746770,"created_at":"2024-06-07T17:13:05.058+08:00","updated_at":"2024-06-07T17:13:05.058+08:00"},{"id":17099442,"file_name":"2.png","project_id":766067,"asset_id":746753,"created_at":"2024-06-07T17:12:58.686+08:00","updated_at":"2024-06-07T17:12:58.686+08:00"},{"id":17099443,"file_name":"3.png","project_id":766067,"asset_id":746754,"created_at":"2024-06-07T17:12:58.688+08:00","updated_at":"2024-06-07T17:12:58.688+08:00"},{"id":17099450,"file_name":"10.png","project_id":766067,"asset_id":746761,"created_at":"2024-06-07T17:13:02.112+08:00","updated_at":"2024-06-07T17:13:02.112+08:00"},{"id":17099451,"file_name":"all.png","project_id":766067,"asset_id":746762,"created_at":"2024-06-07T17:13:02.114+08:00","updated_at":"2024-06-07T17:13:02.114+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦