Multi-player HTML5 Poker Game WIP - Using Phaser and Socket.IO

Описание к видео Multi-player HTML5 Poker Game WIP - Using Phaser and Socket.IO

This has been my latest side-project to add to my portfolio. It's a multi-player poker game, powered by Phaser in the front-end and Socket.IO in the back-end.

This is also my first real attempt at a multi-player game, and coding a multi-player game is a LOT harder than it's single-player counterpart. I don't care what anyone says.

The in-game poker logic is mostly done, so I've been spending a lot of time on the back-end logic.

What I'm currently working on is handling those untimely situations of a player leaving a game mid-game, either because their connection died, or they closed their browser tab.

The Watch button there is for Spectator mode, which I haven't coded yet.

In between rounds, you'll be able to:
🟢 join a game if you were watching (if there are any open slots - max players is six)
🟢 watch a game if you were playing (there is no limit to the number of spectators, but there is currently no UI that shows how many people are watching. I might do the "eye" icon with a number next to it, and stick it in a corner or something.
🟢 leave the game room and return to the lobby

Leaving a game mid-game messes up the state, because the server and all the players need to be updated on who just left, so I'll need to improvise here.

My original strategy was to treat it as the player folding, then when the round ends, automatically remove said player from the game. But this was causing problems, because if a player's connection is lost, their socket is also gone. I decided to just abruptly remove them from the game, forfeiting their hand.

Leaving mid-game also causes problems if it also happens to be the turn of the player who left. I decided to just move to the next player's turn.

Even more, every game needs to have a dealer (D), a small blinds (SB), a big blinds (BB), and a host.

(The host is not part of poker - that's a design rule for my particular setup here. By default, the host is the person who originally create the game room. The host is also responsible for starting each game when all the players are ready. The host is indicated by the star icon.)

So, if the D, SB, or BB leaves, then the next person (to their left) automatically assumes that role. It's also perfectly normal for one player to have more than one role.

There's also a lobby where players will go once they've connected to the server. Here you'll be able to chat with other players, host your own game, or join an exiting game. Both hosting and joining are demonstrated in the video.

You can learn more about the project here:
🟢 Starting On Multiplayer Poker Game For HTML5 Using Phaser
https://gameplaycoder.com/starting-on...

🟢 Part 1
https://gameplaycoder.com/creating-a-...

🟢 Part 2
https://gameplaycoder.com/creating-a-...

🟢 Part 3
https://gameplaycoder.com/creating-a-...

I'm looking forward to completing this one. This project has definitely beena challenge.

- Ziro out.

Комментарии

Информация по комментариям в разработке