Skip to content

centaurreader/untitled-punchy-game

Repository files navigation

Untitled Punchy Game

Game Definitions

Games are comprised of two types of data:

  1. Component Groups
  2. Component

Basic Game Definition

{
  "name": "Poker",
  "componentGroups": [
    {
      "type": "Cards",
      "name": "Deck",
      "components": [
        {
          "name": "Ace of Spades",
          "description": null,
          "quantity": "1",
          "properties": [
            { "name": "suit", "value": "Spades" },
            { "name": "value", "value": "A" },
          ]
        },
        ...
      ]
    }
  ]
}

Component Groups

A collection of components of a given type.

Properties

name: string;
components: Array<Component|ComponentGroup>
type: Box|Cards|Dice

Component

A instance of a component.

Properties

name: string;
description?: string;
quantity: number; // note: -1 represents unlimited quantity
properties: Array<Property>;

UPG Tool

build

Builds resource JSON files from CSV files. Generates a Box type component group containing a component group for each file provided.

Usage node ./upg-tool build './filename.csv' './another-file.csv'

Example Input CSV (characters.csv)

name,description,quantity,property-attack,property-armor,property-attributes
Robot,,1,10,20,heavy|armored|solar

Note 1: prefixing a header row entry with property- adds the values to the properties array for the component. Note 2: pipe-separating the value for a field results in an array value

Result (resource.json)

{
  "name": "null",
  "componentGroups": [
    {
      "name": "characters.csv",
      "type": null,
      "components": [
        {
          "name": "Robot",
          "description": null,
          "quantity": "1",
          "properties": [
            { "name": "attack", "value": "10" },
            { "name": "armor", "value": "20" },
            { "name": "attributes", "value": [ "heavy", "armored", "solar" ] }
          ]
        }
      ]
    }
  ]
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published