{"id":193782,"student_id":2589,"content":"sound.play(\"laydate.mp3\") // 背景音樂\n//setBackdrop(\"sky.jpg\");\n\n//初始化背景\nvar sky = createSprite(\"sky.jpg\");\nsky.x = 600;\nsky.y = 2400;\n\n//初始化叩叮\nvar koding = createSprite(\"koding.png\");\nkoding.x = 600;\nkoding.y = 100;\n\n//初始化三種障礙物\nvar bird = createSprite(\"bird.png\");\nbird.x = 1500;\n\nvar eagle = createSprite(\"eagle.png\");\neagle.x = -300;\n\nvar plane = createSprite(\"plane.png\");\nplane.x = -300;\n\nvar map = createSprite(\"map.svg\");\nmap.x = 1100\nmap.y = 700\n\nvar pointer = createSprite(\"pointer.png\");\npointer.x = 1095;\npointer.y = 610;\n\nfunction movePointer(){\n if(pointer.y \u003c 800){\n //pointer.y = 600 + 200*(2400-sky.y)/3900;\n pointer.y += 0.07;\n } else {\n pointer.hidden = true;\n map.hidden = true;\n }\n}\n\n//叩叮上下左右移動\nfunction moveKoding(){\n koding.direction = 90;\n if(key.right \u0026\u0026 koding.x \u003c 1200){\n koding.x += 5;\n koding.direction = 80;\n }\n if(key.left \u0026\u0026 koding.x \u003e 0){\n koding.x -= 5;\n koding.direction = 100;\n }\n if(key.up \u0026\u0026 koding.y \u003e 0){\n koding.y -= 5;\n }\n if(key.down \u0026\u0026 koding.y \u003c 900){\n koding.y += 5;\n }\n}\n\n//背景上移,相當於叩叮往下掉\nfunction fallDown(){\n if(sky.y \u003e -1500){\n sky.y -= 1.5;\n }\n}\n\n//小鳥移動\nfunction moveBird(){\n bird.x += 2;\n if(bird.x \u003e 1200 \u0026\u0026 sky.y \u003e -1000){\n //-500~-200\n bird.x = (-500) + Math.random()*300;\n //200~700\n bird.y = 200 + Math.random()*500;\n }\n}\n\n//老鷹移動\nfunction moveEagle(){\n eagle.x -= 4;\n if(eagle.x \u003c 0 \u0026\u0026 sky.y \u003e -1000){\n //1400~1700\n eagle.x = 1400 + Math.random()*300;\n //200~700\n eagle.y = 200 + Math.random()*500;\n }\n}\n\n//飛機移動\nfunction movePlane(){\n plane.x -= 6;\n plane.y -= 2;\n if(plane.x \u003c 0 \u0026\u0026 sky.y \u003e -1000){\n //1400~1700\n plane.x = 1400 + Math.random()*300;\n //200~700\n plane.y = 300 + Math.random()*500;\n }\n}\n\n//叩叮安全降落\nfunction landing(){\n if(sky.y \u003c= -1500){\n if(koding.y \u003c 700){\n koding.y += 1;\n } else {\n win();\n }\n }\n}\n//勝利\nfunction win(){\n stop();\n var youwin = createSprite(\"youwin.png\");\n}\n//叩叮碰撞偵測\nkoding.on('touch', [bird, eagle, plane], gameover);\n//遊戲結束:失敗\nfunction gameover(){\n stop();\n sound.play(\"crash.mp3\");\n var explode = createSprite(\"explode.png\");\n explode.x = koding.x;\n explode.y = koding.y;\n var gameover = createSprite(\"gameover.png\");\n}\n\n// 不停地執行...\nforever(function(){\n movePointer();\n moveKoding();\n fallDown();\n moveBird();\n moveEagle();\n movePlane();\n landing();\n});\n","created_at":"2020-09-23T11:42:11.585+08:00","updated_at":"2021-04-20T16:03:44.364+08:00","name":"paragliding_teacher","language":"javascript","screenshot":{"url":"https://cdn4.koding.school/uploads/project/screenshot/193782/89edcce60b8890776f43b51e69f48ea4.jpg"},"parent_id":2,"plugin":"Game.set({width: 1200, height: 900})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":95,"hashid":"rdvseqgk","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":4558518,"file_name":"eagle.png","project_id":193782,"asset_id":339803,"created_at":"2021-04-20T15:35:30.365+08:00","updated_at":"2021-04-20T15:35:30.365+08:00"},{"id":4558519,"file_name":"explode.png","project_id":193782,"asset_id":339804,"created_at":"2021-04-20T15:35:30.368+08:00","updated_at":"2021-04-20T15:35:30.368+08:00"},{"id":4558520,"file_name":"plane.png","project_id":193782,"asset_id":339805,"created_at":"2021-04-20T15:35:30.372+08:00","updated_at":"2021-04-20T15:35:30.372+08:00"},{"id":4558521,"file_name":"sky.jpg","project_id":193782,"asset_id":339806,"created_at":"2021-04-20T15:35:30.395+08:00","updated_at":"2021-04-20T15:35:30.395+08:00"},{"id":4558522,"file_name":"bird.png","project_id":193782,"asset_id":339807,"created_at":"2021-04-20T15:35:30.399+08:00","updated_at":"2021-04-20T15:35:30.399+08:00"},{"id":4558523,"file_name":"koding.png","project_id":193782,"asset_id":339808,"created_at":"2021-04-20T15:35:30.403+08:00","updated_at":"2021-04-20T15:35:30.403+08:00"},{"id":4558525,"file_name":"youwin.png","project_id":193782,"asset_id":339810,"created_at":"2021-04-20T15:35:30.480+08:00","updated_at":"2021-04-20T15:35:30.480+08:00"},{"id":4558526,"file_name":"gameover.png","project_id":193782,"asset_id":339811,"created_at":"2021-04-20T15:35:30.485+08:00","updated_at":"2021-04-20T15:35:30.485+08:00"},{"id":4558527,"file_name":"pointer.svg","project_id":193782,"asset_id":339812,"created_at":"2021-04-20T15:35:30.489+08:00","updated_at":"2021-04-20T15:35:30.489+08:00"},{"id":4558528,"file_name":"map.svg","project_id":193782,"asset_id":339813,"created_at":"2021-04-20T15:35:30.493+08:00","updated_at":"2021-04-20T15:35:30.493+08:00"},{"id":4558529,"file_name":"pointer.png","project_id":193782,"asset_id":339814,"created_at":"2021-04-20T15:35:30.497+08:00","updated_at":"2021-04-20T15:35:30.497+08:00"},{"id":4558601,"file_name":"crash.mp3","project_id":193782,"asset_id":339828,"created_at":"2021-04-20T16:01:31.297+08:00","updated_at":"2021-04-20T16:01:31.297+08:00"},{"id":4558600,"file_name":"Playdate.mp3","project_id":193782,"asset_id":339829,"created_at":"2021-04-20T16:01:31.296+08:00","updated_at":"2021-04-20T16:03:04.364+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦