puritandesigns / expotition

A simple OOP way to make a gamebook

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expotition

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
        )
    )
);

About

A simple OOP way to make a gamebook

License:GNU General Public License v3.0


Languages

Language:PHP 100.0%