{"id":117985,"student_id":10,"content":"var road = createSprite('bg.png');\nvar p1 = createSprite(['1.png', '2.png']);\nvar p2 = createSprite(['1.png', '2.png']);\n\nvar s1 = 0;\nvar s2 = 0;\nroad.x += 500;\np1.y -= 70;\np2.y += 10;\n\non('keydown', 'z', p1_leftStep);\non('keydown', 'x', p1_rightStep);\non('keydown', 'm', p2_leftStep);\non('keydown', 'n', p2_rightStep);\n\nforever(loop);\n\nfunction p1_rightStep () {\n if (p1.costumeId == 0) {\n p1.costumeId = 1;\n s1 += 20;\n }\n}\n\nfunction p1_leftStep () {\n if (p1.costumeId == 1) {\n p1.costumeId = 0;\n s1 += 20;\n }\n}\n\nfunction p2_rightStep () {\n if (p2.costumeId == 0) {\n p2.costumeId = 1;\n s2 += 20;\n }\n}\n\nfunction p2_leftStep () {\n if (p2.costumeId == 1) {\n p2.costumeId = 0;\n s2 += 20;\n }\n}\n\nfunction loop () {\n let max = Math.max(s1, s2);\n road.x = 820 - max;\n p1.x = 320 - (max - s1);\n p2.x = 320 - (max - s2);\n if (road.x \u003c -180) {\n stop();\n }\n}","created_at":"2020-01-02T17:31:02.901+08:00","updated_at":"2020-10-13T10:53:49.409+08:00","name":"雙人百米衝刺大賽","language":"javascript","screenshot":{"url":"https://cdn3.koding.school/uploads/project/screenshot/117985/2dcb62a99a47d85fd70f4d3564a86829.jpg"},"parent_id":117984,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":271,"hashid":"ej9sgmrw","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2023501,"file_name":"bg.png","project_id":117985,"asset_id":176439,"created_at":"2020-01-02T17:31:53.992+08:00","updated_at":"2020-01-02T17:31:53.992+08:00"},{"id":2023499,"file_name":"2.png","project_id":117985,"asset_id":176436,"created_at":"2020-01-02T17:31:02.913+08:00","updated_at":"2020-01-02T17:31:02.913+08:00"},{"id":2023500,"file_name":"1.png","project_id":117985,"asset_id":176435,"created_at":"2020-01-02T17:31:02.914+08:00","updated_at":"2020-01-02T17:31:02.914+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦