Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read / Write data from JSON #30

Open
1 of 3 tasks
probably-not-porter opened this issue Feb 15, 2023 · 0 comments
Open
1 of 3 tasks

Read / Write data from JSON #30

probably-not-porter opened this issue Feb 15, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@probably-not-porter
Copy link
Member

probably-not-porter commented Feb 15, 2023

Create an import/export system for game data.
MAPI has some sample JSON maps that can be used as testing input.

  • Complete Entities class
  • Implement import from file
  • Implement export from file

Should take a json file that follows this format:

{
    "map": {
        "1": {      // y coordinate
            "2": {      // x coordinate (contains room)
                "x": 2,
                "y": 1,
                "description": "room description (Minus items)",
                "items": [ // references for items in room
                    "[itemID]", "[itemID]", "[itemID]" 
                ],
                "entities": [ // references for entities in room
                    "[entityID]","[entityID]","[entityID]" 
                ],
                "doors": { // openings into adjacent rooms
                    "n": false, "s": true, "e": false, "w": false
                }
            },
    },
    "items": {
        "1":{
            "name": "Item Name",
            "id": "Item ID",
            "appearance": "Item appearance",
            "visibility": "Item visibility",
            "description": "Item Description",
            "sprite": "Sprite Reference",
            "volume": 1.1,
            "weight": 7.5,
            "visibility": 1.0,
            "max_quantity": 4
        }
    },
    "entities": {

    }
}
@probably-not-porter probably-not-porter added the enhancement New feature or request label Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant