{"id":17736,"student_id":119,"content":"setBackdrop(\"bg.jpg\");\nsound.play('bgm.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', 'dart_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 1.5) {\n fire.destroy();\n }\n checkRedDotsCollded(fire);\n });\n }\n if (target.costumeId == 1) {\n for (var i = 0; i \u003c 45; 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 * Math.random()*36;\n dart.forever(function () {\n this.stepForward(6);\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.001;\n cannon.life-=0.5;\n } else {\n cannon.costumeId = 1;\n cannon.stepForward(3);\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":"2019-11-09T16:15:56.059+08:00","name":"tilt to live","language":"javascript","screenshot":{"url":"https://cdn1.koding.school/uploads/project/screenshot/17736/af31d791ffcde2ea2e8a44060840bfa0.jpg"},"parent_id":16078,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[173,1934,1865,2155,1937,1836,2164],"is_featured":false,"views":448,"hashid":"meysw3ve","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":361905,"file_name":"hit.mp3","project_id":17736,"asset_id":38847,"created_at":"2017-12-15T22:54:23.553+08:00","updated_at":"2017-12-15T22:54:23.553+08:00"},{"id":361906,"file_name":"fire.mp3","project_id":17736,"asset_id":38848,"created_at":"2017-12-15T22:54:23.555+08:00","updated_at":"2017-12-15T22:54:23.555+08:00"},{"id":361907,"file_name":"canon_icon.png","project_id":17736,"asset_id":38889,"created_at":"2017-12-15T22:54:23.557+08:00","updated_at":"2017-12-15T22:54:23.557+08:00"},{"id":361908,"file_name":"reddot.png","project_id":17736,"asset_id":38890,"created_at":"2017-12-15T22:54:23.558+08:00","updated_at":"2017-12-15T22:54:23.558+08:00"},{"id":361909,"file_name":"arrow.png","project_id":17736,"asset_id":38891,"created_at":"2017-12-15T22:54:23.559+08:00","updated_at":"2017-12-15T22:54:23.559+08:00"},{"id":361910,"file_name":"bg.jpg","project_id":17736,"asset_id":38893,"created_at":"2017-12-15T22:54:23.561+08:00","updated_at":"2017-12-15T22:54:23.561+08:00"},{"id":361911,"file_name":"cannon_2.png","project_id":17736,"asset_id":38897,"created_at":"2017-12-15T22:54:23.562+08:00","updated_at":"2017-12-15T22:54:23.562+08:00"},{"id":361912,"file_name":"cannon_1.png","project_id":17736,"asset_id":38902,"created_at":"2017-12-15T22:54:23.564+08:00","updated_at":"2017-12-15T22:54:23.564+08:00"},{"id":361913,"file_name":"dart.png","project_id":17736,"asset_id":38903,"created_at":"2017-12-15T22:54:23.565+08:00","updated_at":"2017-12-15T22:54:23.565+08:00"},{"id":361914,"file_name":"fire.png","project_id":17736,"asset_id":38904,"created_at":"2017-12-15T22:54:23.566+08:00","updated_at":"2017-12-15T22:54:23.566+08:00"},{"id":361915,"file_name":"dart.mp3","project_id":17736,"asset_id":38909,"created_at":"2017-12-15T22:54:23.568+08:00","updated_at":"2017-12-15T22:54:23.568+08:00"},{"id":361916,"file_name":"fire_icon.png","project_id":17736,"asset_id":38887,"created_at":"2017-12-15T22:54:23.569+08:00","updated_at":"2017-12-15T22:54:23.569+08:00"},{"id":361917,"file_name":"fire.mp3","project_id":17736,"asset_id":38910,"created_at":"2017-12-15T22:54:23.570+08:00","updated_at":"2017-12-15T22:54:23.570+08:00"},{"id":361918,"file_name":"dart_icon.png","project_id":17736,"asset_id":38888,"created_at":"2017-12-15T22:54:23.572+08:00","updated_at":"2017-12-15T22:54:23.572+08:00"},{"id":361919,"file_name":"bgm.mp3","project_id":17736,"asset_id":38905,"created_at":"2017-12-15T22:54:23.574+08:00","updated_at":"2017-12-15T22:54:23.574+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦