Use the following code to display the games.
<iframe src='[PATH_TO_A_DEDICATED_SCRIPT]?t=[YOUR TOKEN]&game_id=2' width='900px' height='600px'></iframe>
The token is unique string. It will be sent to you by our services.
<iframe src='[PATH_TO_A_DEDICATED_SCRIPT]?t=[YOUR TOKEN]&game_id=2' width='900px' height='600px'></iframe>
For our games to be displayed, we need to know which game you want. This is done via the game_id
<iframe src='[PATH_TO_A_DEDICATED_SCRIPT]?t=[YOUR TOKEN]&game_id=2' width='900px' height='600px'></iframe>
By default most of our games are set to 20 questions. It's possible to set fewer or more questions.
<iframe src='[PATH_TO_A_DEDICATED_SCRIPT]?t=[YOUR TOKEN]&game_id=2&nb_questions=10' width='900px' height='600px'></iframe>
The game duration in seconds. By default most of our games have a duration of 180s. You can change this duration.
<iframe src='[PATH_TO_A_DEDICATED_SCRIPT]?t=[YOUR TOKEN]&game_id=2&time_to_play=60' width='900px' height='600px'></iframe>
We don't want you to give us names, ids or whatever data on your users. Privacy does matter.
On the other hand you need to send and receive data to and from the games to store the user's performance properly.
This is achieved by the "payload" var. This var can encapsulate encrypted data on your users in Base64 or whatever other system you want. It will be forwarded to you at the end of the game as it was sent at the beginning. We won't try to read or modify this var.
<iframe src='[PATH_TO_A_DEDICATED_SCRIPT]?t=[YOUR TOKEN]&game_id=2&payload=dXNlcl9pZD0xMiZ0ZXN0PTMw' width='900px' height='600px'></iframe>
An absolute path to your save script.
This script will be called with a set of POST variables at the end of the game.
<iframe src='[PATH_TO_A_DEDICATED_SCRIPT]?t=[YOUR TOKEN]&game_id=2&save_url=https://www.yoursite.com/save_play.php' width='900px' height='600px'></iframe>
The vars sent back to you in POST to the provided "save_url" will be the following :
Here is a base code to display our games through php CURL.
$game_url = '[PATH_TO_A_DEDICATED_SCRIPT]?t=[YOUR TOKEN]&game_id=2';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => ($game_url),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET'
));
$headers = array();
$headers[] = 'Content-Type:application/json';
$headers[] = 'Access-Control-Request-Method: GET';
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo 'cURL Error #:' . $err;
die();
}
// The display, in a position:relative dom element.
echo '<div style="position:relative;">';
echo $response;
echo '</div>';