{"id":313048,"student_id":10,"content":"Game.set({\n width: 1200, height: 900\n})\n\nsetBackdrop(\"lightblue\");\n\nlet arr = [];\nlet clock = 0;\nlet player = createSprite('k_0.png', 'k_1.png', 'k_2.png', 'k_3.png', 'k_9.png');\nplayer.scale = 1.2;\n\nlet shells = [\n createSprite('s_0.png', 's_1.png', 's_2.png', 's_3.png'),\n createSprite('s_0.png', 's_1.png', 's_2.png', 's_3.png'),\n createSprite('s_0.png', 's_1.png', 's_2.png', 's_3.png'),\n]\n\nshells[0].y = 1000;\nshells[1].y = 1000;\n\nplayer.costumeId = 4;\n\nlet speed = 4;\n\nlet vx = 0;\nlet vy = 0;\n\nfunction gameloop () {\n clock++;\n\n shells.forEach(s =\u003e {\n s.y += speed;\n if (s.y \u003e 900) {\n s.y = -100 - Math.random() * 400;\n s.x = Math.random() * 900 + 150;\n s.costumeId = Math.floor(Math.random() * 4);\n s.hidden = false;\n }\n if (s.touched(player)) {\n player.costumeId = s.costumeId;\n s.hidden = true;\n }\n })\n\n if (clock % 80 == 0) {\n let koding = createSprite('k_0.png', 'k_1.png', 'k_2.png', 'k_3.png', 'k_4.png', 'k_5.png', 'k_6.png', 'k_7.png');\n koding.y = -100;\n koding.scale = 1.2;\n koding.x = Math.random() * 900 + 150;\n koding.direction = Math.random() * 360;\n koding.costumeId = Math.floor(Math.random() * 4);\n arr.push(koding);\n }\n\n for (let i = 0; i \u003c arr.length; i++) {\n arr[i].y += speed;\n arr[i].direction += 0.1;\n if (arr[i].y \u003e 900) arr[i].destroy();\n\n if (arr[i].costumeId == 2) {\n arr[i].direction += 0.2;\n }\n\n if (arr[i].touched(player)) {\n let dx = player.x - arr[i].x;\n let dy = player.y - arr[i].y;\n vx = dx / 10;\n vy = dy / 10;\n arr[i].x -= dx / 50;\n arr[i].y -= dy / 50;\n\n if (arr[i].costumeId == player.costumeId \u0026\u0026 player.costumeId \u003c 4) {\n arr[i].costumeId += 4;\n player.costumeId = 4;\n player.y = -100;\n }\n }\n }\n\n player.move(vx, vy + speed);\n if (key.up) {\n vy -= 1;\n }\n if (key.down) {\n vy += 1;\n }\n if (key.right) {\n vx += 1;\n player.direction += 2;\n }\n if (key.left) {\n vx -= 1;\n player.direction -= 2;\n }\n player.direction += 0.1;\n vx = vx * 0.85;\n vy = vy * 0.85;\n\n\n if (player.x \u003c 0) player.x += 1200;\n if (player.x \u003e 1200) player.x -= 1200;\n\n if (player.y \u003c 0) vy = 5;\n if (player.y \u003e 900) player.y = -100;\n}\n\nforever(gameloop);","created_at":"2021-11-11T19:24:22.606+08:00","updated_at":"2021-11-15T14:16:11.522+08:00","name":"飄飄河叩叮","language":"javascript","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/313048/93ee3d0f67bc626d5651936bdfeed8a9.jpg"},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":169,"hashid":"4y3sgemng","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":6494198,"file_name":"k_5.png","project_id":313048,"asset_id":437625,"created_at":"2021-11-15T12:15:10.664+08:00","updated_at":"2021-11-15T13:23:31.851+08:00"},{"id":6494199,"file_name":"k_6.png","project_id":313048,"asset_id":437626,"created_at":"2021-11-15T12:15:12.067+08:00","updated_at":"2021-11-15T13:23:34.886+08:00"},{"id":6494200,"file_name":"k_7.png","project_id":313048,"asset_id":437627,"created_at":"2021-11-15T12:15:12.068+08:00","updated_at":"2021-11-15T13:23:37.759+08:00"},{"id":6494195,"file_name":"s_2.png","project_id":313048,"asset_id":437622,"created_at":"2021-11-15T12:15:09.813+08:00","updated_at":"2021-11-15T13:33:55.697+08:00"},{"id":6494196,"file_name":"s_3.png","project_id":313048,"asset_id":437623,"created_at":"2021-11-15T12:15:09.814+08:00","updated_at":"2021-11-15T13:33:57.851+08:00"},{"id":6494191,"file_name":"k_2.png","project_id":313048,"asset_id":437618,"created_at":"2021-11-15T12:15:08.480+08:00","updated_at":"2021-11-15T13:23:22.723+08:00"},{"id":6494192,"file_name":"k_3.png","project_id":313048,"asset_id":437619,"created_at":"2021-11-15T12:15:08.482+08:00","updated_at":"2021-11-15T13:23:25.462+08:00"},{"id":6494193,"file_name":"s_0.png","project_id":313048,"asset_id":437620,"created_at":"2021-11-15T12:15:09.040+08:00","updated_at":"2021-11-15T13:33:50.707+08:00"},{"id":6494194,"file_name":"s_1.png","project_id":313048,"asset_id":437621,"created_at":"2021-11-15T12:15:09.042+08:00","updated_at":"2021-11-15T13:33:53.192+08:00"},{"id":6494213,"file_name":"k_9.png","project_id":313048,"asset_id":437628,"created_at":"2021-11-15T13:50:48.588+08:00","updated_at":"2021-11-15T13:55:25.239+08:00"},{"id":6494189,"file_name":"k_0.png","project_id":313048,"asset_id":437616,"created_at":"2021-11-15T12:15:07.857+08:00","updated_at":"2021-11-15T13:23:15.626+08:00"},{"id":6494190,"file_name":"k_1.png","project_id":313048,"asset_id":437617,"created_at":"2021-11-15T12:15:07.858+08:00","updated_at":"2021-11-15T13:23:18.757+08:00"},{"id":6494197,"file_name":"k_4.png","project_id":313048,"asset_id":437624,"created_at":"2021-11-15T12:15:10.663+08:00","updated_at":"2021-11-15T13:23:28.951+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦