update readme, hand display in client2
This commit is contained in:
parent
f06754fcfe
commit
cf2851f376
43
README.md
43
README.md
@ -10,18 +10,47 @@ Other decisions made to deal with Websockets, which I'm learning as I go, and ha
|
|||||||
## What's implemented
|
## What's implemented
|
||||||
* All cards and effects (Jokers are Valkyires)
|
* All cards and effects (Jokers are Valkyires)
|
||||||
* A hacky loop to test out game commands
|
* A hacky loop to test out game commands
|
||||||
* Janky client and server
|
* Janky clients (one command prompt, one slightly nicer command prompt) and server
|
||||||
|
|
||||||
## What's not implemented
|
## What's not implemented
|
||||||
* Ready checking
|
* better clients
|
||||||
* Multiple matches in server
|
|
||||||
* picking who goes first
|
|
||||||
|
|
||||||
## How to build
|
## How to build
|
||||||
Run "make all" to generate all three binaries (engine,client,server).
|
Run "make all" to generate all four binaries (engine,client,client2,server).
|
||||||
|
|
||||||
Otherwise, run "make [binary name]" to geneerate a specific one.
|
Otherwise, run "make [binary name]" to geneerate a specific one.
|
||||||
|
|
||||||
|
## How to use clients
|
||||||
|
|
||||||
|
"client" is a raw command line option that lets you control everything sent to the server outside of polling.
|
||||||
|
"client2" has a TUI interface that shows the current state at all times and will automatically update on server BroadcastUpdate events
|
||||||
|
|
||||||
|
Both use the following commands:
|
||||||
|
|
||||||
|
###Session Commands:
|
||||||
|
Session commands can be input at any time
|
||||||
|
Session commands are prefixed with "0":
|
||||||
|
|
||||||
|
0 query: Tell the server you're looking for a game
|
||||||
|
0 join: Join the game the server created for you
|
||||||
|
0 leave: Leave the game and kill the client
|
||||||
|
|
||||||
|
### State Commands:
|
||||||
|
State commands are prefixed with "1":
|
||||||
|
|
||||||
|
1 b: Tell the server you're ready. If both players have readied up, choose to go first and start the game
|
||||||
|
1 s: Start your turn if possible
|
||||||
|
1 e: End your turn if possible
|
||||||
|
1 g: Get a copy of the current game state
|
||||||
|
|
||||||
|
### Action commands:
|
||||||
|
Action commands are prefixed with "2":
|
||||||
|
|
||||||
|
2 s: Scry your life points in cards
|
||||||
|
2 d <x>: Draw card at position x from your most recent scry
|
||||||
|
2 p <x> <y>: play card at postion x in your hand to postion y on your side of the board (from the left)
|
||||||
|
2 m <x> <y>: move card at position x on the board to position y on the board
|
||||||
|
2 a <x> <y>: attack position y with card at position x on the board
|
||||||
|
|
||||||
## How to test
|
## How to test
|
||||||
Run the engine binary to use the built in game loop.
|
Run the engine binary to use the built in game loop.
|
||||||
@ -54,8 +83,6 @@ Example Commands:
|
|||||||
a 2 d 2: Player 2 (Scourge) draws the card at position 2 of their most recent scry
|
a 2 d 2: Player 2 (Scourge) draws the card at position 2 of their most recent scry
|
||||||
|
|
||||||
## Other notes:
|
## Other notes:
|
||||||
Player 1 (the top side of the board) is known as Sentinal.
|
Player 1 (the top side of the board) is known as Sentinal and is the first person to join the match.
|
||||||
Player 2 (the bottom side of the board) is known as Scourge.
|
Player 2 (the bottom side of the board) is known as Scourge.
|
||||||
Yes these are from DOTA Allstars
|
Yes these are from DOTA Allstars
|
||||||
|
|
||||||
Any player can begin the game; whichever player presses the start command first goes first
|
|
||||||
|
@ -97,6 +97,7 @@ func main() {
|
|||||||
if container.State != nil && container.State.Player != nil && container.State.Player.Hand != nil {
|
if container.State != nil && container.State.Player != nil && container.State.Player.Hand != nil {
|
||||||
cols = len(container.State.Player.Hand)
|
cols = len(container.State.Player.Hand)
|
||||||
}
|
}
|
||||||
|
hand.Clear()
|
||||||
for c := 0; c < cols; c++ {
|
for c := 0; c < cols; c++ {
|
||||||
color := tcell.ColorWhite.TrueColor()
|
color := tcell.ColorWhite.TrueColor()
|
||||||
ce := "_"
|
ce := "_"
|
||||||
|
Loading…
Reference in New Issue
Block a user