{"id":21673,"student_id":139,"content":"setBackdrop(\"bg.jpg\")\nvar score = 0\nvar arrow = createSprite({\n x: 320,\n y: 240,\n costumes: [\"arrow.png\"]\n});\nvar redDots = []\n\nfunction makeRedDot() {\n var redDot = createSprite(\"reddot.png\")\n redDot.x = Math.floor(Math.random() * 2) * 640\n redDot.y = Math.floor(Math.random() * 2) * 480\n redDots.push(redDot)\n}\nfunction makeItem() {\n var item = createSprite([\"fire_icon.png\", \"dart_icon.png\", \"canon_icon.png\"]);\n item.costumeId = Math.floor(Math.random()*3)\n item.x = Math.random() * 600 + 20\n item.y = Math.random() * 400 + 20\n arrow.when('touch', item, function (target) {\n\n if (target.costumeId == 0) {\n sound.play(\"fire.mp3\")\n var fire = createSprite(\"fire.png\");\n fire.moveTo(target)\n fire.scale = 0.3\n fire.forever(function () {\n this.direction += this.scale * 10\n this.scale += 0.01\n if (this.scale \u003e 2) {\n this.destroy()\n }\n });\n fire.when('touch', redDots, function (dot) {\n sound.play(\"hit.mp3\")\n score ++;\n dot.destroy();\n })\n }\n if (target.costumeId == 1) {\n for (var i = 0; i \u003c 40; i++) {\n sound.play(\"dart.mp3\")\n var dart = createSprite(\"dart.png\");\n dart.moveTo(target)\n dart.direction += i *10\n dart.forever(function () {\n this.stepForward(4)\n if (this.x \u003e 640 || this.x \u003c 0 || this.y \u003c 0 || this.y \u003e 480) {\n this.destroy()\n }\n });\n dart.when('touch', redDots, function (dot) {\n sound.play(\"hit.mp3\")\n score ++;\n dot.destroy();\n\n })\n }\n }\n if (target.costumeId == 2) {\n sound.play(\"cannon.mp3\")\n var cannon = createSprite([\"cannon_1.png\", \"cannon_2.png\"])\n cannon.scale = 0.5\n cannon.chargingTime = 10\n cannon.forever(function () {\n if(this.chargingTime\u003e0){\n this.moveTo(arrow)\n this.direction = arrow.direction\n this.stepForward(20)\n this.scale += 0.005\n this.chargingTime--;\n }else{\n this.costumeId = 1\n this.stepForward(10)\n if (this.x \u003e 640 || this.x \u003c 0 || this.y \u003c 0 || this.y \u003e 480) {\n this.destroy()\n }\n }\n });\n cannon.when('touch', redDots, function (dot) {\n sound.play(\"hit.mp3\")\n score ++;\n dot.destroy();\n })\n\n\n }\n \n target.destroy()\n })\n\n\n}\n\nsetInterval(makeRedDot, 1000)\nsetInterval(makeItem, 2000)\nsound.play(\"bgm.mp3\")\nforever(function () {\n \n print('score:'+score)\n \n \n arrow.toward(cursor)\n var speed = arrow.distanceTo(cursor) / 5\n arrow.stepForward(speed)\n\n if (arrow.touched(redDots)) {\n stop()\n }\n\n\n for (var i = 0; i \u003c redDots.length; i++) {\n redDots[i].toward(arrow)\n redDots[i].stepForward(2)\n }\n});","created_at":"2018-02-03T14:28:31.120+08:00","updated_at":"2019-10-29T20:42:11.579+08:00","name":"Tilt to live testing project","language":"javascript","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/21673/89edcce60b8890776f43b51e69f48ea4.jpg"},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":181,"hashid":"ej9s9we2","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":419693,"file_name":"arrow.png","project_id":21673,"asset_id":38891,"created_at":"2018-02-03T14:38:40.920+08:00","updated_at":"2018-02-03T14:38:40.920+08:00"},{"id":419694,"file_name":"bg.jpg","project_id":21673,"asset_id":38893,"created_at":"2018-02-03T14:38:45.969+08:00","updated_at":"2018-02-03T14:38:45.969+08:00"},{"id":419696,"file_name":"cannon.mp3","project_id":21673,"asset_id":49048,"created_at":"2018-02-03T14:39:25.694+08:00","updated_at":"2018-02-03T14:39:25.694+08:00"},{"id":419697,"file_name":"bgm.mp3","project_id":21673,"asset_id":49048,"created_at":"2018-02-03T14:39:51.575+08:00","updated_at":"2018-02-03T14:39:51.575+08:00"},{"id":419698,"file_name":"dart.mp3","project_id":21673,"asset_id":49048,"created_at":"2018-02-03T14:40:04.560+08:00","updated_at":"2018-02-03T14:40:04.560+08:00"},{"id":419699,"file_name":"fire.mp3","project_id":21673,"asset_id":49048,"created_at":"2018-02-03T14:40:08.305+08:00","updated_at":"2018-02-03T14:40:08.305+08:00"},{"id":419700,"file_name":"Hit.mp3","project_id":21673,"asset_id":49048,"created_at":"2018-02-03T14:40:11.269+08:00","updated_at":"2018-02-03T14:40:11.269+08:00"},{"id":419701,"file_name":"cannon_1.png","project_id":21673,"asset_id":38902,"created_at":"2018-02-03T14:40:18.942+08:00","updated_at":"2018-02-03T14:40:18.942+08:00"},{"id":419702,"file_name":"cannon_2.png","project_id":21673,"asset_id":38897,"created_at":"2018-02-03T14:40:22.018+08:00","updated_at":"2018-02-03T14:40:22.018+08:00"},{"id":419703,"file_name":"canon_icon.png","project_id":21673,"asset_id":38889,"created_at":"2018-02-03T14:40:27.079+08:00","updated_at":"2018-02-03T14:40:27.079+08:00"},{"id":419704,"file_name":"dart.png","project_id":21673,"asset_id":38903,"created_at":"2018-02-03T14:40:31.402+08:00","updated_at":"2018-02-03T14:40:31.402+08:00"},{"id":419705,"file_name":"dart_icon.png","project_id":21673,"asset_id":38888,"created_at":"2018-02-03T14:40:35.623+08:00","updated_at":"2018-02-03T14:40:35.623+08:00"},{"id":419706,"file_name":"fire.png","project_id":21673,"asset_id":38904,"created_at":"2018-02-03T14:40:41.842+08:00","updated_at":"2018-02-03T14:40:41.842+08:00"},{"id":419707,"file_name":"fire_icon.png","project_id":21673,"asset_id":38887,"created_at":"2018-02-03T14:40:48.251+08:00","updated_at":"2018-02-03T14:40:48.251+08:00"},{"id":419708,"file_name":"reddot.png","project_id":21673,"asset_id":38890,"created_at":"2018-02-03T14:40:52.998+08:00","updated_at":"2018-02-03T14:40:52.998+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
繁中
简中
English
日本語
1:1:1
1:1
全寬
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦