{"id":180623,"student_id":12205,"content":"setBackdrop(\"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\nvar lights = [];\nfor(var i = 0;i\u003c15;i++) {\n var light = {\n x:cursor.x,\n y:cursor.y,\n color:\"rgb(\"+Math.floor(Math.random()*255)+\",\"+Math.floor(Math.random()*255)+\",\"+Math.floor(Math.random()*255)+\")\",\n vx:Math.random() *8 - 4,\n vy:Math.random() *8 - 4,\n r:Math.random() * 6\n };\n lights.push(light);\n};\n\nforever(function(){\n for(var i=0;i\u003clights.length;i++) {\n var light = lights[i];\n light.x +=light.vx;\n light.y +=light.vy;\n light.vy +=0.1\n light.r *=0.99\n pen.size = 0;\n pen.fillColor = light.color;\n if(light.r\u003e1) {\n pen.drawCircle(light.x,light.y,light.r);\n };\n }\n for(var i = 0;i\u003c15;i++) {\n var light = {\n x:cursor.x,\n y:cursor.y,\n color:\"rgb(\"+Math.floor(Math.random()*255)+\",\"+Math.floor(Math.random()*255)+\",\"+Math.floor(Math.random()*255)+\")\",\n vx:Math.random() *8 - 4,\n vy:Math.random() *8 - 4,\n r:Math.random() * 6\n };\n lights.push(light);\n };\n \n});\n\n\n\n\n\n","created_at":"2020-08-14T14:54:17.829+08:00","updated_at":"2020-08-19T13:46:57.233+08:00","name":"算術炸彈 煙火","language":"javascript","screenshot":{"url":"https://cdn1.koding.school/uploads/project/screenshot/180623/d39829617209732b80d6af92e9c55b60.jpg"},"parent_id":169749,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":37,"hashid":"5j3skep3","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3077622,"file_name":"bomb.png","project_id":180623,"asset_id":25163,"created_at":"2020-08-14T14:54:17.836+08:00","updated_at":"2020-08-14T14:54:17.836+08:00"},{"id":3077623,"file_name":"boom.png","project_id":180623,"asset_id":25162,"created_at":"2020-08-14T14:54:17.837+08:00","updated_at":"2020-08-14T14:54:17.837+08:00"},{"id":3077624,"file_name":"bg.jpg","project_id":180623,"asset_id":25161,"created_at":"2020-08-14T14:54:17.838+08:00","updated_at":"2020-08-14T14:54:17.838+08:00"},{"id":3077625,"file_name":"success.png","project_id":180623,"asset_id":25160,"created_at":"2020-08-14T14:54:17.839+08:00","updated_at":"2020-08-14T14:54:17.839+08:00"},{"id":3077626,"file_name":"error.png","project_id":180623,"asset_id":25159,"created_at":"2020-08-14T14:54:17.840+08:00","updated_at":"2020-08-14T14:54:17.840+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦