This is a documentation for Board Game Arena: play board games online !

BGA Code Sharing: Difference between revisions

From Board Game Arena
Jump to navigation Jump to search
No edit summary
(add Tic Tac Match game)
Line 218: Line 218:
| Stardust Spikes, Jason Turner-Maier, Ilya Sherman
| Stardust Spikes, Jason Turner-Maier, Ilya Sherman
| Tic Tac Match
| Leo Caseiro
| Uptown
| Uptown

Revision as of 13:42, 8 August 2022

Game File Reference

Useful Components


  • Deck: a PHP component to manage cards (deck, hands, picking cards, moving cards, shuffle deck, ...).
  • Draggable: a JS component to manage drag'n'drop actions.
  • Counter: a JS component to manage a counter that can increase/decrease (ex: player's score).
  • ExpandableSection: a JS component to manage a rectangular block of HTML than can be displayed/hidden.
  • Scrollmap: a JS component to manage a scrollable game area (useful when the game area can be infinite. Examples: Saboteur or Takenoko games).
  • Stock: a JS component to manage and display a set of game elements displayed at a position.
  • Zone: a JS component to manage a zone of the board where several game elements can come and leave, but should be well displayed together (See for example: token's places at Can't Stop).

Undocumented component (if somebody knows please help with docs)

  • Wrapper: a JS component to wrap a <div> element around its child, even if these elements are absolute positioned.


Game Development Process

Guides for Common Topics

Miscellaneous Resources

This page is for listing of externally hosted bga projects, tools and resources, as well as internal project intended for sharing

Community shared components, pens, etc

Dice models and animation
Die: 4 sided code pen
Die: 6 sided Code can be found in project
Die: 12 sided (dodecahedron) Code pen
Die: 20 sided Code pen
Moving object using CSS animation (mostly)
Phantom object move on oversurface This technique creates clone of the object it moves it on another surface. It works well when parents that css transform applies such as scale and rotate
Move object directly using positioning This technique is modification of BGA framework method to allow mobile object not to have absolute position before or after the move (and uses css animation not dojo). Methods slideToObjectRelative, attachToNewObjectNoDestroy
Responsive layout for game boards
Flex Layout Example on how to create flexible layout just by using css
Hex grid tapestry,Tumbleweed,gaia project,Gold West
Shortest path on hex grid memoir 44 Disjktra
Largest area on hex grid tapestry, ...
Largest area on square grid king domino, ...
Tetris pieces patchwork, ... Matrix manupations to rotate, flip and fit tetris pieces
Line of sights on hex grid memoir 44 Find intersecting hexes on a line between two cells

Projects hosted not in studio

See the table a link and nickname of the developer on bga (same as used for dev forum), and short description. See Tools_and_tips_of_BGA_Studio#Version_Control for some suggestions on how and where to publish your code externally. Also see the boardgamearena tag on github.

Important notice about artwork on BGA Open Source projects: original hi-resolution images from publishers must not be published on the repositories. In addition, it is better to specify that the images derivated from publishers artwork are copyrighted and cannot be licensed under a free license like Creative Commons.

Shared Code (not a game) Victoria_La Examples of various game components and PHP stubs of framework code to make IDE happy
BoardGameArena Workbench (not a game) Daniel Holmes (dhau)
99 (Trick-taking Card Game) QuasarDukeDev
Assyria daikinee
Aura Micah Stairs (micahstairs)
Bandido ophelopede & Harkle
The Battle for Hill 218 Daniel Holmes (dhau)
Bonbons Morgalad
Coinche Draasill
Coup: City State quietmint
Dungeon Roll MGoulet
Egyptian Ratscrew 0BuRner
Eruption Andy_K
A Fistful Of Gold Brainchild
Florenza: The Card Game tarini
Hearts (Tutorial) Victoria_La
Homesteaders TheBoot
Incan Gold Morgalad
Innovation Micah Stairs (micahstairs)
Mapmaker: The Gerrymandering Game gkz
Marco Polo rcitaliano
Nile Andy_K
Noir: Killer vs Inspector ch huang
Penny Press A-dam
P.I., (mirror) Fabian Neumann (fa81)
Santorini Morgalad, quietmint, Tisaac
Tablut Lucas-C & ntaffore
Takara Island Morgalad
Taluva Morgalad & quietmint
Teotihuacan: City of Gods Trompetenhut
Texas 42 (domino game, still under development) Stardust Spikes, Jason Turner-Maier, Ilya Sherman
Tic Tac Match Leo Caseiro
Uptown SpottedShroom
Via Magica CuriousTerran
Just Desserts mizutismask
The King's Guild A-dam
Get the MacGuffin mizutismask
President quaresma95
Hardback quietmint
Dice Summoners eoincos

Projects on studio

Any developer can add themselves to a project as read-only from!projects page (almost any project). The list below are no-games which do not have bgg id and not showing up there.

Shared Code Victoria_La
Original BGA template Victoria_La

Other useful resources

Moved to Tools_and_tips_of_BGA_Studio