puritandesigns/expotition

Classes to build a gamebook story

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

This package is auto-updated.

Last update: 2024-05-06 08:58:38 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
        )
    )
);