{"id":51201,"student_id":10,"content":"","created_at":"2018-12-04T15:35:31.994+08:00","updated_at":"2019-10-29T09:41:10.266+08:00","name":"Pac-Man","language":"javascript","screenshot":{"url":"https://cdn4.koding.school/uploads/project/screenshot/51201/89edcce60b8890776f43b51e69f48ea4.jpg"},"parent_id":2,"plugin":"setBackdrop('black');\n\nlet width = 14;\nlet offsetX = 124 - 7;\nlet offsetY = 44 - 7;\n\nlet map = [\n 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx',\n 'x............xx............x',\n 'x.xxxx.xxxxx.xx.xxxxx.xxxx.x',\n 'x.xxxx.xxxxx.xx.xxxxx.xxxx.x',\n 'x.xxxx.xxxxx.xx.xxxxx.xxxx.x',\n 'x..........................x',\n 'x.xxxx.xx.xxxxxxxx.xx.xxxx.x',\n 'x.xxxx.xx.xxxxxxxx.xx.xxxx.x',\n 'x......xx....xx....xx......x',\n 'xxxxxx.xxxxx.xx.xxxxx.xxxxxx',\n 'xxxxxx.xxxxx.xx.xxxxx.xxxxxx',\n 'xxxxxx.xx xx.xxxxxx',\n 'xxxxxx.xx xxx xxx xx.xxxxxx',\n 'xxxxxx.xx x x xx.xxxxxx',\n ' x x ',\n 'xxxxxx.xx x x xx.xxxxxx',\n 'xxxxxx.xx xxxxxxxx xx.xxxxxx',\n 'xxxxxx.xx xx.xxxxxx',\n 'xxxxxx.xx xxxxxxxx xx.xxxxxx',\n 'xxxxxx.xx xxxxxxxx xx.xxxxxx',\n 'x............xx............x',\n 'x.xxxx.xxxxx.xx.xxxxx.xxxx.x',\n 'x.xxxx.xxxxx.xx.xxxxx.xxxx.x',\n 'x...xx.......xx.......xx...x',\n 'xxx.xx.xx.xxxxxxxx.xx.xx.xxx',\n 'xxx.xx.xx.xxxxxxxx.xx.xx.xxx',\n 'x......xx....xx....xx......x',\n 'x.xxxxxxxxxx.xx.xxxxxxxxxx.x',\n 'x.xxxxxxxxxx.xx.xxxxxxxxxx.x',\n 'x..........................x',\n 'xxxxxxxxxxxxxxxxxxxxxxxxxxx┛',\n]\n\nvar grid = (function (map) {\n let grid = {};\n for (let x=-1; x\u003c29; x++) {\n grid[x] = {};\n }\n for (let x=0; x\u003c28; x++) {\n for (let y=0; y\u003c31; y++) {\n grid[x][y] = map[y][x];\n }\n }\n return grid;\n})(map);\n\nfor (let x=0; x\u003c28; x++) {\n for (let y=0; y\u003c31; y++) {\n var b = createSprite(['block_1.png', 'block_2.png']);\n b.moveTo(offsetX + x*width, offsetY + y*width);\n if (grid[x][y] != 'x') {\n b.hidden = true;\n continue;\n }\n if (grid[x+1][y] == 'x' \u0026\u0026 grid[x-1][y] == 'x' \u0026\u0026 grid[x][y+1] =='x' \u0026\u0026 grid[x][y-1] =='x') {\n b.hidden = true;\n continue;\n }\n// else if (grid[y-1] \u0026\u0026 grid[y-1][x] == 'x' \u0026\u0026 grid[y+1] \u0026\u0026 grid[y+1][x] == 'x') {\n// b.costumeId = 0;\n// b.direction = 0;\n// continue;\n// }\n// else if (grid[y] \u0026\u0026 grid[y][x + 1] == 'x' \u0026\u0026 grid[y] \u0026\u0026 grid[y][x - 1] == 'x') {\n// b.costumeId = 0;\n// continue;\n// }\n// else if (grid[y] \u0026\u0026 grid[y][x - 1] == 'x' \u0026\u0026 grid[y] \u0026\u0026 grid[y - 1][x] == 'x') {\n// b.direction = 90;\n// b.costumeId = 1;\n// continue;\n// }\n// else if (grid[y - 1] \u0026\u0026 grid[y - 1][x] == 'x' \u0026\u0026 grid[y] \u0026\u0026 grid[y][x + 1] == 'x') {\n// b.direction = 180;\n// b.costumeId = 1;\n// continue;\n// }\n// else if (grid[y + 1] \u0026\u0026 grid[y + 1][x] == 'x' \u0026\u0026 grid[y] \u0026\u0026 grid[y][x + 1] == 'x') {\n// b.direction = 270;\n// b.costumeId = 1;\n// continue;\n// }\n// else if (grid[y] \u0026\u0026 grid[y][x - 1] == 'x' \u0026\u0026 grid[y + 1] \u0026\u0026 grid[y + 1][x] == 'x') {\n// b.direction = 0;\n// b.costumeId = 1;\n// continue;\n// }\n \n \n \n }\n}","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":310,"hashid":"qmds9m3w","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":914157,"file_name":"block_1.png","project_id":51201,"asset_id":101704,"created_at":"2018-12-04T15:35:53.438+08:00","updated_at":"2018-12-04T15:35:53.438+08:00"},{"id":914158,"file_name":"block_2.png","project_id":51201,"asset_id":101705,"created_at":"2018-12-04T15:35:56.902+08:00","updated_at":"2018-12-04T15:35:56.902+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦