3 ms·
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
by soylentgraham 6y 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/Server/Games/Minesweeper.js 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.
- nicolodavis 6y ago@soylentgraham: You should check out the recent releases of https://boardgame.io/ https://boardgame.io/. The tutorials are now rewritten with a focus on the plain JS client (no React).
- soylentgraham 6y agooh 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
- captn3m0 6y agoDamn, I missed this. I hated having to install create-react-app (with 100s of MB of dependencies)