web-boards
Web application for playing online adaptation of board games.
Goals:
- online play as well as turn based
- VASSAL modules import
- state on server - no need to send log files like in PBEM
- works on Desktop as well as Mobile
Implementation
This is work in progress. If you're interested please DO send me an email at eerzymek@gmail.com and I'll update this document.
Startup:
- load sprites.svg
- subscribe to Tables collection
On /play:tableId
- subscribe to Operations(tableId)
- find out what game this is: Tables.findOne(tableId).game
- render appropriate board: /games/{game}/images/{board.image}
- attach sprites to board
- execute Operations (observe)
- check if user is in Table(tableId).players
- if not, ask if what to join -> Meteor.call('join', tableId)
Counters
Counters are represented by SVGImageElement
.
Properties:
-
.position
- the hex (SVGUseElement
) the counter is placed on
TransformList
.transform
(SVGTransformList
) items are in the follwing order:
- translation
- scale
- translation inside stack/stackSelector
- rotation
All are optional, but if present must be in this order and on these positions.
Hexes
Hexes are SVGUseElement
-clones of a SVGPathElement.
Hexes are positioned using translation transformation.
x=0,y=0 of a hex is in it's center.
Properties:
-
.stack
Array of counters (SVGImageElement
) on the hex. May beundefined
if empty.