-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDEV.note
More file actions
91 lines (85 loc) · 7.26 KB
/
Copy pathDEV.note
File metadata and controls
91 lines (85 loc) · 7.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
::::::::::::: 📓DEV NOTE :::::::::::::
🏪 OVERVIEW OF CLI
` TARES_CLI is a cli terminal word scrumble multipler game built with Golang enabling websocket connections
from the terminal. Multiple user connect and and when a user joins, the game manager (another aspect of the game)
connects the users to an available room. If no rooms are available current, or no player is online, current user can
connect later or request to wait in line.
User can also opt to play singularly , by which the points they earned are half what's earned in a multiplayer mode
There will be a CREED BOARD - of all users and their standings from the first to the the 100th
#Scores users accumulate is the determinant of the position on the BOARD
# Scores are measures of difficulty of level:
- Player modes have a base score + a force-multiplier- (a percentage of players
in room where score was obtained - *(n-1))
`
BUILD PHILOSOPHY :
------------------ TARES GAME CLI ----------------------
┌─────────────────────────────────────────────────────────┐
│ TARES SYSTEM │
│ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ tares-client │ │ tares-client │ │
│ │ (Player 1) │ │ (Player 2) │ │
│ │ │ │ │ │
│ │ Terminal UI │ │ Terminal UI │ │
│ └──────┬───────┘ └──────┬───────┘ │
│ │ WebSocket │ WebSocket │
│ │ │ │
│ ▼ ▼ │
│ ┌─────────────────────────────────────────┐ │
│ │ tares-server │ │
│ │ │ │
│ │ ┌─────────┐ ┌─────────────────┐ │ │
│ │ │ Room │ │ RoomManager │ │ │
│ │ │ Manager │─────►│ matches players│ │ │
│ │ └─────────┘ │ into rooms │ │ │
│ │ └─────────────────┘ │ │
│ │ ┌──────────────────────────────────┐ │ │
│ │ │ Game Room │ │ │
│ │ │ │ │ │
│ │ │ player1 ◄──────────────────► │ │ │
│ │ │ player2 shared game state │ │ │ │
│ │ │ (mutex protected) │ │ │ │
│ │ │ │ │ │ │
│ │ │ timer goroutine running │ │ │ │
│ │ │ independently │ │ │ │
│ │ └──────────────────────────────────┘ │ │
│ │ │ │
│ │ REST API: /stats /leaderboard │ │
│ └─────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
# How the components should interract together
┌─────────────────────────────────────────────────────────────┐
│ TARES SERVER │
│ │
│ ┌─────────────────────┐ ┌─────────────────────────┐ │
│ │ HTTP REST API │ │ WebSocket Server │ │
│ │ │ │ │ │
│ │ POST /auth/register│ │ ws://host/game │ │
│ │ POST /auth/login │ │ │ │
│ │ GET /leaderboard │ │ - real-time game state │ │
│ │ GET /stats/:name │ │ - word submissions │ │
│ │ │ │ - score updates │ │
│ └──────────┬──────────┘ └───────────┬──────────────┘ │
│ │ │ │
│ └─────────────┬─────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────┐ │
│ │ Game Engine │ │
│ │ │ │
│ │ - Room management │ │
│ │ - Word validation │ │
│ │ - Score calculation │ │
│ │ - Timer management │ │
│ │ - Matchmaking │ │
│ └─────────────┬───────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ Database │ │
│ │ │ │
│ │ - Users │ │
│ │ - Game history │ │
│ │ - Leaderboard │ │
│ └─────────────────┘ │
└─────────────────────────────────────────────────────────────┘