Hacker News new | ask | show | jobs
by soylentgraham 2188 days ago
Ditto; the client side code needs no game logic, only aiding UX; dont let the user click outside a minesweeper board, but if it does, the server still validates.

I made a System inspired by boardgame.io (but it was too integrated with react for me), which means i can write the game on the server without writing any client code at all. the client gets a list of valid moves, and my debug view gets error messages and a bunch of buttons & drop downs for parameters.

https://github.com/NewChromantics/PopNotPoker/blob/master/Se... here's multiplayer minesweeper:) Http://not.poker

All the real work is in the lobby code anyway.

1 comments

@soylentgraham: You should check out the recent releases of https://boardgame.io/. The tutorials are now rewritten with a focus on the plain JS client (no React).
oh cool, I gave up with boardgame.io in the end (I liked the API design though) because I spent 99% of my time trying to rip it out of react (both server and client) so I could use it in a non-web situation. (I have a game engine with high-level JS, and the game server/client is only one small part of it)

Maybe I can go back, although I'm writing game logic much faster now I'm in NIH territory, it would be nice to contribute to someone else's project

Damn, I missed this. I hated having to install create-react-app (with 100s of MB of dependencies)