{"id":9277,"student_id":10,"content":"setBackdrop(\"bg.jpg\");\nvar right = createSprite(\"right.png\");\nright.moveTo(280, 300);\nvar wrong = createSprite(\"error.png\");\nwrong.moveTo(360, 300);\n\nvar score = 0;\nvar progressBar = 0;\n\ncreateQ();\n\nforever(function () {\n progressBar += 2;\n pen.fillColor = \"#b2dfdb\";\n pen.drawRect(180, 30, progressBar, 10);\n if (progressBar \u003e 280) {\n gameOver();\n }\n print(\"Score: \" + score, 280, 360, \"#FF5151\", 25);\n print(num1 + \" + \" + num2 + \" =\", 240, 120, \"#8d6e63\", 40);\n print(answer, 300, 180, \"#8d6e63\", 40);\n});\n\nright.when(\"click\", function () {\n if (num1 + num2 == answer) {\n score += 1;\n createQ(); \n } else {\n gameOver();\n } \n});\n\nwrong.when(\"click\", function () {\n if (num1 + num2 != answer) {\n score += 1;\n createQ();\n } else {\n gameOver();\n }\n});\n\nfunction createQ () {\n num1 = Math.ceil(Math.random()*10);\n num2 = Math.ceil(Math.random()*10);\n var possibleAns = [\n Math.floor(Math.random()*20),\n Math.floor(Math.random()*20),\n num1+num2\n ];\n var ran = Math.floor(Math.random()*3);\n answer = possibleAns[ran];\n progressBar = 0;\n}\n\nfunction gameOver () {\n print(\"Game Over\", 190, 120, \"#8d6e63\", 50);\n print(\"Score: \" + score, 280, 360, \"#FF5151\", 25);\n stop();\n}","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2019-11-11T06:25:45.876+08:00","name":"芝妘姊姊a專案","language":"javascript","screenshot":{"url":"https://cdn6.koding.school/uploads/project/screenshot/9277/59f7caa06ddd0c214b4ce9156fea2db7.jpg"},"parent_id":9063,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":529,"hashid":"wdks4vvk","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":204905,"file_name":"error.png","project_id":9277,"asset_id":24742,"created_at":"2017-08-13T22:21:39.842+08:00","updated_at":"2017-08-13T22:21:39.842+08:00"},{"id":204906,"file_name":"right.png","project_id":9277,"asset_id":24743,"created_at":"2017-08-13T22:21:39.845+08:00","updated_at":"2017-08-13T22:21:39.845+08:00"},{"id":204907,"file_name":"bg.jpg","project_id":9277,"asset_id":24744,"created_at":"2017-08-13T22:21:40.701+08:00","updated_at":"2017-08-13T22:21:40.701+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦