{"id":755961,"student_id":10,"content":"from game import *\nfrom random import *\n\nset_backdrop('bg.png')\n\narr = []\ncenter_x = 600\ncenter_y = 300\nspeed = 1.01\nspace = speed ** 20\nreset = space ** 20\nclock = 0\n\ncar = create_sprite('car_0.png', 'car_1.png', 'car_2.png', 'car_1.png', 'car_3.png', 'car_4.png', 'car_5.png', 'car_4.png', 'car_6.png', 'car_7.png', 'car_8.png', 'car_7.png')\ncar.layer = 2\ncar.y = 600\ncar.scale = 1.4\nrule = create_sprite('rule.png')\nrule.layer = 3\nbgm = create_sound('bgm.ogg', True)\nbgm.set_volume(0.5)\nengine = create_sound('engine.wav', True)\nengine.set_volume(0.2)\n\nfor y in range(20):\n for x in range(11):\n s = create_sprite('b_0.png', 'b_1.png', 'b_2.png', 'b_3.png', 'b_4.png', 'b_5.png')\n s.scale = space ** y / 30\n s.x = 600 + s.scale * 900 * (x - 5)\n s.y = 300\n if x == 3 or x == 7: s.costume_id = 1\n arr.append(s)\n\ndef loop():\n global clock, speed\n \n clock += 1\n \n car.costume_id = (clock % 32) // 8\n if key.left: car.costume_id += 4\n elif key.right: car.costume_id += 8\n \n if not rule.hidden and (key.left or key.right):\n rule.hidden = True\n clock = 0\n \n if not rule.hidden: return\n \n draw_text(str(clock // 60) + 'm', 10, 10, 'black', 40)\n if clock % 60 == 0: speed += 0.0002\n \n for s in arr:\n s.scale *= speed\n s.x = (s.x - 600) * speed + 600\n \n if key.left: s.x += s.scale * 15\n if key.right: s.x -= s.scale * 15\n \n if s.scale \u003e= 1.6:\n s.scale /= reset\n s.x = (s.x - 600) / reset + 600\n \n if s.costume_id != 1:\n s.costume_id = 0\n rand = random()\n if rand \u003c 0.05: s.costume_id = 2\n elif rand \u003c 0.10: s.costume_id = 4\n elif rand \u003c 0.15: s.costume_id = 5\n\n if s.x \u003e 400 and s.x \u003c 800 and s.scale \u003e 1 and s.scale \u003c 1.3:\n if s.costume_id != 0 and s.costume_id != 1:\n stop()\n create_sound('hit.mp3')\n \n \n s.layer = s.scale\n \nforever(loop)\n\n","created_at":"2024-05-24T18:25:03.270+08:00","updated_at":"2024-08-01T11:33:55.595+08:00","name":"開車車","language":"python","screenshot":{"url":"https://cdn6.koding.school/uploads/project/screenshot/755961/07a9dd1773d446ad926807b21b82db34.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":137,"hashid":"5j3sjqd8j","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":16877708,"file_name":"b_0.png","project_id":755961,"asset_id":743403,"created_at":"2024-05-24T18:25:24.428+08:00","updated_at":"2024-05-24T18:25:24.428+08:00"},{"id":16877709,"file_name":"b_1.png","project_id":755961,"asset_id":743404,"created_at":"2024-05-24T18:25:24.430+08:00","updated_at":"2024-05-24T18:25:24.430+08:00"},{"id":16877720,"file_name":"car_5.png","project_id":755961,"asset_id":743415,"created_at":"2024-05-24T18:25:30.748+08:00","updated_at":"2024-05-24T18:25:30.748+08:00"},{"id":16877721,"file_name":"car_6.png","project_id":755961,"asset_id":743416,"created_at":"2024-05-24T18:25:30.750+08:00","updated_at":"2024-05-24T18:25:30.750+08:00"},{"id":16877716,"file_name":"car_1.png","project_id":755961,"asset_id":743411,"created_at":"2024-05-24T18:25:29.288+08:00","updated_at":"2024-05-24T18:25:29.288+08:00"},{"id":16877717,"file_name":"car_2.png","project_id":755961,"asset_id":743412,"created_at":"2024-05-24T18:25:29.290+08:00","updated_at":"2024-05-24T18:25:29.290+08:00"},{"id":16877714,"file_name":"bg.png","project_id":755961,"asset_id":743409,"created_at":"2024-05-24T18:25:28.848+08:00","updated_at":"2024-05-24T18:25:28.848+08:00"},{"id":16877715,"file_name":"car_0.png","project_id":755961,"asset_id":743410,"created_at":"2024-05-24T18:25:28.850+08:00","updated_at":"2024-05-24T18:25:28.850+08:00"},{"id":16877712,"file_name":"b_4.png","project_id":755961,"asset_id":743407,"created_at":"2024-05-24T18:25:28.183+08:00","updated_at":"2024-05-24T18:25:28.183+08:00"},{"id":16877713,"file_name":"b_5.png","project_id":755961,"asset_id":743408,"created_at":"2024-05-24T18:25:28.185+08:00","updated_at":"2024-05-24T18:25:28.185+08:00"},{"id":16877724,"file_name":"rule.png","project_id":755961,"asset_id":743419,"created_at":"2024-05-24T18:25:31.910+08:00","updated_at":"2024-05-24T18:25:31.910+08:00"},{"id":16877710,"file_name":"b_2.png","project_id":755961,"asset_id":743405,"created_at":"2024-05-24T18:25:26.420+08:00","updated_at":"2024-05-24T18:25:26.420+08:00"},{"id":16877711,"file_name":"b_3.png","project_id":755961,"asset_id":743406,"created_at":"2024-05-24T18:25:26.421+08:00","updated_at":"2024-05-24T18:25:26.421+08:00"},{"id":16877718,"file_name":"car_3.png","project_id":755961,"asset_id":743413,"created_at":"2024-05-24T18:25:29.733+08:00","updated_at":"2024-05-24T18:25:29.733+08:00"},{"id":16877719,"file_name":"car_4.png","project_id":755961,"asset_id":743414,"created_at":"2024-05-24T18:25:29.734+08:00","updated_at":"2024-05-24T18:25:29.734+08:00"},{"id":16877722,"file_name":"car_7.png","project_id":755961,"asset_id":743417,"created_at":"2024-05-24T18:25:31.202+08:00","updated_at":"2024-05-24T18:25:31.202+08:00"},{"id":16877723,"file_name":"car_8.png","project_id":755961,"asset_id":743418,"created_at":"2024-05-24T18:25:31.204+08:00","updated_at":"2024-05-24T18:25:31.204+08:00"},{"id":16975706,"file_name":"bgm.ogg","project_id":755961,"asset_id":744873,"created_at":"2024-05-27T14:50:56.819+08:00","updated_at":"2024-05-27T14:50:56.819+08:00"},{"id":16975707,"file_name":"engine.wav","project_id":755961,"asset_id":744874,"created_at":"2024-05-27T14:53:18.775+08:00","updated_at":"2024-05-27T14:53:18.775+08:00"},{"id":16975709,"file_name":"hit.mp3","project_id":755961,"asset_id":744875,"created_at":"2024-05-27T14:57:57.489+08:00","updated_at":"2024-05-27T14:57:57.489+08:00"},{"id":16975708,"file_name":"hit.mp3","project_id":755961,"asset_id":744875,"created_at":"2024-05-27T14:57:11.222+08:00","updated_at":"2024-05-27T14:57:11.222+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦