{"id":165406,"student_id":10,"content":"setBackdrop('bg.png'); //設定背景\nvar ship = createSprite('player.png'); //飛船\nvar food = createSprite('food_0.png', 'food_1.png', 'food_2.png'); //目標物\nvar bars = createSprite('dd0.png', 'd1.png', 'd2.png', 'd3.png', 'd4.png', 'd5.png', 'd6.png', 'd7.png'); //儀表板\nvar n1 = createSprite('0.png', '1.png', '2.png', '3.png', '4.png', '5.png', '6.png', '7.png', '8.png', '9.png'); //百位數\nvar n2 = createSprite('0.png', '1.png', '2.png', '3.png', '4.png', '5.png', '6.png', '7.png', '8.png', '9.png'); //十位數\nvar n3 = createSprite('0.png', '1.png', '2.png', '3.png', '4.png', '5.png', '6.png', '7.png', '8.png', '9.png'); //個位數\nvar gameover = createSprite('gameover.png');\n\nvar shadows = []; //存放火焰角色\nvar bullets = []; //存放子彈角色\nvar level = 0; //遊戲等級\nvar clock = 0; //計數器\nvar end = 0; //緩慢模式結束時間點\nvar life = 7; //遊戲生命\nvar isStart = false; //是否開始遊戲\n\nn1.moveTo(550, 50);\nn2.moveTo(600, 50);\nn3.moveTo(650, 50);\nbars.moveTo(600, 850);\n\ngameover.hidden = true;\n\nfood.x = 100 + Math.random() * 1000;\nfood.y = 100 + Math.random() * 700;\nship.layer = 1;\n\nvar bgm = sound.play('bgm.mp3', true);\n\nforever(loop); //重複不斷執行遊戲回圈\n\n//遊戲主迴圈\nfunction loop () {\n \n if (isStart) {\n \n var speed = ship.distanceTo(cursor)/20;\n ship.toward(cursor);\n ship.stepForward(speed);\n \n clock++;\n if ((clock \u003e end \u0026\u0026 clock %2 == 0) || clock%8 == 0) {\n var bullet = createSprite('bullet_0.png', 'bullet_1.png');\n bullet.direction = Math.random()*360;\n bullet.stepForward(1200);\n bullet.direction = Math.random()*360;;\n bullets.push(bullet);\n }\n }\n\n for (var i = 0; i \u003c bullets.length; i++) {\n var b = bullets[i];\n if (b.distanceTo(600, 450) \u003e 1200) {\n b.destroy();\n }\n if (b.touched(ship)) {\n b.destroy();\n life--;\n sound.play('hit.wav');\n }\n if (clock \u003c end) {\n b.stepForward(1);\n b.costumeId = 1;\n } else {\n b.stepForward(4);\n b.costumeId = 0;\n }\n }\n\n if (ship.touched(food)) {\n food.x = 100 + Math.random() * 1000;\n food.y = 100 + Math.random() * 700;\n\n if (food.costumeId == 1 \u0026\u0026 life \u003c 7) {\n life++;\n }\n if (food.costumeId == 2) {\n end = clock + 500;\n }\n\n level += 1;\n if (level % 10 == 4) {\n food.costumeId = 2;\n } else if (level % 10 == 9) {\n food.costumeId = 1;\n } else {\n food.costumeId = 0;\n }\n sound.play('effect.wav');\n }\n\n n1.costumeId = Math.floor(level/100)%10;\n n2.costumeId = Math.floor(level/10)%10;\n n3.costumeId = Math.floor(level/1)%10;\n\n bars.costumeId = life;\n if (life \u003c= 0) {\n stop();\n gameover.hidden = false;\n }\n\n if (clock%5 == 0) {\n var shadow = createSprite('flame.png');\n shadow.direction = ship.direction + 90;\n shadow.moveTo(ship);\n shadows.push(shadow);\n }\n for (var i = 0; i \u003c shadows.length; i++) {\n shadows[i].opacity -= 0.01;\n shadows[i].scale -= 0.01;\n if (shadows[i].opacity \u003c 0) {\n shadows[i].destroy();\n }\n }\n \n if (cursor.isDown) {\n isStart = true;\n }\n};\n","created_at":"2020-07-15T16:10:44.264+08:00","updated_at":"2024-01-16T13:22:42.458+08:00","name":"飛行訓練_雙師班_v3","language":"javascript","screenshot":{"url":"https://cdn5.koding.school/uploads/project/screenshot/165406/d7f72eb85f77b49e3fb4f79f33aa33bb.jpg"},"parent_id":136305,"plugin":"Game.set({width: 1200, height: 900})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":279,"hashid":"p93s9gkn","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2875172,"file_name":"dd0.png","project_id":165406,"asset_id":237098,"created_at":"2020-07-15T16:10:44.270+08:00","updated_at":"2020-07-15T16:10:44.270+08:00"},{"id":2875173,"file_name":"hit.wav","project_id":165406,"asset_id":237097,"created_at":"2020-07-15T16:10:44.272+08:00","updated_at":"2020-07-15T16:10:44.272+08:00"},{"id":2875174,"file_name":"player.png","project_id":165406,"asset_id":204005,"created_at":"2020-07-15T16:10:44.273+08:00","updated_at":"2020-07-15T16:10:44.273+08:00"},{"id":2875175,"file_name":"food_2.png","project_id":165406,"asset_id":204004,"created_at":"2020-07-15T16:10:44.274+08:00","updated_at":"2020-07-15T16:10:44.274+08:00"},{"id":2875176,"file_name":"food_1.png","project_id":165406,"asset_id":204003,"created_at":"2020-07-15T16:10:44.275+08:00","updated_at":"2020-07-15T16:10:44.275+08:00"},{"id":2875177,"file_name":"food_0.png","project_id":165406,"asset_id":203712,"created_at":"2020-07-15T16:10:44.276+08:00","updated_at":"2020-07-15T16:10:44.276+08:00"},{"id":2875178,"file_name":"flame.png","project_id":165406,"asset_id":204002,"created_at":"2020-07-15T16:10:44.277+08:00","updated_at":"2020-07-15T16:10:44.277+08:00"},{"id":2875179,"file_name":"d7.png","project_id":165406,"asset_id":204001,"created_at":"2020-07-15T16:10:44.278+08:00","updated_at":"2020-07-15T16:10:44.278+08:00"},{"id":2875180,"file_name":"d6.png","project_id":165406,"asset_id":204000,"created_at":"2020-07-15T16:10:44.279+08:00","updated_at":"2020-07-15T16:10:44.279+08:00"},{"id":2875181,"file_name":"d5.png","project_id":165406,"asset_id":203999,"created_at":"2020-07-15T16:10:44.280+08:00","updated_at":"2020-07-15T16:10:44.280+08:00"},{"id":2875182,"file_name":"d4.png","project_id":165406,"asset_id":203998,"created_at":"2020-07-15T16:10:44.281+08:00","updated_at":"2020-07-15T16:10:44.281+08:00"},{"id":2875183,"file_name":"d3.png","project_id":165406,"asset_id":203997,"created_at":"2020-07-15T16:10:44.281+08:00","updated_at":"2020-07-15T16:10:44.281+08:00"},{"id":2875184,"file_name":"d2.png","project_id":165406,"asset_id":203996,"created_at":"2020-07-15T16:10:44.282+08:00","updated_at":"2020-07-15T16:10:44.282+08:00"},{"id":2875185,"file_name":"d1.png","project_id":165406,"asset_id":203995,"created_at":"2020-07-15T16:10:44.283+08:00","updated_at":"2020-07-15T16:10:44.283+08:00"},{"id":2875186,"file_name":"gameover.png","project_id":165406,"asset_id":203994,"created_at":"2020-07-15T16:10:44.284+08:00","updated_at":"2020-07-15T16:10:44.284+08:00"},{"id":2875187,"file_name":"bullet_1.png","project_id":165406,"asset_id":203993,"created_at":"2020-07-15T16:10:44.285+08:00","updated_at":"2020-07-15T16:10:44.285+08:00"},{"id":2875188,"file_name":"bullet_0.png","project_id":165406,"asset_id":203992,"created_at":"2020-07-15T16:10:44.286+08:00","updated_at":"2020-07-15T16:10:44.286+08:00"},{"id":2875189,"file_name":"bg.png","project_id":165406,"asset_id":203991,"created_at":"2020-07-15T16:10:44.287+08:00","updated_at":"2020-07-15T16:10:44.287+08:00"},{"id":2875190,"file_name":"9.png","project_id":165406,"asset_id":203990,"created_at":"2020-07-15T16:10:44.288+08:00","updated_at":"2020-07-15T16:10:44.288+08:00"},{"id":2875191,"file_name":"8.png","project_id":165406,"asset_id":203989,"created_at":"2020-07-15T16:10:44.288+08:00","updated_at":"2020-07-15T16:10:44.288+08:00"},{"id":2875192,"file_name":"7.png","project_id":165406,"asset_id":203988,"created_at":"2020-07-15T16:10:44.289+08:00","updated_at":"2020-07-15T16:10:44.289+08:00"},{"id":2875193,"file_name":"6.png","project_id":165406,"asset_id":203987,"created_at":"2020-07-15T16:10:44.290+08:00","updated_at":"2020-07-15T16:10:44.290+08:00"},{"id":2875194,"file_name":"5.png","project_id":165406,"asset_id":203986,"created_at":"2020-07-15T16:10:44.291+08:00","updated_at":"2020-07-15T16:10:44.291+08:00"},{"id":2875195,"file_name":"4.png","project_id":165406,"asset_id":203985,"created_at":"2020-07-15T16:10:44.292+08:00","updated_at":"2020-07-15T16:10:44.292+08:00"},{"id":2875196,"file_name":"3.png","project_id":165406,"asset_id":203984,"created_at":"2020-07-15T16:10:44.293+08:00","updated_at":"2020-07-15T16:10:44.293+08:00"},{"id":2875197,"file_name":"2.png","project_id":165406,"asset_id":203983,"created_at":"2020-07-15T16:10:44.294+08:00","updated_at":"2020-07-15T16:10:44.294+08:00"},{"id":2875198,"file_name":"1.png","project_id":165406,"asset_id":203982,"created_at":"2020-07-15T16:10:44.295+08:00","updated_at":"2020-07-15T16:10:44.295+08:00"},{"id":2875199,"file_name":"0.png","project_id":165406,"asset_id":203981,"created_at":"2020-07-15T16:10:44.295+08:00","updated_at":"2020-07-15T16:10:44.295+08:00"},{"id":2875200,"file_name":"bgm.mp3","project_id":165406,"asset_id":172346,"created_at":"2020-07-15T16:10:44.296+08:00","updated_at":"2020-07-15T16:10:44.296+08:00"},{"id":2875201,"file_name":"effect.wav","project_id":165406,"asset_id":172347,"created_at":"2020-07-15T16:10:44.298+08:00","updated_at":"2020-07-15T16:10:44.298+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦