amiantos / gamebookengine

Gamebook Engine is an open source iOS app for creating and playing gamebooks, a type of interactive fiction where the player gets to make decisions that influence the story.
Mozilla Public License 2.0
83 stars 5 forks source link

Conditional Text / Page Data Model Changes / Image Support (?) #36

Open amiantos opened 1 year ago

amiantos commented 1 year ago
{
    "page": {
        "uuid": "...",
        "type": "ending",
        "consequences": [],
        "decisions": [],
        "content": [
            {
                "uuid": "...",
                "type": "markdown",
                "content": "Start of page content...",
                "match_style": "match_all",
                "rules": []
            },
            {
                "uuid": "...",
                "type": "markdown",
                "content": "Some special content",
                "match_style": "match_all",
                "rules": [
                    {
                        "uuid": "...",
                        "attribute_uuid": "...",
                        "value": 1,
                        "type": "equal"
                    }
                ]
            },
            {
                "uuid": "...",
                "type": "markdown",
                "content": "...and the rest of the content",
                "rules": []
            }
        ]
    }
}

We can imagine other types of blocks... {"type": "image", "url": "https://..."} perhaps? (But obviously embedding images from the web isn't something that would actually work. Gamebooks with images would have to be distributed in a zip/container similar to Apple Work suite files... anyway...)