{"id":9301,"student_id":10,"content":"function start() {}\n\nsetBackdrop(\"bg.jpg\");\nvar right = createSprite(\"success.png\");\nright.moveTo(280, 300);\nvar wrong = createSprite(\"error.png\");\nwrong.moveTo(360, 300);\nvar bomb = createSprite([\"bomb.png\",\"boom.png\"]);\nbomb.moveTo( 180, 60);\n\nvar score = 0;\nvar progressBar = 300;\n\ncreateQ();\n\nforever(function(){\n print(\"Score: \" + score,280,360,\"#FF5151\",25);\n if(progressBar \u003e 0){\n print(num1 + \" + \" + num2 + \" = \", 240, 120, \"#8d6e63\", 40);\n print(answer,300,180,\"#8d6e63\",40);\n }else{\n gameOver();\n }\n progressBar-=2;\n pen.fillColor = \"#FF5151\";\n pen.size = 0;\n pen.drawRect(200,60,progressBar, 10);\n});\n\nright.when(\"click\", function () {\n if(num1+num2 == answer){\n score += 1;\n createQ(); \n }else{\n isCorrect = false;\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 if(Math.random() \u003c 0.3) {\n answer = num1 + num2;\n }else {\n answer = Math.floor(Math.random()*20);\n }\n progressBar = 300;\n}\n\nfunction gameOver(){\n print(\"Game Over\",190,120,\"#8d6e63\",50);\n print(\"Score: \" + score,280,360,\"#FF5151\",25);\n bomb.costumeId = 1;\n stop();\n}\n\n\n","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2019-11-11T01:44:57.416+08:00","name":"Math","language":"javascript","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/9301/6b5649b644e5eab769a9c072fd1d057c.jpg"},"parent_id":9294,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[2333],"is_featured":false,"views":454,"hashid":"zpesjdj9","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":205132,"file_name":"error.png","project_id":9301,"asset_id":24746,"created_at":"2017-08-15T18:43:20.865+08:00","updated_at":"2017-08-15T18:43:20.865+08:00"},{"id":205133,"file_name":"success.png","project_id":9301,"asset_id":24747,"created_at":"2017-08-15T18:43:20.867+08:00","updated_at":"2017-08-15T18:43:20.867+08:00"},{"id":205134,"file_name":"bg.jpg","project_id":9301,"asset_id":24744,"created_at":"2017-08-15T18:43:20.869+08:00","updated_at":"2017-08-15T18:43:20.869+08:00"},{"id":205144,"file_name":"boom.png","project_id":9301,"asset_id":24799,"created_at":"2017-08-15T18:56:05.876+08:00","updated_at":"2017-08-15T18:56:05.876+08:00"},{"id":205145,"file_name":"bomb.png","project_id":9301,"asset_id":24800,"created_at":"2017-08-15T18:56:05.878+08:00","updated_at":"2017-08-15T18:56:05.878+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦