{"id":229217,"student_id":10,"content":"Game.set({ width: 1200, height: 900 })\nlet player = createSprite(\"p_0.png\", \"p_1.png\", \"p_1.png\");\nlet enemy_a = createSprite(\"a_0.png\", \"a_1.png\", \"a_1.png\");\nlet enemy_b = createSprite(\"b_0.png\", \"b_1.png\", \"b_1.png\");\nlet enemy_c = createSprite(\"c_0.png\", \"c_1.png\", \"c_1.png\");\n\nlet power = 0;\nlet speed = 0;\nlet life = 3;\nlet score = 0;\n\nplayer.moveTo(200, 600);\nenemy_a.moveTo(1200, 600);\nenemy_b.moveTo(1500, 600);\nenemy_c.moveTo(1800, 600);\n\nfunction gameloop () {\n updateEnemy(enemy_a);\n updateEnemy(enemy_b);\n updateEnemy(enemy_c);\n print('life: ' + life, 10, 10, 'black', 20);\n print('score: ' + score, 10, 40, 'black', 20);\n}\n\nfunction updateEnemy (enemy) {\n \n if (enemy.costumeId == 2) {\n enemy.move(30, -10);\n enemy.direction -= 20;\n } else {\n enemy.x -= 7;\n }\n \n if (enemy.x \u003c 0) {\n life--;\n }\n \n if (enemy.x \u003c 0 || enemy.y \u003c 0) {\n enemy.x = 1200 + Math.random() * 1200;\n enemy.y = 600;\n enemy.costumeId = 0;\n enemy.direction = 90;\n }\n \n if (player.touched(enemy) == true) {\n if (enemy.x \u003e player.x \u0026\u0026 cursor.isDown) {\n enemy.costumeId = 2;\n score++;\n } \n }\n \n if (enemy == enemy_b) {\n if (enemy_b.x \u003e 600) enemy_b.x -= 3;\n }\n if (enemy == enemy_c) {\n if (enemy_c.x \u003e 600 \u0026\u0026 enemy_c.x \u003c 700) enemy_b.x += 3;\n }\n}\n\nforever(gameloop);","created_at":"2021-02-19T18:38:39.580+08:00","updated_at":"2021-02-19T18:55:21.305+08:00","name":"挑戰賽 v2","language":"javascript","screenshot":{"url":"https://cdn7.koding.school/uploads/project/screenshot/229217/eced977d105e2b50d48495883d7ae61a.jpg"},"parent_id":229192,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":204,"hashid":"p93skr824","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":4100175,"file_name":"d_2.png","project_id":229217,"asset_id":318502,"created_at":"2021-02-19T18:38:39.586+08:00","updated_at":"2021-02-19T18:38:39.586+08:00"},{"id":4100176,"file_name":"c_2.png","project_id":229217,"asset_id":318501,"created_at":"2021-02-19T18:38:39.587+08:00","updated_at":"2021-02-19T18:38:39.587+08:00"},{"id":4100177,"file_name":"b_2.png","project_id":229217,"asset_id":318500,"created_at":"2021-02-19T18:38:39.588+08:00","updated_at":"2021-02-19T18:38:39.588+08:00"},{"id":4100178,"file_name":"a_2.png","project_id":229217,"asset_id":318499,"created_at":"2021-02-19T18:38:39.589+08:00","updated_at":"2021-02-19T18:38:39.589+08:00"},{"id":4100179,"file_name":"d_1.png","project_id":229217,"asset_id":318498,"created_at":"2021-02-19T18:38:39.590+08:00","updated_at":"2021-02-19T18:38:39.590+08:00"},{"id":4100180,"file_name":"d_0.png","project_id":229217,"asset_id":318497,"created_at":"2021-02-19T18:38:39.591+08:00","updated_at":"2021-02-19T18:38:39.591+08:00"},{"id":4100181,"file_name":"c_1.png","project_id":229217,"asset_id":318496,"created_at":"2021-02-19T18:38:39.592+08:00","updated_at":"2021-02-19T18:38:39.592+08:00"},{"id":4100182,"file_name":"c_0.png","project_id":229217,"asset_id":318495,"created_at":"2021-02-19T18:38:39.593+08:00","updated_at":"2021-02-19T18:38:39.593+08:00"},{"id":4100183,"file_name":"b_1.png","project_id":229217,"asset_id":318494,"created_at":"2021-02-19T18:38:39.593+08:00","updated_at":"2021-02-19T18:38:39.593+08:00"},{"id":4100184,"file_name":"b_0.png","project_id":229217,"asset_id":318493,"created_at":"2021-02-19T18:38:39.594+08:00","updated_at":"2021-02-19T18:38:39.594+08:00"},{"id":4100185,"file_name":"a_1.png","project_id":229217,"asset_id":318492,"created_at":"2021-02-19T18:38:39.595+08:00","updated_at":"2021-02-19T18:38:39.595+08:00"},{"id":4100186,"file_name":"a_0.png","project_id":229217,"asset_id":318491,"created_at":"2021-02-19T18:38:39.596+08:00","updated_at":"2021-02-19T18:38:39.596+08:00"},{"id":4100187,"file_name":"p_0.png","project_id":229217,"asset_id":318490,"created_at":"2021-02-19T18:38:39.597+08:00","updated_at":"2021-02-19T18:38:39.597+08:00"},{"id":4100188,"file_name":"p_1.png","project_id":229217,"asset_id":318489,"created_at":"2021-02-19T18:38:39.598+08:00","updated_at":"2021-02-19T18:38:39.598+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦