A weird multiplayer toy, for streams.
Requirement: NodeJS 7.6+
npm install
node server.js
- Browse to
http://localhost:3000
Most of the code is in server.js
and static/index.html
.
Prerequisites: npm install -g browser-refresh node-inspector forever
browser-refresh server.js
: Launches the app, and makes the server and browser refresh when needed upon file changes.node-debug server.js
: Launches the app in debug mode.forever start forever.json
: Launches the app, making it automatically recover in case of crashes. Can then be stopped withforever stop studio
.
Root attributes
width
Width of the scene in pixelsheight
Height of the scene in pixelselements
An array of Elements
Element attributes: general
id
A unique identifier. Also used for building the controls legendpath
The picture pathtype
(optional) The element type, among those defined instatic/element-plugins.js
. **image
= A simple image **background
= An image stretched to fit the size of the scenewidth
(optional) The element width in pixelsheight
(optional) The element height in pixelsz
(optional) The z-index, set to zero by default
Element attributes: actions
Actions are defined in static/action-plugins.js
.
actions.talk
(optional) A key to hold in order to animate the sprite as if it was talkingactions.toggle
(optional) A key to press to toggle the spite visibilityactions.move
(optional) True if the element can be moved
Element attributes: initial state
These attributes can be overrided by the live scene state.
init_hidden
(optional) Whether the element is hiddeninit_x
(optional) Horizontal positioninit_y
(optional) Vertical position
A map of element states. The keys are the IDs of the elements, the values may have the following keys:
hidden
Whether the element is visiblex
Horizontal positiony
Vertical position