Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/msabaeian/terminal-card-game
https://github.com/msabaeian/terminal-card-game
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/msabaeian/terminal-card-game
- Owner: msabaeian
- Created: 2024-04-02T20:42:50.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-04-11T19:38:30.000Z (9 months ago)
- Last Synced: 2024-11-12T04:35:15.777Z (2 months ago)
- Language: TypeScript
- Size: 1.61 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
This is an experimental implementation of a four-people card game in TypeScript using terminal-kit.
#### App Cycle:
Coming from a web and mobile background, I tried to apply some of their principles to handle the terminal. For instance, window in this project is similar to Activity on mobile or Page for web applications. Each window can contain several scenes, which represent different stages of a page, and each scene could contain different panes, representing desired areas of a scene.
![Structure](./images/structure-diagram.png "Structure")
#### Key Handler:
I decided to separate the handling for key inputs. `app/utils/input.handler.ts` is mainly responsible for inputs. If the pressed key isn't "q" or "ctrl+c", it passes the key to the active window's key handler.
#### Folder Structure:
- app
- windows
- [window name]
- index.ts (main file) - required
- input.handler.ts (window input handler) - optional
- mocks.ts - optional
- utils (helpers and types)
- store
- [slice name]
- actions.ts
- [name]Slice.ts
- selectors.ts#### Screenshots:
![Auth](./images/auth.png "Auth")
![Rooms](./images/rooms.png "Rooms")
![Room](./images/room.png "Room")
![Room](./images/room-2.png "Room")
![Game](./images/game.png "Game")