GithubHelp home page GithubHelp logo

nathanharper / chiquitita Goto Github PK

View Code? Open in Web Editor NEW
1.0 4.0 0.0 232 KB

Hacky attempt to set up a "TwitchPlaysPokemon" style linux server with Zsnes and xdotool

License: MIT License

Shell 7.71% Lua 76.14% JavaScript 16.15%

chiquitita's Introduction

Chiquitita

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!

Install and Run


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

Configuration


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).

TODO


  • 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.

Special Thanks


I yoinked the wonderful HTML/CSS snes controller from Tim Pietrusky on Codepen!

chiquitita's People

Contributors

nathanharper avatar

Stargazers

Adrian van Dongen avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

chiquitita's Issues

Failed creating new xdo instance

Hi @nathanharper, everything ok?

I was trying to run your app and after installing everything needed, when typing the command:

./run_http.sh super_mario.smc

I come across the following errors:

Error: Can't open display: (null)
Failed creating new xdo instance
ZSNES_ID is
Opening 'http://35.247.254.102:80' with default browser.
./run_http.sh: line 17: xdg-open: command not found
Server PID: 22212
root@instance-1:/home/treizecontato/snes# events.js:183
      throw er; // Unhandled 'error' event
      ^


Error: listen EADDRINUSE :::80
    at Object._errnoException (util.js:1022:11)
    at _exceptionWithHostPort (util.js:1044:20)
    at Server.setupListenHandle [as _listen2] (net.js:1367:14)
    at listenInCluster (net.js:1408:12)
    at Server.listen (net.js:1492:7)
    at Object.<anonymous> (/home/treizecontato/snes/server/server.js:49:8)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
Error: Can't open display: (null)
> Failed creating new xdo instance
> ZSNES_ID is
> Opening 'http://35.247.254.102:80' with default browser.
> ./run_http.sh: line 17: xdg-open: command not found
> Server PID: 22212
> root@instance-1:/home/treizecontato/snes# events.js:183
>       throw er; // Unhandled 'error' event

However, when opening the browser, a snes control appears and says that the status is online, but the zsnes emulator does not open together.
Could you help me solve it?
Your app is active in: http://35.247.254.102/

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.