https://github.com/msabaeian/terminal-card-game
https://github.com/msabaeian/terminal-card-game
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/msabaeian/terminal-card-game
- Owner: msabaeian
- Created: 2024-04-02T20:42:50.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-11T19:38:30.000Z (over 1 year ago)
- Last Synced: 2025-01-11T00:29:56.012Z (6 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.

#### 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:




