{"id":9177,"student_id":1408,"content":"var speed = 0;\nvar round = 0;\nvar target = 2;\nvar startTime = Date.now();\nforever(function(){\n var time = Date.now() - startTime;\nprint(time/1000 + 's',100,100,'red',40);\n});\n\n\n\nforever(function(){\n\n print(round + \"/2\",10,10,'red',30);\n print(Math.floor(speed*10) + \"km\",10,40,'red',30);\n\n\n});\n\n\nforever(function(){\n if(speed\u003c9){\n speed += 0.08;\n }\n if (key.left){\n car.direction -= 3;\n speed -= 0.02;\n \n } \n if(key.right){\n car.direction += 3; \n speed -= 0.02;\n }\n\n if(speed\u003c0.3 \u0026\u0026 speed \u003e0){\n speed = 0.3; \n } \n \n if(car.touched(border)){\n speed -= 0.13;\n }\n \n if(car.touched(check2)){\n target = 1;\n \n }\n if(target == 1 \u0026\u0026 car.touched(check1)){\n target = 0;\n \n }\n if(target == 0){\n round += 1;\n target = 2; \n \n }\n if(round == 2){\n target == 0; \n speed = 0;\n print(\"Finish Round 2\");\n //這是跑完兩圈\n } \n\n border.direction = car.direction - 180;\n border.stepForward(speed);\n road.direction = car.direction - 180;\n road.stepForward(speed);\n check1.direction = car.direction - 180;\n check1.stepForward(speed);\n check2.direction = car.direction - 180;\n check2.stepForward(speed);\n \n});","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2019-11-09T00:37:28.491+08:00","name":"急速賽車","language":"javascript","screenshot":{"url":"https://cdn3.koding.school/uploads/project/screenshot/9177/01c29319e8092cc79bfeb91792535aa7.jpg"},"parent_id":9146,"plugin":"var road = createSprite(\"road.png\");\nroad.rotationStyle = 'fixed';\nvar check1 = createSprite(\"check.png\");\ncheck1.x = -1200;\ncheck1.y = -400;\ncheck1.rotationStyle = \"fixed\";\nvar check2 = createSprite(\"check.png\");\ncheck2.x = 1130;\ncheck2.y = 300;\ncheck2.rotationStyle = \"fixed\";\nvar border= createSprite(\"border.png\");\nborder.rotationStyle = 'fixed';\nvar car = createSprite(\"car.png\");\ncar.scale = 0.4;\ncar.direction = 180;\n\nvar offsetX = 1500;\nvar offsetY = 650;\n\nroad.x += offsetX;\nroad.y += offsetY;\nborder.x += offsetX;\nborder.y += offsetY;\ncheck1.x += offsetX;\ncheck1.y += offsetY;\ncheck2.x += offsetX;\ncheck2.y += offsetY;","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":106,"hashid":"2pdsdn2","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":202418,"file_name":"car.png","project_id":9177,"asset_id":24181,"created_at":"2017-08-12T13:34:26.664+08:00","updated_at":"2017-08-12T13:34:26.664+08:00"},{"id":202419,"file_name":"border.png","project_id":9177,"asset_id":24182,"created_at":"2017-08-12T13:34:26.666+08:00","updated_at":"2017-08-12T13:34:26.666+08:00"},{"id":202420,"file_name":"road.png","project_id":9177,"asset_id":24183,"created_at":"2017-08-12T13:34:26.668+08:00","updated_at":"2017-08-12T13:34:26.668+08:00"},{"id":202421,"file_name":"check.png","project_id":9177,"asset_id":24184,"created_at":"2017-08-12T13:34:26.670+08:00","updated_at":"2017-08-12T13:34:26.670+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦