{"id":11102,"student_id":10,"content":"var bg_1 = createSprite('bg_1.png'); //背景1\nvar bg_2 = createSprite('bg_2.png'); //背景2\nvar target = createSprite('target.png'); //準星\nvar reward = createSprite('r0.png','r1.png','r2.png','r3.png','r4.png','r5.png','r6.png','r7.png','r8.png','r9.png','r10.png'); //獎品\nvar number = createSprite('n0.png','n1.png','n2.png','n3.png','n4.png','n5.png'); //倒數秒數\n\nnumber.opacity = 0.7;\nbg_1.layer = 1;\nnumber.layer = 2;\ntarget.layer = 3;\nreward.layer = 4;\nreward.hidden = true;\n\nvar endTime = Date.now() + 15000; //結束時間點\nvar clock = 0; //計數器\nvar scores = 0; //遊戲分數\nvar balloons = []; //存放氣球角色的陣列\n\ncreateSound('bgm.mp3', true);\n\nforever(loop); //重複不斷執行\n\nfunction loop () {\n target.x = cursor.x;\n target.y = cursor.y;\n\n clock++;\n if (clock%10 == 0) {\n //使用變數 b 存放新增創造的氣球\n var b = createSprite('a.png', 'b.png', 'c.png', 'd.png', 'e.png', 'g.png', 'f.png');\n var rand = Math.random();\n if (rand \u003c 0.3) b.costumeId = 0;\n else if (rand \u003c 0.6) b.costumeId = 1;\n else if (rand \u003c 0.7) b.costumeId = 2;\n else if (rand \u003c 0.8) b.costumeId = 3;\n else if (rand \u003c 0.9) b.costumeId = 4;\n else if (rand \u003c 0.95) b.costumeId = 5;\n else b.costumeId = 6;\n b.y = 1000;\n b.x = Math.random()*1000 + 100;\n balloons.push(b);\n }\n\n for (var i = 0; i \u003c balloons.length; i++) {\n //使用變數 b 存放從氣球陣列中逐一取出的氣球角色\n var b = balloons[i];\n if (b.costumeId == 0) b.y -= 3;\n if (b.costumeId == 1) b.y -= 5;\n if (b.costumeId == 2) b.y -= 7;\n if (b.costumeId == 3) b.y -= 8;\n if (b.costumeId == 4) b.y -= 8;\n if (b.costumeId == 5) b.y -= 7;\n if (b.costumeId == 6) b.y -= 6;\n\n if (cursor.isDown \u0026\u0026 b.touched(cursor)) {\n if (b.costumeId == 0) scores += 1;\n if (b.costumeId == 1) scores += 10;\n if (b.costumeId == 2) scores += 5;\n if (b.costumeId == 3) scores *= 2;\n if (b.costumeId == 4) scores /= 2;\n if (b.costumeId == 5) endTime += 3000;\n if (b.costumeId == 6) endTime = Date.now();\n b.destroy();\n scores = Math.floor(scores);\n createSound('shot.mp3');\n }\n }\n \n print(scores, 60, 20, 'white', 40);\n\n var time = Math.floor((endTime - Date.now())/1000);\n\n number.hidden = time \u003e 5;\n if (time == 5) number.costumeId = 5;\n if (time == 4) number.costumeId = 4;\n if (time == 3) number.costumeId = 3;\n if (time == 2) number.costumeId = 2;\n if (time == 1) number.costumeId = 1;\n if (time == 0) number.costumeId = 0;\n \n if (time \u003c 0) {\n reward.hidden = false;\n if (scores \u003e 10000000000) reward.costumeId = 0;\n else if (scores \u003e 1000000000) reward.costumeId = 1;\n else if (scores \u003e 100000000) reward.costumeId = 2;\n else if (scores \u003e 10000000) reward.costumeId = 3;\n else if (scores \u003e 1000000) reward.costumeId = 4;\n else if (scores \u003e 100000) reward.costumeId = 5;\n else if (scores \u003e 10000) reward.costumeId = 6;\n else if (scores \u003e 1000) reward.costumeId = 7;\n else if (scores \u003e 100) reward.costumeId = 8;\n else if (scores \u003e 10) reward.costumeId = 9;\n else reward.costumeId = 10;\n stop();\n }\n}","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2024-01-16T13:25:28.317+08:00","name":"射氣球(完整版)","language":"javascript","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/11102/d7f72eb85f77b49e3fb4f79f33aa33bb.jpg"},"parent_id":2,"plugin":"Game.set({width: 1200, height: 900})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":386,"hashid":"zpesj8zp","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":1962379,"file_name":"shot.mp3","project_id":11102,"asset_id":172349,"created_at":"2019-12-17T16:10:08.939+08:00","updated_at":"2019-12-17T16:10:08.939+08:00"},{"id":1962374,"file_name":"bgm.mp3","project_id":11102,"asset_id":113696,"created_at":"2019-12-17T15:26:31.882+08:00","updated_at":"2019-12-17T15:26:31.882+08:00"},{"id":3115654,"file_name":"r3.png","project_id":11102,"asset_id":251330,"created_at":"2020-08-20T12:22:47.231+08:00","updated_at":"2020-08-20T12:22:47.231+08:00"},{"id":3115655,"file_name":"r4.png","project_id":11102,"asset_id":251331,"created_at":"2020-08-20T12:22:47.233+08:00","updated_at":"2020-08-20T12:22:47.233+08:00"},{"id":3115656,"file_name":"r5.png","project_id":11102,"asset_id":251332,"created_at":"2020-08-20T12:22:47.431+08:00","updated_at":"2020-08-20T12:22:47.431+08:00"},{"id":3115657,"file_name":"r6.png","project_id":11102,"asset_id":251333,"created_at":"2020-08-20T12:22:47.432+08:00","updated_at":"2020-08-20T12:22:47.432+08:00"},{"id":3115658,"file_name":"r7.png","project_id":11102,"asset_id":251334,"created_at":"2020-08-20T12:22:47.785+08:00","updated_at":"2020-08-20T12:22:47.785+08:00"},{"id":3115659,"file_name":"r8.png","project_id":11102,"asset_id":251335,"created_at":"2020-08-20T12:22:47.786+08:00","updated_at":"2020-08-20T12:22:47.786+08:00"},{"id":3115660,"file_name":"r9.png","project_id":11102,"asset_id":251336,"created_at":"2020-08-20T12:22:48.246+08:00","updated_at":"2020-08-20T12:22:48.246+08:00"},{"id":3115661,"file_name":"r10.png","project_id":11102,"asset_id":251337,"created_at":"2020-08-20T12:22:48.247+08:00","updated_at":"2020-08-20T12:22:48.247+08:00"},{"id":3115662,"file_name":"target.png","project_id":11102,"asset_id":251338,"created_at":"2020-08-20T12:22:48.517+08:00","updated_at":"2020-08-20T12:22:48.517+08:00"},{"id":3115636,"file_name":"a.png","project_id":11102,"asset_id":251312,"created_at":"2020-08-20T12:22:43.741+08:00","updated_at":"2020-08-20T12:22:43.741+08:00"},{"id":3115637,"file_name":"b.png","project_id":11102,"asset_id":251313,"created_at":"2020-08-20T12:22:43.743+08:00","updated_at":"2020-08-20T12:22:43.743+08:00"},{"id":3115638,"file_name":"bg_1.png","project_id":11102,"asset_id":251314,"created_at":"2020-08-20T12:22:44.234+08:00","updated_at":"2020-08-20T12:22:44.234+08:00"},{"id":3115639,"file_name":"bg_2.png","project_id":11102,"asset_id":251315,"created_at":"2020-08-20T12:22:44.235+08:00","updated_at":"2020-08-20T12:22:44.235+08:00"},{"id":3115640,"file_name":"c.png","project_id":11102,"asset_id":251316,"created_at":"2020-08-20T12:22:44.438+08:00","updated_at":"2020-08-20T12:22:44.438+08:00"},{"id":3115641,"file_name":"d.png","project_id":11102,"asset_id":251317,"created_at":"2020-08-20T12:22:44.439+08:00","updated_at":"2020-08-20T12:22:44.439+08:00"},{"id":3115642,"file_name":"e.png","project_id":11102,"asset_id":251318,"created_at":"2020-08-20T12:22:44.673+08:00","updated_at":"2020-08-20T12:22:44.673+08:00"},{"id":3115643,"file_name":"f.png","project_id":11102,"asset_id":251319,"created_at":"2020-08-20T12:22:44.675+08:00","updated_at":"2020-08-20T12:22:44.675+08:00"},{"id":3115644,"file_name":"g.png","project_id":11102,"asset_id":251320,"created_at":"2020-08-20T12:22:44.997+08:00","updated_at":"2020-08-20T12:22:44.997+08:00"},{"id":3115645,"file_name":"n0.png","project_id":11102,"asset_id":251321,"created_at":"2020-08-20T12:22:44.998+08:00","updated_at":"2020-08-20T12:22:44.998+08:00"},{"id":3115646,"file_name":"n1.png","project_id":11102,"asset_id":251322,"created_at":"2020-08-20T12:22:45.592+08:00","updated_at":"2020-08-20T12:22:45.592+08:00"},{"id":3115647,"file_name":"n2.png","project_id":11102,"asset_id":251323,"created_at":"2020-08-20T12:22:45.594+08:00","updated_at":"2020-08-20T12:22:45.594+08:00"},{"id":3115648,"file_name":"n3.png","project_id":11102,"asset_id":251324,"created_at":"2020-08-20T12:22:45.954+08:00","updated_at":"2020-08-20T12:22:45.954+08:00"},{"id":3115649,"file_name":"n4.png","project_id":11102,"asset_id":251325,"created_at":"2020-08-20T12:22:45.955+08:00","updated_at":"2020-08-20T12:22:45.955+08:00"},{"id":3115650,"file_name":"n5.png","project_id":11102,"asset_id":251326,"created_at":"2020-08-20T12:22:46.465+08:00","updated_at":"2020-08-20T12:22:46.465+08:00"},{"id":3115651,"file_name":"r0.png","project_id":11102,"asset_id":251327,"created_at":"2020-08-20T12:22:46.466+08:00","updated_at":"2020-08-20T12:22:46.466+08:00"},{"id":3115652,"file_name":"r1.png","project_id":11102,"asset_id":251328,"created_at":"2020-08-20T12:22:46.911+08:00","updated_at":"2020-08-20T12:22:46.911+08:00"},{"id":3115653,"file_name":"r2.png","project_id":11102,"asset_id":251329,"created_at":"2020-08-20T12:22:46.912+08:00","updated_at":"2020-08-20T12:22:46.912+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦