{"id":13341152,"url":"https://github.com/yiyuezhuo/Hex-Wargame-JavaScript","last_synced_at":"2025-03-11T20:32:34.504Z","repository":{"id":61484426,"uuid":"48318137","full_name":"yiyuezhuo/Hex-Wargame-JavaScript","owner":"yiyuezhuo","description":"A classic hex wargame written by JavaScript. And the scenario can be created by web-page editor","archived":false,"fork":false,"pushed_at":"2022-05-16T06:12:23.000Z","size":1089,"stargazers_count":33,"open_issues_count":1,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-24T08:29:11.909Z","etag":null,"topics":["wargame"],"latest_commit_sha":null,"homepage":"http://yiyuezhuo.github.io/Hex-Wargame-JavaScript/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yiyuezhuo.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-20T11:46:01.000Z","updated_at":"2024-07-18T19:07:32.000Z","dependencies_parsed_at":"2022-10-20T10:45:17.956Z","dependency_job_id":null,"html_url":"https://github.com/yiyuezhuo/Hex-Wargame-JavaScript","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiyuezhuo%2FHex-Wargame-JavaScript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiyuezhuo%2FHex-Wargame-JavaScript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiyuezhuo%2FHex-Wargame-JavaScript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiyuezhuo%2FHex-Wargame-JavaScript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yiyuezhuo","download_url":"https://codeload.github.com/yiyuezhuo/Hex-Wargame-JavaScript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243108672,"owners_count":20237730,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["wargame"],"created_at":"2024-07-29T19:25:13.403Z","updated_at":"2025-03-11T20:32:34.113Z","avatar_url":"https://github.com/yiyuezhuo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Classic hex based wargame project - javascript\n\n## Introduction\n\nThis is a project that want to develope a classic hex based wargame by javascript.\n\nCode is cheap ,show me the image:\n\n![Alt image](/preview/p.gif)\n\n\u003ca href=\"http://yiyuezhuo.github.io/Hex-Wargame-JavaScript/\"\u003eplay it online(GitHub page)\u003c/a\u003e\n\nor you can clone this repo and open `index.html` file to enjoy it.\n\n## Customized scenario development by editor (under development)\n\n\u003ca href=\"http://yiyuezhuo.github.io/Hex-Wargame-JavaScript/editor.html\"\u003eEditor\u003c/a\u003e\n\n## Customized scenario development by script\n\nI write a Python script to merge some `.csv` file into a `*.js` scenario file so that engine can run it.\n\nHowever I found `.csv` file can be used to edit data in visualization table software (eg. Excel) very easily. It's familiar with \nprogram newbie and a lot of wargame player who want to develop their unique game.\n\n### scenario_maker.py\n\n#### Usage\n\n\t$ python scenario_maker.py scenario_dir output.js\n\n### `.csv` scenario define document structure\n\n#### Map configuration\n\n* `block.csv`\n* `capture.csv`\n* `label.csv`\n* `terrain.csv`\n* `VP.csv`\n\nFor example,if ,in `terrain.csv` , grid of `(2,3)` (line 2,column 3) is \"open\",\nit mean that the terrain of hex(2,3) in game map will be \"open\". \n\nThe style is motivated by HPS \u0026 JT games.\n\n#### Unit setup\n\n* `unit.csv` Unit list\n* `place.csv` Set unit location\n\n#### Other csv file\n\n* `AI.csv` Guide AI how to attack\n* `CRT.csv` Combat result table \n* `player.csv` Player level information.\n* `setting.csv` Some setting.\n* `terrain_type.csv` Attributions of terrain movement cost, moveable etc.\n\n#### Other configure file\n\n* `script.js` This use a special format. Allowing you trigger some event in game without dive in detail. But some knowledge about intrinsic system will be helpful.\n* `unit.css` Set counter color .\n* `hex.css` Set hex and color .\n\nThe configurations handled by two `*.css` files was handled by `*.csv` files in old version, but those style configure being in `*.css` will be more reasonable since you can dynamic modify them without running the python script again and again to see the final effect of new art.\n\n## Advanced configuration\n\n### Counter shape\n\n`domplot.js`: The counter is plotted by pure DOM. For example, infantry symbol, a pair of cross lines in NOTA notations, is plotted by:\n\n```javascript\n     'infantry' : function(){\n      var pad,line1,line2,unit;\n      \n      unit  = this.unitBase();\n      \n      pad   = unit.els.pad;\n      // following code paint a cross representing infantry in NATO Joint Military Symbology\n      line1 = this.brush.draw_line(0,0,26,16);\n      line2 = this.brush.draw_line(0,16,26,0);\n      line1.addClass('line');\n      line2.addClass('line');\n      line1.appendTo(pad);\n      line2.appendTo(pad);\n      unit.els.line=[line1,line2];\n      return unit;\n    },\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiyuezhuo%2FHex-Wargame-JavaScript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyiyuezhuo%2FHex-Wargame-JavaScript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiyuezhuo%2FHex-Wargame-JavaScript/lists"}