{"id":1023865,"student_id":2589,"content":"from time import time\nfrom game import (\n create_sprite,\n create_sound,\n draw_text,\n forever,\n stop,\n)\n\nroad = create_sprite('road.png')\ncheck1 = create_sprite('check.png')\ncheck2 = create_sprite('check.png')\nborder = create_sprite('border.png')\ncar = create_sprite('car.png')\ndashboard = create_sprite('dashboard.png')\nresult_board = create_sprite('result.png')\nmini_road = create_sprite('road.png')\nmini_car = create_sprite('car.png')\n\nmini_road.scale = 1 / 15\nmini_car.scale = 1 / 2\n\nmini_road.move_to(1000, 700)\nmini_car.move_to(1000, 700)\n\nroad.rotation_style = 'fixed'\ncheck1.rotation_style = 'fixed'\ncheck2.rotation_style = 'fixed'\nborder.rotation_style = 'fixed'\n\nresult_board.hidden = True\n\ncheck1.move_to(600, 400)\ncheck2.move_to(600, -1750)\n\nstart_time = time()\nspeed = 5\nturns = 1\ntimer = 0\nt1 = 0\nt2 = 0\nt3 = 0\nis_checked = False\n\n\n\ndef loop():\n global speed, start_time, turns, is_checked, timer, t1, t2, t3\n\n if key.right == True:\n car.direction = car.direction + 3\n speed = speed - 0.2\n \n if key.left == True:\n car.direction = car.direction - 3\n speed = speed - 0.2\n \n if speed \u003c 12:\n speed = speed + 0.15\n \n if car.touched(border) == True:\n speed = speed - 0.3\n \n if speed \u003c 0.6:\n speed = 0.6\n\n border.direction = car.direction + 180\n border.step_forward(speed)\n road.direction = car.direction + 180\n road.step_forward(speed)\n check1.direction = car.direction + 180\n check1.step_forward(speed)\n check2.direction = car.direction + 180\n check2.step_forward(speed)\n \n if car.touched(check1) == True and is_checked == True:\n if turns == 1:\n t1 = timer\n if turns == 2:\n t2 = timer\n if turns == 3:\n t3 = timer\n start_time = time()\n print(t1, t2, t3)\n turns = turns + 1\n is_checked = False\n \n if car.touched(check2) == True:\n is_checked = True\n \n if turns == 4:\n result_board.hidden = False\n avg = (t1 + t2 + t3) / 3\n draw_text(str(round(t1, 3)) + 's', 550, 340, 'white', 30)\n draw_text(str(round(t2, 3)) + 's', 550, 415, 'white', 30)\n draw_text(str(round(t3, 3)) + 's', 550, 490, 'white', 30)\n draw_text(str(round(avg, 3)) + 's', 550, 565, 'white', 30)\n stop()\n \n mini_car.direction = car.direction\n mini_car.step_forward(speed / 15)\n\n timer = time() - start_time\n\n draw_text(str(turns) + '/3', 350, 80, 'black', 40)\n draw_text(str(round(timer, 3)) + 's', 1000, 80, 'white', 40)\n draw_text(str(round(speed * 10)) + ' km/h', 80, 80, 'white', 40)\n\n\nforever(loop)\n","created_at":"2025-05-29T12:17:00.696+08:00","updated_at":"2025-05-29T12:18:09.493+08:00","name":"9_B_B_瘋狂賽車_綜合練習_【講解】移動迷你車 副本","language":"python","screenshot":{"url":null},"parent_id":1011960,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":64,"hashid":"4y3s995y6","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":38686642,"file_name":"road.png","project_id":1023865,"asset_id":251810,"created_at":"2025-05-29T12:17:00.701+08:00","updated_at":"2025-05-29T12:17:00.701+08:00"},{"id":38686643,"file_name":"result.png","project_id":1023865,"asset_id":251811,"created_at":"2025-05-29T12:17:00.702+08:00","updated_at":"2025-05-29T12:17:00.702+08:00"},{"id":38686644,"file_name":"engine.mp3","project_id":1023865,"asset_id":251812,"created_at":"2025-05-29T12:17:00.703+08:00","updated_at":"2025-05-29T12:17:00.703+08:00"},{"id":38686645,"file_name":"dashboard.png","project_id":1023865,"asset_id":251813,"created_at":"2025-05-29T12:17:00.704+08:00","updated_at":"2025-05-29T12:17:00.704+08:00"},{"id":38686646,"file_name":"check.png","project_id":1023865,"asset_id":251814,"created_at":"2025-05-29T12:17:00.705+08:00","updated_at":"2025-05-29T12:17:00.705+08:00"},{"id":38686647,"file_name":"car.png","project_id":1023865,"asset_id":251815,"created_at":"2025-05-29T12:17:00.706+08:00","updated_at":"2025-05-29T12:17:00.706+08:00"},{"id":38686648,"file_name":"border.png","project_id":1023865,"asset_id":251816,"created_at":"2025-05-29T12:17:00.707+08:00","updated_at":"2025-05-29T12:17:00.707+08:00"},{"id":38686649,"file_name":"bgm.mp3","project_id":1023865,"asset_id":251817,"created_at":"2025-05-29T12:17:00.709+08:00","updated_at":"2025-05-29T12:17:00.709+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
繁中
简中
English
日本語
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦