{"id":17544,"student_id":172,"content":"var randColor;\nvar diffColor;\nvar randX;\nvar randY;\nvar level = 0;\nvar cellWidth = 0;\nvar size = 3;\n\nfunction startLevel () {\n\n if (level == 0) size = 3;\n if (level == 1) size = 4;\n if (level == 2) size = 5;\n if (level \u003e= 3) size = 6;\n if (level \u003e= 5) size = 7;\n if (level \u003e= 7) size = 8;\n\n var diff = 10;\n if (level \u003e= 5) diff = 9;\n if (level \u003e= 10) diff = 8;\n if (level \u003e= 15) diff = 7;\n if (level \u003e= 20) diff = 6;\n if (level \u003e= 25) diff = 5;\n if (level \u003e= 30) diff = 4;\n\n\n var h = Math.random()*360;\n var s = Math.random()*70 + 15;\n var l = Math.random()*70 + 15;\n\n\n randColor = 'hsl(' + h + ',' + s + '%,'+ l + '%)';\n diffColor = 'hsl(' + h + ',' + s + '%,'+ (l + diff) + '%)';\n\n randX = Math.floor(Math.random()*size);\n randY = Math.floor(Math.random()*size);\n}\n\nforever(function(){\n\n print('level:' + level);\n\n cellWidth = 440/size - 5;\n\n for(var x=0; x\u003csize; x++) {\n for(var y=0; y\u003csize; y++) {\n drawCell(x, y, cellWidth, randColor);\n }\n }\n drawCell(randX, randY, cellWidth, diffColor);\n});\n\nfunction drawCell (x, y, w, color) {\n pen.size = 0;\n pen.fillColor = color;\n pen.drawRect(x*(w+5) + 100, y*(w+5) + 25, w, w);\n}\n\nwhen('click', function () {\n var x = randX*(cellWidth+5)+100;\n var y = randY*(cellWidth+5)+25;\n if (x \u003c cursor.x \u0026\u0026 cursor.x \u003c x + cellWidth \u0026\u0026 y \u003c cursor.y \u0026\u0026 cursor.y \u003c y + cellWidth) {\n level++;\n startLevel();\n }\n});\n\nsetTimeout(function () {\n var animal = ['蝙蝠','鼴鼠','狗','狗','貓','貓','老虎','老虎','鷹'][Math.floor(level/5)];\n alert('時間到! 顏色敏銳等級為:lv' + level + '\\n您擁有了' + animal + '的眼睛');\n stop();\n}, 40000);\n\nstartLevel();","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2019-10-16T22:06:05.001+08:00","name":"眼RRRRRRRRRRR","language":"javascript","screenshot":{"url":"https://cdn5.koding.school/uploads/project/screenshot/17544/38738ea1d6d9d586401446e55a18e37d.jpg"},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":140,"hashid":"yeysv6wm","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":358866,"file_name":"0.png","project_id":17544,"asset_id":6,"created_at":"2017-12-09T17:36:53.452+08:00","updated_at":"2017-12-09T17:36:53.452+08:00"},{"id":358867,"file_name":"1.svg","project_id":17544,"asset_id":7,"created_at":"2017-12-09T17:36:53.454+08:00","updated_at":"2017-12-09T17:36:53.454+08:00"},{"id":358868,"file_name":"2.png","project_id":17544,"asset_id":8,"created_at":"2017-12-09T17:36:53.455+08:00","updated_at":"2017-12-09T17:36:53.455+08:00"},{"id":358869,"file_name":"0.wav","project_id":17544,"asset_id":9,"created_at":"2017-12-09T17:36:53.457+08:00","updated_at":"2017-12-09T17:36:53.457+08:00"},{"id":358870,"file_name":"1.wav","project_id":17544,"asset_id":10,"created_at":"2017-12-09T17:36:53.458+08:00","updated_at":"2017-12-09T17:36:53.458+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦