{"id":25311,"student_id":3499,"content":"var heroName = \"Mark\";\nvar heroHP = 0;\nvar heroMP = 0;\nvar potion=\"紫藥水\"\nvar potion1=\"紅藥水\"\nvar potion2=\"藍藥水\"\n\n var newPotion=\"水\";\n function 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}\ndrink(potion);\n\n\nfunction mixPotions(potion1,potion2)\n\n{ \n \n if (potion1===\"紅藥水\"\u0026\u0026potion2===\"藍藥水\") {newPotion=\"紫藥水\";}\n else if (potion1===\"紅藥水\"\u0026\u0026potion2===\"紅藥水\") {newPotion=\"大紅藥水\";}\n else if (potion1===\"藍藥水\"\u0026\u0026potion2===\"藍藥水\") {newPotion=\"大藍藥水\";}\n else if (potion1===\"藍藥水\"\u0026\u0026potion2===\"紅藥水\") {newPotion=\"紫藥水\";}\n console.log(\"成功做出了=\"+newPotion);\n \n\n}\nmixPotions(potion1, potion2);\ndrink(\"紫藥水\");\n\n\n","created_at":"2018-03-22T10:57:11.707+08:00","updated_at":"2018-12-12T11:33:50.374+08:00","name":"JS Game L4","language":"javascript","screenshot":{"url":"https://cdn4.koding.school/uploads/project/screenshot/25311/f10fe4b9ca16902eb16abe9d7c814c46.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":87,"hashid":"meys6jnq","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":472087,"file_name":"hero.png","project_id":25311,"asset_id":15669,"created_at":"2018-03-22T10:57:11.744+08:00","updated_at":"2018-03-22T10:57:11.744+08:00"},{"id":472088,"file_name":"console-box.png","project_id":25311,"asset_id":15670,"created_at":"2018-03-22T10:57:11.748+08:00","updated_at":"2018-03-22T10:57:11.748+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
繁中
简中
English
日本語
1:1:1
1:1
全寬
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦