{"id":16258,"student_id":1791,"content":"var speed = 0;\nvar round = 0;\nvar target = 2;\nvar startTime = Date.now();\nroad.direction = 360;\nborder.direction = 360; \ncheck1.direction = 360;\ncheck2.direction = 360;\n\nforever(function(){\n if(key.right){\n car.direction +=3;\n road.direction = car.direction-180;\n border.direction = car.direction-180;\n check1.direction = car.direction-180;\n check2.direction = car.direction-180;\n if(speed \u003e 1){\n speed -= 0.1;\n };\n };\n if(key.left){\n car.direction -= 3;\n road.direction = car.direction-180;\n border.direction = car.direction-180;\n check1.direction = car.direction-180;\n check2.direction = car.direction-180;\n if(speed \u003e 1){\n speed -= 0.1;\n };\n };\n if(car.touched(border) \u0026\u0026 speed \u003e 1){\n speed-=0.13;\n };\n if(car.touched(check1) \u0026\u0026 target == 1){\n target = 2;\n round += 1;\n };\n if(car.touched(check2) \u0026\u0026 target == 2){\n target = 1;\n };\n if(round == 2){\n speed = 0;\n };\n if(key.space \u0026\u0026 speed\u003e3){\n speed -= 0.5;\n };\n if(key.enter){\n round = 0;\n startTime = Date.now();\n //check1.x = 0;\n //check1.y = 0;\n //check2.x = 0;\n //check2.y = 0;\n //border.x = 0;\n //border.y = 0;\n //road.x = 0;\n\n //road.y = 0;\n };\n \n\n road.stepForward(speed);\n border.stepForward(speed);\n check1.stepForward(speed);\n check2.stepForward(speed);\n if(speed\u003c=9){\n speed += 0.08;\n };\n print((Date.now()-startTime)/1000+\"s\",40,20,\"orange\",50);\n print(round+\"/2\",40,60,\"orange\",50);\n});","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2019-10-24T09:56:02.147+08:00","name":"急速賽車","language":"javascript","screenshot":{"url":"https://cdn2.koding.school/uploads/project/screenshot/16258/7906c63b6b5955bb8dae9eb8055e6bd6.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":86,"hashid":"5j3s9mq8","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":335431,"file_name":"car.png","project_id":16258,"asset_id":24181,"created_at":"2017-11-25T10:21:45.617+08:00","updated_at":"2017-11-25T10:21:45.617+08:00"},{"id":335432,"file_name":"border.png","project_id":16258,"asset_id":24182,"created_at":"2017-11-25T10:21:45.618+08:00","updated_at":"2017-11-25T10:21:45.618+08:00"},{"id":335433,"file_name":"road.png","project_id":16258,"asset_id":24183,"created_at":"2017-11-25T10:21:45.620+08:00","updated_at":"2017-11-25T10:21:45.620+08:00"},{"id":335434,"file_name":"check.png","project_id":16258,"asset_id":24184,"created_at":"2017-11-25T10:21:45.621+08:00","updated_at":"2017-11-25T10:21:45.621+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦