Show HN: My first game, a mini battle-royale in the browser
werlocks.ioHow do I move, I tried AWSD, JIKL, arrows, ... and I didn't move.
Sometimes it's easier to get traction here with a technical post. What is the tech stack?
Edit: I think I found a bug https://imgur.com/a/DKrsNS0 If a Sun Strike is casted and a round ends, then the partial circle appears in all the following rounds. (Moreover, I can't move, so I was very vulnerable to Sun Strike :( .)
It’s like a MOBA or RTS, right click to move. Thanks anyway for trying it out!
I used Phaser for the game engine. Both the client and server run Phaser instances. I used React / Redux for the UI (this was a fun use case actually, having both a game and a traditional interface communicating with each other through Redux). The server is written in Node with a simple express server. I wrote a custom game manager that handles spinning up Phaser instances, placing players in them, and shutting down stale ones.
The network architecture is built on a combination of Websockets, WebRTC, and good ol’ HTTP.
Websockets is for all real time communication that I definitely want to go through (casting spells, players dying, etc).
I used WebRTC to handle communication for things that don’t need to come through reliably (game state). It treats the server as a “peer”, but only for the purpose of being able to blast packets back and forth without the overhead of a persistent connection.
HTTP is for general account management, matchmaking, and game creation.
Edit: You’re right, that’s totally a bug. Guess I need to do a better job of cleaning up after a round!
Right click works! I'm using a touchpad, so left click is much easier.
I once appeared in the middle of 4 objects, and I couldn't move until someone send me a Wave.
Some path finding may be nice to go around obstacles (at least 1x1 obstacles), but I don't play these kind of games too often, so I don't know what most people expect.