PHP code example of littlecubiclegames / quests
1. Go to this page and download the library: Download littlecubiclegames/quests library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
littlecubiclegames / quests example snippets
$app = new \Silex\Application();
$app->register(new \LittleCubicleGames\Quests\ServiceProvider(), [
'cubicle.quests.quests' => [], // load your quests (see quest definition below)
'cubicle.quests.slots' => [], // if you use the `StaticSlotLoader` define your quest slots here (see slot definition below)
'cubicle.quests.initializer.questbuilder' => null, // define your QuestBuilder
]);
// In your app during boot, fetch current user id and initialize the quests
$userId = null;
$app['cubicle.quests.initializer']->initialize($userId);
// In your controller advance quests as desired
$app[''cubicle.quests.advancer']->startQuest($questId, $userId);