Dividat Play is a web-based environment for playing games with the Dividat Senso hardware. It is capable of loading and running "external" games (that is games that are not developed in the same codebase). This repository contains documentations and examples on how to develop games for usage with Dividat Play and Senso.
- Play: Dividat Play is a web application that loads games according to personal training plans and manages hardware connectiviy.
- Game: The game you are developing can be developed in any language or framework that can target the Web platform (e.g. Unity, Phaser, ClojureScript). The game connects to Play via a protocol called the External Game Interface (EGI).
- Senso: Used as controller for the games. Play connects to the Dividat Senso and acts as a proxy between the hardware and your game.
The Game communicates to Play via a message based protocol. Play sends messages to your game and your game sends messages to Play.
To use the EGI a small JavaScript library must be loaded which is available at https://play.dividat.com/PlayEGI.js. A description of the library is available as a TypeScript declaration.
The game is loaded by Play in an iframe
. EGI messages are sent with the Window.postMessage()
method.
The Senso signal consists of a series of x
, y
and f
measurements for each of the plates. The x
and y
values describe a position on the Senso's surface with (0, 0)
in the upper left and (3, 3)
in the lower right corner. The f
value describes the "force" as a number between 0 and 1, where 1 is the maximum force the sensors can theoretically measure.
A development tool that implements the EGI is available at https://play.dividat.com/playDev.html.
The PlayDev environment, like the actual Play application, does not forward arbitrary keyboard events when running games. Specific keys are translated and forwarded as Senso inputs:
- The arrow keys for the outer plates
- The space key for the center plate
Keydown and keyup events are sent as Step
and Release
events, respectively.
Examples are provided to illustrate developement of Games for Play:
hello-clojure
: A simple ClojureScript app illustrating usage of EGI.
TODO: More examples.