{"id":9015,"student_id":1470,"content":"setBackdrop(\"#ffffff\");\nvar koding = createSprite({\n \tx: 320,\n \ty: 240,\n scale: 1,\n\tcostumes: \"1.svg\"\n});\n\n\nvar playerArmy = {\n archers: 10,\n swordsman: 10,\n spearman: 5,\n totalUnits: this.archers + this.swordsman + this.spearman,\n maxUnits: 35,\n checkUnitAmount: function(){\n return this.spearman + this.archers + this.swordsman \u003c= maxUnits;\n }\n}\n\nvar enemyArmy = {\n archers: 10,\n swordsman: 10,\n spearman: 10,\n totalUnits: this.archers + this.swordsman + this.spearman,\n checkUnitAmount: function(){\n return this.totalUnits + this.archers + this.swordsman;\n }\n}\n\nfunction attack(att, def){\n def.archers -= Math.round(att.archers*0.5 + att.swordsman*0.75 + att.spearman*0.25);\n def.swordsman -= Math.round(att.archers*0.25 + att.swordsman*0.5 + att.spearman*0.75);\n def.spearman -= Math.round(att.archers*0.75 + att.swordsman*0.25 + att.spearman*0.5);\n}\n\nfunction drawArmy(army, x, y){\n pen.fillColor = \"black\";\n pen.drawRect(x, y, 10, army.maxUnits*10);\n \n pen.fillColor = \"red\";\n pen.drawRect(x, y, 10, army.archers*10);\n \n pen.fillColor = \"green\";\n pen.drawRect(x, y + army.archers*10, 10, army.swordsman*10);\n \n pen.fillColor = \"grey\";\n pen.drawRect(x, y+army.archers*10 + army.swordsman*10, 10, army.spearman*10);\n \n \n}\n\nforever(function(){\n if(playerArmy.totalUnits \u003e 0){\n drawArmy(playerArmy, 30, 30);\n \n }\n \n});","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2019-11-09T19:42:12.451+08:00","name":"文字的進化","language":"javascript","screenshot":{"url":"https://cdn1.koding.school/uploads/project/screenshot/9015/413ac5882088a810646c1b980417bc5b.jpg"},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":539,"hashid":"882szmd","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":198078,"file_name":"0.png","project_id":9015,"asset_id":6,"created_at":"2017-08-09T14:15:42.627+08:00","updated_at":"2017-08-09T14:15:42.627+08:00"},{"id":198079,"file_name":"1.svg","project_id":9015,"asset_id":7,"created_at":"2017-08-09T14:15:42.948+08:00","updated_at":"2017-08-09T14:15:42.948+08:00"},{"id":198080,"file_name":"2.png","project_id":9015,"asset_id":8,"created_at":"2017-08-09T14:15:42.953+08:00","updated_at":"2017-08-09T14:15:42.953+08:00"},{"id":198081,"file_name":"0.wav","project_id":9015,"asset_id":9,"created_at":"2017-08-09T14:15:42.958+08:00","updated_at":"2017-08-09T14:15:42.958+08:00"},{"id":198082,"file_name":"1.wav","project_id":9015,"asset_id":10,"created_at":"2017-08-09T14:15:42.966+08:00","updated_at":"2017-08-09T14:15:42.966+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦