{"id":7981,"student_id":10,"content":"var border= createSprite(\"border.png\");\nvar road = createSprite(\"road.png\");\nvar check1 = createSprite(\"check.png\");\nvar check2 = createSprite(\"check.png\");\nvar car = createSprite(\"car.png\");\n\nborder.rotationStyle = 'fixed';\nroad.rotationStyle = 'fixed';\ncheck1.rotationStyle = \"fixed\";\ncheck2.rotationStyle = \"fixed\";\n\nvar board = createSprite(['b1.png','b2.png','b3.png','b4.png']);\nvar pointer = createSprite('pointer.png');\n\npointer.y += 240;\ncheck2.y += 1200;\n\nvar speed = 0;\nvar target = 2;\nvar startTime = Date.now();\nvar scores = [];\n\nsound.play('bgm.mp3', true);\n\n\nforever(function(){\n // print(scores.length + '/3', 10, 10, 'black', 20);\n // print(scores, 10, 50, 'black', 20);\n\n if(key.right) {\n car.direction += 3;\n speed -= 0.11;\n }\n if(key.left) {\n car.direction -= 3;\n speed -= 0.11;\n }\n if(speed \u003c 9) {\n speed += 0.08;\n }\n if(car.touched(border)) {\n speed -= 0.13;\n }\n if(speed \u003c 0.3) {\n speed = 0.3; \n }\n if(car.touched(check2) \u0026\u0026 target == 2) {\n target = 1;\n }\n if(car.touched(check1) \u0026\u0026 target == 1) {\n target = 2;\n scores.push((Date.now() - startTime)/1000);\n startTime = Date.now();\n }\n if(scores.length === 3) {\n stop();\n var avg = (scores[0] + scores[1] + scores[2])/3;\n print(avg, 220, 200, 'white', 20);\n print(scores, 220, 280, 'white', 20);\n }\n \n board.costumeId = scores.length;\n pointer.direction = speed/9*180;\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});","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2020-04-13T14:53:20.062+08:00","name":"急速賽車_概念版","language":"javascript","screenshot":{"url":"https://cdn7.koding.school/uploads/project/screenshot/7981/3157d012cdcb7a197ab2c94345b73422.jpg"},"parent_id":2,"plugin":"\n","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":431,"hashid":"wdksy54","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":1962395,"file_name":"engine.wav","project_id":7981,"asset_id":172359,"created_at":"2019-12-17T17:35:15.570+08:00","updated_at":"2019-12-17T17:35:15.570+08:00"},{"id":1962396,"file_name":"screeching.mp3","project_id":7981,"asset_id":172360,"created_at":"2019-12-17T17:45:44.537+08:00","updated_at":"2019-12-17T17:45:53.970+08:00"},{"id":1962497,"file_name":"b3.png","project_id":7981,"asset_id":172366,"created_at":"2019-12-17T18:36:05.494+08:00","updated_at":"2019-12-17T18:36:05.494+08:00"},{"id":1962498,"file_name":"b4.png","project_id":7981,"asset_id":172367,"created_at":"2019-12-17T18:36:05.496+08:00","updated_at":"2019-12-17T18:36:05.496+08:00"},{"id":1962397,"file_name":"screeching_2.mp3","project_id":7981,"asset_id":172363,"created_at":"2019-12-17T17:51:32.821+08:00","updated_at":"2019-12-17T17:51:47.192+08:00"},{"id":1962495,"file_name":"b1.png","project_id":7981,"asset_id":172364,"created_at":"2019-12-17T18:36:05.037+08:00","updated_at":"2019-12-17T18:36:05.037+08:00"},{"id":1962496,"file_name":"b2.png","project_id":7981,"asset_id":172365,"created_at":"2019-12-17T18:36:05.039+08:00","updated_at":"2019-12-17T18:36:05.039+08:00"},{"id":1962383,"file_name":"road.png","project_id":7981,"asset_id":172352,"created_at":"2019-12-17T16:33:15.559+08:00","updated_at":"2019-12-17T16:33:15.559+08:00"},{"id":1962384,"file_name":"border.png","project_id":7981,"asset_id":172353,"created_at":"2019-12-17T16:33:15.569+08:00","updated_at":"2019-12-17T16:33:15.569+08:00"},{"id":1962385,"file_name":"check.png","project_id":7981,"asset_id":172354,"created_at":"2019-12-17T16:33:15.574+08:00","updated_at":"2019-12-17T16:33:15.574+08:00"},{"id":1962386,"file_name":"car.png","project_id":7981,"asset_id":172355,"created_at":"2019-12-17T16:33:15.579+08:00","updated_at":"2019-12-17T16:33:15.579+08:00"},{"id":1962382,"file_name":"board.png","project_id":7981,"asset_id":172351,"created_at":"2019-12-17T16:33:15.551+08:00","updated_at":"2019-12-17T16:37:13.329+08:00"},{"id":1962381,"file_name":"pointer.png","project_id":7981,"asset_id":172350,"created_at":"2019-12-17T16:33:15.545+08:00","updated_at":"2019-12-17T16:37:22.120+08:00"},{"id":1962394,"file_name":"bgm.mp3","project_id":7981,"asset_id":172358,"created_at":"2019-12-17T17:34:03.870+08:00","updated_at":"2019-12-17T17:34:03.870+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦