Skip to content

A websocket server and textual client for multiplayer hearts

License

Notifications You must be signed in to change notification settings

draggor/hearts-textual

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

133 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hearts-textual

This is a silly little project to use websockets as the basis for a multiplayer hearts game server, and textual as the initial client for it.

How To Use

git clone https://github.com/draggor/hearts-textual.git
cd hearts-textual

# Requires a python3.11 binary on your path
make install

# for server
make server

# for 1 - 4 clients
make client

Requirements

Design Goal

To generally us python typing, dataclasses, websockets, and textual to make a functioning multiplayer hearts game. The TUI should allow full keyboard navigation but also use textual's mouse interactions, and allow keyboardless operation as well.

High level TODO

  • Create a websocket server that runs forever, and allows clients to connect
  • Create a dumb client that can send/recieve JSON, and on the server side have it parse into the command schema for us
  • Have the client use the same command schema to parse server messages
  • handle passwords and reconnects
    • map Player instances to the websocket, and vice versa
    • using primitive passwords, allow rejoining
    • probably require unique usernames/validation
  • THE RULES
    • get points assigned to hearts and QC
    • deal out a hand
    • play cards one person at a time
    • some rules maybe?
    • continue to work on game loop turn order, out of turn can still happen
    • turn order being correctly written, but not being used/handled
  • Create a textual TUI
    • renders your hand of cards
    • renders active plays (play area demo in place, need to actually do this part)
    • renders all necessary game state for a turn
    • way to check on / show full game state: score, rounds, etc
    • clock/turn timer for funsies?
    • keyboard bindings: tab/shift tab and enter work
    • mouse interactions: got this for free, huzzah textual!

About

A websocket server and textual client for multiplayer hearts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published