This is a simple demo for integrating with CelerX JS SDK with a solo HTML5 game Go!Celer!
https://nodejs.org/en/download/
https://github.com/CelerX/js-sdk-solo-game-demo
Install game dependencies
npm install
Install a random number seed library
npm install seed-random
npm start
https://github.com/CelerX/js-sdk
Copy minified SDK code and create a file celerx.js
in lib
folder
update: CelerX-JS SDK is now available on NPM, you can install it via
npm install celerxjs
A the top of index.js
import celerx from "./celerx"; // import SDK this way if you copied & pasted the SDK code
import celerx from "celerx"; // import SDK this way if you installed it via 'npm install'
import seed from "seed-random";
Inside the p5 sketch
celerx.onStart(() => {
resetGame();
});
celerx.ready();
Inside function resetGame
const match = celerx.getMatch();
seed(match && match.sharedRandomSeed, { global: true });
Inside function endGame
celerx.submitScore(STATE.score);
Step 8: Build and zip the game
npm run build
Important! After building the game, a new folder "dist" will appear in your project directory. Zip this folder and upload it to CelerX Developer Portal.
Step 9: Download CelerX App from App Store/Google Play
Step 10: Upload the game to CelerX Game Developer Portal
- Create a new account
- Create a new game
- Fill out game information. Make sure you select "Solo Game" for game type
- Click on "App Assets" at the top
- Drag and drop your game zip file to upload
- Click on "Go test it on CelerX"
- Open CelerX and scan the QR Code