puritandesigns/expotition

Classes to build a gamebook story

Installs: 9

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/puritandesigns/expotition

v0.2 2019-03-03 15:47 UTC

This package is auto-updated.

Last update: 2025-10-06 12:16:20 UTC


README

PHP classes to build a Gamebook story.

View a slideshow from a TrianglePHP Meetup

Getting Started

  1. Run composer require puritandesigns/expotition
  2. Require composer's autoload and create an adventure: $adventure = new Adventure();
  3. Create settings that have actions:
$town = new Setting(
    $adventure,
    'Town',
    'You find yourself in a small town bustling with activity.',
);

$tavern = new Setting(
    $adventure,
    'Tavern',
    'You are in a single-room tavern.',
    new Actions(
        new SimpleResponseAction(
            'Talk to Bartender',
            $adventure,
            'The Bartender grunts, "Welcome to my pub."'
        ),
        new LeaveAction(
            'Head outside',
            $adventure,
            $town
        )
    )
);