{"id":114769,"student_id":10,"content":"setBackdrop('black');\n\nvar head = createSprite('body.png');\nvar bodies = [];\nvar food = createSprite('body.png');\n\nfood.x = Math.random()*640;\nfood.y = Math.random()*480;\nvar level = 0;\n\nvar clock = 0;\n\nforever(function() {\n\n if (key.right) {\n head.direction += 10;\n }\n if (key.left) {\n head.direction -= 10;\n }\n if (head.touched(food)) {\n food.x = Math.random()*640;\n food.y = Math.random()*480;\n\n for (var i = 0; i \u003c 10; i++) {\n var b = createSprite('body.png');\n b.moveTo(head);\n bodies.push(b);\n }\n\n level++;\n }\n\n\n var b = bodies.pop();\n if (b) {\n b.moveTo(head);\n bodies.unshift(b);\n }\n\n head.stepForward(4);\n \n for (var i=0; i\u003cbodies.length; i++) {\n if (bodies[i].touched(head)) {\n stop();\n }\n }\n\n if (head.x \u003c 0) head.x += 640;\n if (head.x \u003e 640) head.x -= 640;\n if (head.y \u003c 0) head.y += 480;\n if (head.y \u003e 480) head.y -= 480;\n\n});","created_at":"2019-12-16T16:31:27.009+08:00","updated_at":"2019-12-16T16:58:24.555+08:00","name":"貪吃蛇v2","language":"javascript","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/114769/8e3937b77ae71255d5f08c0fabe4e2ce.jpg"},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":346,"hashid":"d5msz2q9","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":1961856,"file_name":"body.png","project_id":114769,"asset_id":172250,"created_at":"2019-12-16T16:41:42.409+08:00","updated_at":"2019-12-16T16:41:42.409+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦