{"id":49038,"student_id":3232,"content":"var heroName = \"Julie\";\nvar heroHP = 1;\nvar heroMP = 1;\nfunction drink(potion){\n console.log(\"準備喝下藥水...\")\n if (potion===\"紅藥水\"){\n heroHP=heroHP+40\n }else if(potion===\"藍藥水\"){\n heroMP=heroMP+40\n }else if(potion===\"紫藥水\"){\n heroHP=heroHP+40\n heroMP=heroMP+40\n }else if(potion===\"大紅藥水\"){\n heroHP=heroHP+80\n }else if(potion===\"大藍藥水\"){\n heroMP=heroMP+80\n }\n if (heroHP\u003e100){\n heroHP=100\n }\n if (heroMP\u003e100){\n heroMP=100\n }\n}\nfunction mixpotions(potion1,potion2){\n var newpotion=\"水\"\n if (potion1===\"紅藥水\"\u0026\u0026potion2===\"藍藥水\"){\n newpotion=\"紫藥水\"\n }else if(potion1===\"紅藥水\"\u0026\u0026potion2===\"紅藥水\"){\n newpotion=\"大紅藥水\"\n }else if(potion1===\"藍藥水\"\u0026\u0026potion2===\"紅藥水\"){\n newpotion=\"紫藥水\"\n }else if(potion1===\"藍藥水\"\u0026\u0026potion2===\"藍藥水\"){\n newpotion=\"大藍藥水\"\n }\n console.log(\"成功做出了:\"+newpotion)\n}\ndrink(potion=\"紅藥水\")\nmixpotions(potion1=\"紅藥水\",potion2=\"藍藥水\")","created_at":"2018-11-17T11:45:32.274+08:00","updated_at":"2019-07-04T19:15:34.385+08:00","name":"JS Game L4 副本","language":"javascript","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/49038/46a92660c5796274e23930beb37e093e.jpg"},"parent_id":4708,"plugin":"setBackdrop(\"#5ea642\");\nvar hero = createSprite(\"hero.png\");\nvar box = createSprite(\"console-box.png\");\nhero.scale = 0.2;\nbox.y=380;\n\nvar heroName = heroName || \"請輸入主角名稱\";\nvar heroHP = heroHP || 0;\nvar heroMP = heroMP || 0;\nvar heroStatus = heroStatus || \"\";\n\nvar originConsoleLog = console.log;\nvar logs = [];\nconsole.log = function(log){\n\tlogs.push(log);\n if(logs.length\u003e5){logs.shift();}\n originConsoleLog(log);\n};\n\nforever(function(){\n\tprint(heroName, 20, 20, \"white\", 18);\n\tprint(\"生命: \" + heroHP, 20, 48);\n\tprint(\"魔力: \" + heroMP, 20, 68);\n\tprint(\"狀態: \" + heroStatus, 20, 88);\n for(var i=logs.length-1;i\u003e=0;i--){\n\t print(logs[i], 64, 330+20*i, \"white\",14); \n }\n});","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":130,"hashid":"qmds9gvw","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":878918,"file_name":"hero.png","project_id":49038,"asset_id":15669,"created_at":"2018-11-17T11:45:32.283+08:00","updated_at":"2018-11-17T11:45:32.283+08:00"},{"id":878919,"file_name":"console-box.png","project_id":49038,"asset_id":15670,"created_at":"2018-11-17T11:45:32.286+08:00","updated_at":"2018-11-17T11:45:32.286+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦