{"id":168601,"student_id":3232,"content":"import game\n# 設定場景背景及設定角色\ngame.set_backdrop(\"border.jpg\")\nend = game.create_sprite(\"e.png\")\ngrass = game.create_sprite(\"grass.png\")\nend.x = 450\nend.y = 40\nend.direction = 180\n# 建立car1及初始化\ncar1 = game.create_sprite(\"car_red.png\")\ncar1.x = 340 \ncar1.y = 20\ncar1.direction = 270\n\n# 建立car2及初始化\ncar2 = game.create_sprite(\"car_blue.png\")\ncar2.x = 340\ncar2.y = 55\ncar2.direction = 270\n\ndef loop ():\n # car1左右控制\n if key.right:\n car1.direction = car1.direction + 3\n if key.left:\n car1.direction = car1.direction - 3\n \n # car1速度設定\n if car1.touched(grass):\n car1.step_forward(0.3)\n else:\n car1.step_forward(2.5)\n # car2左右控制\n if key.d:\n car2.direction = car2.direction + 3\n if key.a:\n car2.direction = car2.direction - 3\n # car2速度設定\n if car2.touched(grass):\n car2.step_forward(0.3)\n else:\n car2.step_forward(2.5)\n # 遊戲結束\n if car1.touched(end) or car2.touched(end):\n game.stop()\ngame.forever(loop)","created_at":"2020-07-20T13:30:50.230+08:00","updated_at":"2020-07-20T16:10:07.094+08:00","name":"迷你賽車_S 副本","language":"python","screenshot":{"url":"https://cdn4.koding.school/uploads/project/screenshot/168601/97990d596d0e6f919259332c7f2c1a48.jpg"},"parent_id":162823,"plugin":"game.set({'width': 640, 'height': 480})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":42,"hashid":"qmds6vg4","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2920264,"file_name":"border.jpg","project_id":168601,"asset_id":24106,"created_at":"2020-07-20T13:30:50.237+08:00","updated_at":"2020-07-20T13:30:50.237+08:00"},{"id":2920265,"file_name":"car_black.png","project_id":168601,"asset_id":24107,"created_at":"2020-07-20T13:30:50.238+08:00","updated_at":"2020-07-20T13:30:50.238+08:00"},{"id":2920266,"file_name":"car_blue.png","project_id":168601,"asset_id":24110,"created_at":"2020-07-20T13:30:50.239+08:00","updated_at":"2020-07-20T13:30:50.239+08:00"},{"id":2920267,"file_name":"car_red.png","project_id":168601,"asset_id":24108,"created_at":"2020-07-20T13:30:50.240+08:00","updated_at":"2020-07-20T13:30:50.240+08:00"},{"id":2920268,"file_name":"car_yellow.png","project_id":168601,"asset_id":24109,"created_at":"2020-07-20T13:30:50.241+08:00","updated_at":"2020-07-20T13:30:50.241+08:00"},{"id":2920269,"file_name":"grass.png","project_id":168601,"asset_id":23940,"created_at":"2020-07-20T13:30:50.243+08:00","updated_at":"2020-07-20T13:30:50.243+08:00"},{"id":2920270,"file_name":"e.png","project_id":168601,"asset_id":24111,"created_at":"2020-07-20T13:30:50.244+08:00","updated_at":"2020-07-20T13:30:50.244+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦