{"id":16078,"student_id":10,"content":"setBackdrop(\"bg.jpg\");\nsound.play('invisible.mp3');\n\nvar redDots = [];\nvar items = [];\nvar score = 0;\nvar arrow = createSprite({\n x: 320,\n y: 240,\n costumes: \"arrow.png\"\n});\narrow.when('touch', redDots, stop);\n\nsetInterval(makeRedDot, 1000);\nsetInterval(makeItem, 3000);\n\nforever(function () {\n print('score:'+score);\n arrow.toward(cursor);\n arrow.x += (cursor.x - arrow.x) / 5;\n arrow.y += (cursor.y - arrow.y) / 5;\n for (var i = 0; i \u003c redDots.length; i++) {\n redDots[i].toward(arrow);\n redDots[i].stepForward(1)\n }\n});\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}\n\nfunction checkRedDotsCollded(target) {\n for (var i = 0; i \u003c redDots.length; i++) {\n if (redDots[i].touched(target)) {\n sound.play(\"hit.mp3\");\n var dot = redDots[i];\n redDots.splice(i, 1);\n dot.forever(function () {\n dot.scale -= 0.1;\n if (dot.scale \u003c 0.5) {\n dot.destroy();\n score++;\n }\n });\n }\n }\n}\n\nfunction makeItem() {\n var item = createSprite(['fire_icon.png', 'darts_icon.png', 'canon_icon.png']);\n item.costumeId = Math.floor(Math.random() * 3);\n item.x = Math.floor(Math.random() * 600) + 20;\n item.y = Math.floor(Math.random() * 440) + 20;\n\n arrow.when('touch', item, function (target) {\n if (target.costumeId == 0) {\n sound.play(\"fire.mp3\");\n var fire = createSprite(\"fire.png\");\n fire.scale = 0.5;\n fire.x = target.x;\n fire.y = target.y;\n fire.forever(function () {\n fire.direction += fire.scale * 10;\n fire.scale += 0.01;\n if (fire.scale \u003e 2) {\n fire.destroy();\n }\n checkRedDotsCollded(fire);\n });\n }\n if (target.costumeId == 1) {\n for (var i = 0; i \u003c 8; i++) {\n sound.play('dart.mp3');\n var dart = createSprite(\"dart.png\");\n dart.x = target.x;\n dart.y = target.y;\n dart.direction = i * 45;\n dart.forever(function () {\n this.stepForward(3);\n checkRedDotsCollded(this);\n });\n }\n }\n if (target.costumeId == 2) {\n sound.play(\"laser.mp3\");\n var cannon = createSprite(['cannon_1.png', 'cannon_2.png']);\n cannon.x = target.x;\n cannon.y = target.y;\n cannon.life = 100;\n cannon.scale = 0.5;\n cannon.forever(function () {\n if (cannon.life \u003e 0) {\n cannon.direction = arrow.direction;\n cannon.moveTo(arrow);\n cannon.stepForward(20);\n cannon.scale += 0.005;\n cannon.life--;\n } else {\n cannon.costumeId = 1;\n cannon.stepForward(10);\n if (cannon.x \u003e 640 || cannon.x \u003c 0 || cannon.y \u003c 0 || cannon.y \u003e 480) {\n cannon.destroy();\n }\n\n }\n checkRedDotsCollded(cannon);\n });\n }\n target.destroy();\n });\n\n}","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2020-04-01T10:40:26.045+08:00","name":"tilt to live","language":"javascript","screenshot":{"url":"https://cdn7.koding.school/uploads/project/screenshot/16078/0f4348f4e8f41c127f8b89f459aac892.jpg"},"parent_id":16070,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[2164],"is_featured":false,"views":549,"hashid":"meyswjy2","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":332243,"file_name":"bgm.mp3","project_id":16078,"asset_id":38905,"created_at":"2017-11-23T14:27:05.186+08:00","updated_at":"2017-11-23T14:27:05.186+08:00"},{"id":332244,"file_name":"dart_icon.png","project_id":16078,"asset_id":38888,"created_at":"2017-11-23T14:27:05.189+08:00","updated_at":"2017-11-23T14:27:05.189+08:00"},{"id":332245,"file_name":"fire.mp3","project_id":16078,"asset_id":38910,"created_at":"2017-11-23T14:27:05.191+08:00","updated_at":"2017-11-23T14:27:05.191+08:00"},{"id":332246,"file_name":"fire_icon.png","project_id":16078,"asset_id":38887,"created_at":"2017-11-23T14:27:05.194+08:00","updated_at":"2017-11-23T14:27:05.194+08:00"},{"id":332247,"file_name":"dart.mp3","project_id":16078,"asset_id":38909,"created_at":"2017-11-23T14:27:05.196+08:00","updated_at":"2017-11-23T14:27:05.196+08:00"},{"id":332248,"file_name":"fire.png","project_id":16078,"asset_id":38904,"created_at":"2017-11-23T14:27:05.198+08:00","updated_at":"2017-11-23T14:27:05.198+08:00"},{"id":332249,"file_name":"dart.png","project_id":16078,"asset_id":38903,"created_at":"2017-11-23T14:27:05.201+08:00","updated_at":"2017-11-23T14:27:05.201+08:00"},{"id":332250,"file_name":"cannon_1.png","project_id":16078,"asset_id":38902,"created_at":"2017-11-23T14:27:05.203+08:00","updated_at":"2017-11-23T14:27:05.203+08:00"},{"id":332251,"file_name":"cannon_2.png","project_id":16078,"asset_id":38897,"created_at":"2017-11-23T14:27:05.205+08:00","updated_at":"2017-11-23T14:27:05.205+08:00"},{"id":332252,"file_name":"bg.jpg","project_id":16078,"asset_id":38893,"created_at":"2017-11-23T14:27:05.208+08:00","updated_at":"2017-11-23T14:27:05.208+08:00"},{"id":332253,"file_name":"arrow.png","project_id":16078,"asset_id":38891,"created_at":"2017-11-23T14:27:05.212+08:00","updated_at":"2017-11-23T14:27:05.212+08:00"},{"id":332254,"file_name":"reddot.png","project_id":16078,"asset_id":38890,"created_at":"2017-11-23T14:27:05.215+08:00","updated_at":"2017-11-23T14:27:05.215+08:00"},{"id":332255,"file_name":"canon_icon.png","project_id":16078,"asset_id":38889,"created_at":"2017-11-23T14:27:05.217+08:00","updated_at":"2017-11-23T14:27:05.217+08:00"},{"id":332256,"file_name":"fire.mp3","project_id":16078,"asset_id":38848,"created_at":"2017-11-23T14:27:05.220+08:00","updated_at":"2017-11-23T14:27:05.220+08:00"},{"id":332257,"file_name":"hit.mp3","project_id":16078,"asset_id":38847,"created_at":"2017-11-23T14:27:05.223+08:00","updated_at":"2017-11-23T14:27:05.223+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦