Inspired by "TwitchPlaysPokemon", this is a way for multiple users to simultaneously play a remote SNES emulator via a web interface. Invite your friends to join in and try to play the game at the same time, resulting in much confusion and anguish. Screencast the game for even more fun!
To install:
sudo apt-get install nodejs npm zsnes xdotool git git clone https://github.com/nathanharper/Chiquitita.git cd Chiquitita npm install
This command will start up the zsnes emulator, start a server at http://localhost:12345, and open it in a browser window. You can theoretically use other snes emulators, or basically anything that runs in an X window. Should work on Linux and Mac, though dependency installation method will obviously vary.
./run_http.sh super_mario.smc
To just start the server with ZSNES already running, do this (replacing [PORT] with the port to run the server on):
node server/server.js "$(xdotool search --class ZSNES|awk 'NR==1{print $1}')" [PORT] http
If you're not using the default ZSNES configuration scheme, or you're trying to configure this for another emulator, you can change the server/keys.json file. It's a straightforward JSON array of char/key codes and the button name associated with each (for more details on the codes, check out jQuery's documentation for event.which).
- I'd like to make it so that subsequent keypresses always trump the prior one, to make the multi-player support a bit wackier.
- Might be worth it to make a native Node binding to libxdo instead of delegating to shell.
I yoinked the wonderful HTML/CSS snes controller from Tim Pietrusky on Codepen!