laneya2

cave exploration game
git clone https://git.ce9e.org/laneya2.git

commit
d590af138e5c646344a93cc03c11e7b405ba93b1
parent
f105a60b7fb1d334f3b2bddd48129acb9a80f82b
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2024-10-08 06:32
expand README

Diffstat

M README.md 42 +++++++++++++++++++++++++++++++++++++++++-

1 files changed, 41 insertions, 1 deletions


diff --git a/README.md b/README.md

@@ -7,6 +7,46 @@ Explore caves with your friends.
    7     7           #....>.....#
    8     8 ###########.@........#
    9     9 .....................#
   10    -1 ###########..........#
   -1    10 ###########.......@..#
   11    11           #..........#
   12    12 ```
   -1    13 
   -1    14 # How to play
   -1    15 
   -1    16 Visit `https://cave.ce9e.org/` to start playing. This will generate a random
   -1    17 game ID. You need to share the generated link with your friends so you are all
   -1    18 in the same game.
   -1    19 
   -1    20 Your goal is to move deeper into the cave. When all players stand on the ladder
   -1    21 (`>`), you move on to the next level. But beware! Monsters get stronger and
   -1    22 stronger as you venture further into the cave.
   -1    23 
   -1    24 Use the arrow keys or WASD to move. You can attack monsters simply by moving in
   -1    25 their direction. Monsters drop items which you can pick up using the `E` key.
   -1    26 You can use items by opening the menu (`Q`), navigate to the item (up/down)
   -1    27 and then use the `E` key. You can also drop items by pressing right instead.
   -1    28 
   -1    29 Monsters may drop equipment. You can equip one armor and one weapon at a time.
   -1    30 The effects of items is displayed on the top of the menu.
   -1    31 
   -1    32 If you die or get disconnected, all your items drop in your last position. You
   -1    33 can reload the page to respawn and get all of your items back. But if all of
   -1    34 you die at the same time, the game is lost and you have to restart from the
   -1    35 top.
   -1    36 
   -1    37 # Architecture
   -1    38 
   -1    39 There is a server (written in go) and a web based client. There could be
   -1    40 multiple different clients (the UI is geared towards terminals), but for now
   -1    41 the focus is on a web client because that is easy to use for anyone.
   -1    42 
   -1    43 Communication happens via websockets. Messages are encoded as JSON and always
   -1    44 contain an `action`. Additional fields depend on the specific action.
   -1    45 
   -1    46 All logic happens in the `Game.run()` goroutine. `Player.readPump()`,
   -1    47 `Player.writePump()`, and `Monster.run()` are additional goroutines, but they
   -1    48 only send messages to the game. This way, there is no risk of concurrency
   -1    49 issues and the game is always in a consistent state.
   -1    50 
   -1    51 The only exception is field of view calculation: That happens on the client for
   -1    52 performance reasons.