All Projects → yiyuezhuo → Hex-Wargame-JavaScript

yiyuezhuo / Hex-Wargame-JavaScript

Licence: MIT license
A classic hex wargame written by JavaScript. And the scenario can be created by web-page editor

Programming Languages

javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language
CSS
56736 projects
HTML
75241 projects

Labels

Projects that are alternatives of or similar to Hex-Wargame-JavaScript

Masendor
Educational and historical wargame
Stars: ✭ 65 (+195.45%)
Mutual labels:  wargame
solveme
SolveMe - Jeopardy CTF Platform
Stars: ✭ 51 (+131.82%)
Mutual labels:  wargame
tmpleak
Leak other players' temporary workspaces for ctf and wargames.
Stars: ✭ 76 (+245.45%)
Mutual labels:  wargame
chall.stypr.com
Stereotyped Challenges (2014~2023)
Stars: ✭ 59 (+168.18%)
Mutual labels:  wargame
solarisskunkwerks
No description or website provided.
Stars: ✭ 52 (+136.36%)
Mutual labels:  wargame
godot-hexgrid
a godot based framework to build hex map boardgames.
Stars: ✭ 48 (+118.18%)
Mutual labels:  wargame
Pwntools
CTF framework and exploit development library
Stars: ✭ 8,585 (+38922.73%)
Mutual labels:  wargame
Mbe
Course materials for Modern Binary Exploitation by RPISEC
Stars: ✭ 4,674 (+21145.45%)
Mutual labels:  wargame

Classic hex based wargame project - javascript

Introduction

This is a project that want to develope a classic hex based wargame by javascript.

Code is cheap ,show me the image:

Alt image

play it online(GitHub page)

or you can clone this repo and open index.html file to enjoy it.

Customized scenario development by editor (under development)

Editor

Customized scenario development by script

I write a Python script to merge some .csv file into a *.js scenario file so that engine can run it.

However I found .csv file can be used to edit data in visualization table software (eg. Excel) very easily. It's familiar with program newbie and a lot of wargame player who want to develop their unique game.

scenario_maker.py

Usage

$ python scenario_maker.py scenario_dir output.js

.csv scenario define document structure

Map configuration

  • block.csv
  • capture.csv
  • label.csv
  • terrain.csv
  • VP.csv

For example,if ,in terrain.csv , grid of (2,3) (line 2,column 3) is "open", it mean that the terrain of hex(2,3) in game map will be "open".

The style is motivated by HPS & JT games.

Unit setup

  • unit.csv Unit list
  • place.csv Set unit location

Other csv file

  • AI.csv Guide AI how to attack
  • CRT.csv Combat result table
  • player.csv Player level information.
  • setting.csv Some setting.
  • terrain_type.csv Attributions of terrain movement cost, moveable etc.

Other configure file

  • 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.
  • unit.css Set counter color .
  • hex.css Set hex and color .

The 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.

Advanced configuration

Counter shape

domplot.js: The counter is plotted by pure DOM. For example, infantry symbol, a pair of cross lines in NOTA notations, is plotted by:

     'infantry' : function(){
      var pad,line1,line2,unit;
      
      unit  = this.unitBase();
      
      pad   = unit.els.pad;
      // following code paint a cross representing infantry in NATO Joint Military Symbology
      line1 = this.brush.draw_line(0,0,26,16);
      line2 = this.brush.draw_line(0,16,26,0);
      line1.addClass('line');
      line2.addClass('line');
      line1.appendTo(pad);
      line2.appendTo(pad);
      unit.els.line=[line1,line2];
      return unit;
    },
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].