{"id":25325,"student_id":3341,"content":"var heroName = \"beach\";\nvar heroHP = 100;\nvar heroMP = 100;\nfunction drink() {\n console.log(\"準備喝下藥水...\");\n}\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 }\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\u0026 potion2===\"藍藥水\"){\n newPotion = \"紫藥水\";\n } else if(potion1===\"紅藥水\" \u0026\u0026 potion2===\"紅藥水\"){\n newPotion = \"大紅藥水\";\n } else if(potion1===\"藍藥水\" \u0026\u0026 potion2===\"紅藥水\"){\n newPotion = \"紫藥水\";\n } else if(potion1===\"藍藥水\" \u0026\u0026 potion2===\"藍藥水\"){\n newPotion = \"大藍藥水\";\n }\n console.log(\"成功做出了: \"+newPotion);\n}\nfunction mixPotions ( potion1, potion2 ) {\n var newPotion = \"水\";\n if(potion1===\"紅藥水\" \u0026\u0026 potion2===\"藍藥水\"){\n newPotion===\"紫藥水\";\n } else if(potion1===\"紅藥水\" \u0026\u0026 potion2===\"紅藥水\"){\n newPotion===\"大紅藥水\";\n } else if(potion1===\"藍藥水\" \u0026\u0026 potion2===\"紅藥水\"){\n newPotion===\"紫藥水\";\n } else if(potion1===\"藍藥水\" \u0026\u0026 potion2===\"藍藥水\"){\n newPotion===\"大藍藥水\";\n }\n console.log(\"成功做出了: \"+newPotion);\n return newPotion;\n}\nvar newPotion = mixPotions(\"紅藥水\", \"藍藥水\");","created_at":"2018-03-22T14:55:44.478+08:00","updated_at":"2019-10-28T01:29:02.780+08:00","name":"JS Game L4","language":"javascript","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/25325/cfdfb977a21760908b043d61f3ca3b87.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":80,"hashid":"d5msyj2m","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":472162,"file_name":"hero.png","project_id":25325,"asset_id":15669,"created_at":"2018-03-22T14:55:44.515+08:00","updated_at":"2018-03-22T14:55:44.515+08:00"},{"id":472163,"file_name":"console-box.png","project_id":25325,"asset_id":15670,"created_at":"2018-03-22T14:55:44.520+08:00","updated_at":"2018-03-22T14:55:44.520+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦