PHP code example of javleds / laravel-game-engine

1. Go to this page and download the library: Download javleds/laravel-game-engine 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/ */

    

javleds / laravel-game-engine example snippets


use App\Games\MyGame\MyGameDefinition;
use TurnEngine\Laravel\GameRegistry;

$this->app->singleton(GameRegistry::class, function (): GameRegistry {
    return new GameRegistry([
        $this->app->make(MyGameDefinition::class),
    ]);
});

return [
    'default_game' => 'my-game',
];
bash
php artisan vendor:publish --tag=turn-engine-config