{"id":20383,"student_id":173,"content":"setBackdrop(\"bg.jpg\");\r\n\r\n\r\nvar arrow = createSprite({\r\n x: 320,\r\n y: 240,\r\n costumes: \"arrow.png\"\r\n});\r\n\r\nvar redDots = [];\r\nvar score = 0\r\n\r\nfunction makeRedDot() {\r\n var redDot = createSprite(\"reddot.png\");\r\n redDot.direction=Math.random()*360\r\n redDot.stepForward(700)\r\n redDots.push(redDot);\r\n}\r\n\r\nfunction makeItem() {\r\n var item = createSprite([\"fire_icon.png\", \"dart_icon.png\", \"canon_icon.png\"]);\r\n item.costumeId = Math.floor(Math.random() * 3)\r\n item.x = Math.random() * 600 + 20\r\n item.y = Math.random() * 440 + 20\r\n arrow.when(\"touch\", item, function (target) {\r\n if (target.costumeId == 0) {\r\n sound.play(\"fire.mp3\")\r\n var fire = createSprite(\"fire.png\")\r\n fire.moveTo(target)\r\n fire.scale = 0.5\r\n fire.forever(function () {\r\n this.direction += this.scale * 10\r\n this.scale += 0.01\r\n if (this.scale \u003e 2) {\r\n this.destroy()\r\n }\r\n })\r\n fire.when(\"touch\", redDots, function (dot) {\r\n sound.play(\"hit.mp3\")\r\n score++\r\n dot.destroy()\r\n })\r\n }\r\n\r\n\r\n if (target.costumeId == 1) {\r\n sound.play(\"dart.mp3\")\r\n\r\n for (var i = 0; i \u003c 8; i++) {\r\n var dart = createSprite(\"dart.png\");\r\n dart.moveTo(target)\r\n dart.direction += i * 45\r\n dart.forever(function () {\r\n this.stepForward(3)\r\n if (this.x640 || this.x \u003c 0 || this.y \u003c 0 || this.y \u003e 480) {\r\n this.destroy()\r\n }\r\n });\r\n dart.when(\"touch\", redDots, function (dot) {\r\n sound.play(\"hit.mp3\")\r\n score++\r\n dot.destroy()\r\n })\r\n }\r\n }\r\n if (target.costumeId == 2) {\r\n sound.play(\"cannon.mp3\")\r\n var cannon = createSprite([\"cannon_1.png\", \"cannon_2.png\"]);\r\n cannon.scale = 0.5\r\n cannon.chargingTime = 100\r\n cannon.forever(function () {\r\n if (this.chargingTime \u003e 0) {\r\n this.moveTo(arrow)\r\n this.direction = arrow.direction\r\n this.stepForward(20)\r\n this.scale += 0.005\r\n this.chargingTime--\r\n } else {\r\n this.costumeId = 1\r\n this.stepForward(10)\r\n if (this.x \u003e 640 || this.x \u003c 0 || this.y \u003c 0 || this.y \u003e 480) {\r\n this.destroy()\r\n }\r\n }\r\n });\r\n cannon.when(\"touch\", redDots, function (dot) {\r\n sound.play(\"hit.mp3\")\r\n score++\r\n dot.destroy()\r\n })\r\n }\r\n target.destroy()\r\n })\r\n}\r\nmakeItem()\r\nsetInterval(makeRedDot, 500 )\r\nsetInterval(makeItem, 10000 )\r\nsound.play(\"bgm.mp3\")\r\nforever(function () {\r\n print(\"score:\" + score)\r\n arrow.toward(cursor);\r\n var speed = arrow.distanceTo(cursor) / 5\r\n arrow.stepForward(speed)\r\n\r\n if (arrow.touched(redDots)) {\r\n stop();\r\n }\r\n\r\n for (var i = 0; i \u003c redDots.length; i++) {\r\n redDots[i].toward(arrow);\r\n redDots[i].stepForward(1)\r\n }\r\n\r\n});\r\n\r\n","created_at":"2018-01-20T08:54:55.573+08:00","updated_at":"2019-11-09T17:08:01.664+08:00","name":"tilt to live","language":"javascript","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/20383/349e3165ab12810c9cd0e795fb74cfdd.jpg"},"parent_id":20090,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":145,"hashid":"meys6vv2","is_content_changed":false,"review_status":"reviewed","submitted_at":"2018-01-21T21:04:40.890+08:00","reviewed_at":null,"advise":"讚喔! 很有難度!","is_deleted":false}
[{"id":399936,"file_name":"dart.mp3","project_id":20383,"asset_id":43933,"created_at":"2018-01-20T08:54:55.583+08:00","updated_at":"2018-01-20T08:54:55.583+08:00"},{"id":399937,"file_name":"hit.mp3","project_id":20383,"asset_id":43932,"created_at":"2018-01-20T08:54:55.586+08:00","updated_at":"2018-01-20T08:54:55.586+08:00"},{"id":399938,"file_name":"fire_icon.png","project_id":20383,"asset_id":43931,"created_at":"2018-01-20T08:54:55.587+08:00","updated_at":"2018-01-20T08:54:55.587+08:00"},{"id":399939,"file_name":"dart_icon.png","project_id":20383,"asset_id":43930,"created_at":"2018-01-20T08:54:55.589+08:00","updated_at":"2018-01-20T08:54:55.589+08:00"},{"id":399940,"file_name":"canon_icon.png","project_id":20383,"asset_id":43929,"created_at":"2018-01-20T08:54:55.591+08:00","updated_at":"2018-01-20T08:54:55.591+08:00"},{"id":399941,"file_name":"reddot.png","project_id":20383,"asset_id":43928,"created_at":"2018-01-20T08:54:55.592+08:00","updated_at":"2018-01-20T08:54:55.592+08:00"},{"id":399942,"file_name":"arrow.png","project_id":20383,"asset_id":43927,"created_at":"2018-01-20T08:54:55.594+08:00","updated_at":"2018-01-20T08:54:55.594+08:00"},{"id":399943,"file_name":"bg.jpg","project_id":20383,"asset_id":43926,"created_at":"2018-01-20T08:54:55.595+08:00","updated_at":"2018-01-20T08:54:55.595+08:00"},{"id":399944,"file_name":"cannon_2.png","project_id":20383,"asset_id":43925,"created_at":"2018-01-20T08:54:55.597+08:00","updated_at":"2018-01-20T08:54:55.597+08:00"},{"id":399945,"file_name":"cannon_1.png","project_id":20383,"asset_id":43924,"created_at":"2018-01-20T08:54:55.599+08:00","updated_at":"2018-01-20T08:54:55.599+08:00"},{"id":399946,"file_name":"dart.png","project_id":20383,"asset_id":43923,"created_at":"2018-01-20T08:54:55.600+08:00","updated_at":"2018-01-20T08:54:55.600+08:00"},{"id":399947,"file_name":"fire.png","project_id":20383,"asset_id":43922,"created_at":"2018-01-20T08:54:55.602+08:00","updated_at":"2018-01-20T08:54:55.602+08:00"},{"id":399948,"file_name":"bgm.mp3","project_id":20383,"asset_id":43921,"created_at":"2018-01-20T08:54:55.604+08:00","updated_at":"2018-01-20T08:54:55.604+08:00"},{"id":399949,"file_name":"fire.mp3","project_id":20383,"asset_id":43920,"created_at":"2018-01-20T08:54:55.605+08:00","updated_at":"2018-01-20T08:54:55.605+08:00"},{"id":399950,"file_name":"cannon.mp3","project_id":20383,"asset_id":43919,"created_at":"2018-01-20T08:54:55.607+08:00","updated_at":"2018-01-20T08:54:55.607+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦