{"id":21685,"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:49:44.367+08:00","updated_at":"2019-11-09T15:16:21.481+08:00","name":"Tilt to live testing project","language":"javascript","screenshot":{"url":"https://cdn4.koding.school/uploads/project/screenshot/21685/89edcce60b8890776f43b51e69f48ea4.jpg"},"parent_id":21673,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":157,"hashid":"yeysqrgk","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":419729,"file_name":"reddot.png","project_id":21685,"asset_id":38890,"created_at":"2018-02-03T14:49:44.376+08:00","updated_at":"2018-02-03T14:49:44.376+08:00"},{"id":419730,"file_name":"fire_icon.png","project_id":21685,"asset_id":38887,"created_at":"2018-02-03T14:49:44.378+08:00","updated_at":"2018-02-03T14:49:44.378+08:00"},{"id":419731,"file_name":"fire.png","project_id":21685,"asset_id":38904,"created_at":"2018-02-03T14:49:44.380+08:00","updated_at":"2018-02-03T14:49:44.380+08:00"},{"id":419732,"file_name":"dart_icon.png","project_id":21685,"asset_id":38888,"created_at":"2018-02-03T14:49:44.382+08:00","updated_at":"2018-02-03T14:49:44.382+08:00"},{"id":419733,"file_name":"dart.png","project_id":21685,"asset_id":38903,"created_at":"2018-02-03T14:49:44.384+08:00","updated_at":"2018-02-03T14:49:44.384+08:00"},{"id":419734,"file_name":"canon_icon.png","project_id":21685,"asset_id":38889,"created_at":"2018-02-03T14:49:44.386+08:00","updated_at":"2018-02-03T14:49:44.386+08:00"},{"id":419735,"file_name":"cannon_2.png","project_id":21685,"asset_id":38897,"created_at":"2018-02-03T14:49:44.388+08:00","updated_at":"2018-02-03T14:49:44.388+08:00"},{"id":419736,"file_name":"cannon_1.png","project_id":21685,"asset_id":38902,"created_at":"2018-02-03T14:49:44.389+08:00","updated_at":"2018-02-03T14:49:44.389+08:00"},{"id":419737,"file_name":"Hit.mp3","project_id":21685,"asset_id":49048,"created_at":"2018-02-03T14:49:44.391+08:00","updated_at":"2018-02-03T14:49:44.391+08:00"},{"id":419738,"file_name":"fire.mp3","project_id":21685,"asset_id":49048,"created_at":"2018-02-03T14:49:44.393+08:00","updated_at":"2018-02-03T14:49:44.393+08:00"},{"id":419739,"file_name":"dart.mp3","project_id":21685,"asset_id":49048,"created_at":"2018-02-03T14:49:44.395+08:00","updated_at":"2018-02-03T14:49:44.395+08:00"},{"id":419740,"file_name":"bgm.mp3","project_id":21685,"asset_id":49048,"created_at":"2018-02-03T14:49:44.397+08:00","updated_at":"2018-02-03T14:49:44.397+08:00"},{"id":419741,"file_name":"cannon.mp3","project_id":21685,"asset_id":49048,"created_at":"2018-02-03T14:49:44.398+08:00","updated_at":"2018-02-03T14:49:44.398+08:00"},{"id":419742,"file_name":"bg.jpg","project_id":21685,"asset_id":38893,"created_at":"2018-02-03T14:49:44.400+08:00","updated_at":"2018-02-03T14:49:44.400+08:00"},{"id":419743,"file_name":"arrow.png","project_id":21685,"asset_id":38891,"created_at":"2018-02-03T14:49:44.402+08:00","updated_at":"2018-02-03T14:49:44.402+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
繁中
简中
English
日本語
1:1:1
1:1
全寬
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦