BoltBoxGame ‐ Game devolpement library - BoltBoxEngine/BoltBoxWiki GitHub Wiki

Game devolpement library

Quickstart

All BoltBox games are run as an independant nodejs instance from the main BoltBox server. This means that the any frontends created can be done through whatever tools and frameworks the devolper chooses allowing experienced and new devolpers alike the opertunity to create any environment they see fit. Regardless of framework a process of receving and sendign data between the game and the BoltBox server is a necessity and is done through a websocket connection and several callback functions specified before launching the ui instance. The callback functions use be used in place of events and will be called in several cases including.

  • When a server message is recieved through websocket
  • When a user sends a message to the server

These callback functions are specified to the server through the defineCallback function.

defineCallback(messageCallback, userMessageCallback);

These functions can be defined through the BoltBoxGame constructor aswell or through this function, however it is highly encouraged that they are definied through the constructor.

To start creating a new BoltBox game first run

npm init

Then inside the generated package.json file add a new line that says

"game": true

This will allow BoltBox to find the game when scanning through node_modules.