Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

[Tool] Web API for talking to the button board

A topic by mildmojo created Sep 29, 2017 Views: 223 Replies: 1
Viewing posts 1 to 2
Submitted (2 edits) (+1)

Hi, all.

I wrote a tool to help people make 100-button games with any language, tool, or framework that can talk to the web.

Buttons Are Cool Gateway Server is an app that exposes the 100-button board—connected on serial port(s)—as a web API. You can query the board with a regular HTTP GET or get realtime button events over a WebSocket. There are standalone downloads for Linux, Mac, and Windows.

I wrote this server to help people who are using languages or frameworks that can't easily talk to custom hardware. It also provides an emulation mode where you can use a web browser (or tablet, or phone) to simulate the button board, making the server send button events as if a real board was attached. Great for testing.

The server has a feature that can launch your game and then exit when your game exits, too, so you can make small batch files that run the whole shebang transparently.

There should be good WebSockets and HTTP libraries for most languages. Full documentation for the server is available on GitHub, and the project is released under the WTFPL.

Let me know if you have any questions! Show me what you make! You can ask here or on Twitter at @mildmojo.

Submitted

I've updated the server to v1.2.1, which fixes bugs in the code that translates button numbers from what the board reports to the way they're physically laid out. It also adds a new WebSocket message that tells you the entire state of the board, sent once when you first connect.

NOTE: If you're using regular HTTP requests to `/buttons`, the device property `length` is now `buttonCount` and the `buttons` object is now a flat array of true/false values in button number order. Adjust your code accordingly. See the documentation for details.

Server v1.3.0 release