0.9.4 • Published 2 years ago
node-mindplays-api v0.9.4
node-mindplays-api
Mindplays.com API for NodeJS. Axios based library.
$ npm i node-mindplays-api
Basic usage
const { main } = require('../build/mindplays');
const { API_SECRET, GAME_ID } = process.env;
const sessionFabric = main(API_SECRET, GAME_ID);
go();
async function go() {
const { user_id_1, user_id_2, room_id, battle_id, hash_1, hash_2 } = { /* .... */ };
const player1 = await sessionFabric(user_id_1, room_id, battle_id, hash_1);
const player2 = await sessionFabric(user_id_2, room_id, battle_id, hash_2);
// ....
player1.won(0.1, 'More points then player 2').from(player2);
// ....
player1.lost(0.2, 'Was not lucky :(').to(player1, 'Was lucky :)');
player1.finishGame();
player2.finishGame();
}
LICENCE
MIT.